From 2d958dd670285a3ba02ac8e38a9e3ae84c775914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=9C=8B=E7=A8=8B?= Date: Fri, 18 Nov 2022 17:08:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20V23=E6=8E=A5=E5=8F=A3=E6=94=B9?= =?UTF-8?q?=E9=80=A0=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit V23接口改造适配 Log: V23接口改造适配 Influence: 无 Task: https://pms.uniontech.com/task-view-207483.html Change-Id: Ide530c023ea41f86fad2e8001ec67f1afaa897ab --- .project | 3 +- CMakeLists.txt | 2 - frame/controller/dockitemmanager.cpp | 14 -- frame/controller/dockitemmanager.h | 4 - frame/controller/recentapphelper.cpp | 174 ------------------ frame/controller/recentapphelper.h | 13 +- frame/dbus/dbusclientmanager.cpp | 28 --- frame/dbus/dbusclientmanager.h | 89 --------- frame/dbus/dbusdisplay.cpp | 2 +- frame/dbus/dbusdisplay.h | 12 +- frame/dbus/dbusdockadaptors.h | 6 +- frame/dbus/dockinterface.cpp | 11 +- frame/dbus/dockinterface.h | 5 +- frame/dbus/entryinterface.cpp | 5 - frame/dbus/entryinterface.h | 6 +- ...ck.xml => org.deepin.dde.daemon.Dock1.xml} | 2 +- ...ink.xml => org.deepin.dde.Audio1.Sink.xml} | 2 +- .../xml/org.deepin.dde.Audio1.xml | 2 +- ...isplay.xml => org.deepin.dde.Display1.xml} | 2 +- .../xml/org.deepin.dde.Gesture1.xml | 2 +- ...ncher.xml => org.deepin.dde.Launcher1.xml} | 0 .../xml/org.deepin.dde.Timedate1.xml | 2 +- ....xml => org.deepin.dde.XEventMonitor1.xml} | 2 +- .../xml/org.deepin.dde.daemon.Dock1.xml | 2 +- frame/display/displaymanager.h | 4 +- frame/item/appitem.cpp | 14 -- frame/item/appitem.h | 7 - frame/item/appmultiitem.cpp | 4 - frame/item/components/appdragwidget.cpp | 4 +- frame/main.cpp | 4 +- frame/util/dbusutil.h | 53 +----- frame/util/dockpopupwindow.h | 4 +- frame/util/menuworker.cpp | 9 - frame/util/multiscreenworker.cpp | 41 +---- frame/util/multiscreenworker.h | 10 +- frame/util/touchsignalmanager.cpp | 2 +- frame/util/touchsignalmanager.h | 4 +- frame/window/components/datetimedisplayer.cpp | 6 +- frame/window/components/datetimedisplayer.h | 4 +- frame/window/mainpanelcontrol.cpp | 3 +- frame/window/tray/dbustraymanager.h | 2 +- .../window/tray/widgets/indicatortrayitem.cpp | 4 +- frame/window/traymanagerwindow.h | 4 +- frame/window/windowmanager.cpp | 4 +- interfaces/constants.h | 6 +- plugins/CMakeLists.txt | 1 - plugins/airplane-mode/airplanemodeitem.cpp | 15 +- plugins/airplane-mode/airplanemodeitem.h | 4 +- ...e.xml => org.deepin.dde.AirplaneMode1.xml} | 2 +- plugins/bluetooth/bluetooth.json | 2 +- plugins/bluetooth/bluetoothitem.cpp | 10 - .../bluetooth/componments/adaptersmanager.cpp | 10 +- .../bluetooth/componments/adaptersmanager.h | 4 +- .../componments/bluetoothadapteritem.cpp | 2 +- .../componments/bluetoothadapteritem.h | 4 +- .../bluetooth/componments/bluetoothapplet.cpp | 12 +- .../bluetooth/componments/bluetoothapplet.h | 4 +- ...e.xml => org.deepin.dde.AirplaneMode1.xml} | 2 +- ...ooth.xml => org.deepin.dde.Bluetooth1.xml} | 2 +- plugins/datetime/datetime.json | 2 +- plugins/datetime/datetimeplugin.cpp | 22 +-- plugins/datetime/datetimewidget.cpp | 2 +- plugins/datetime/datetimewidget.h | 4 +- .../xml/org.deepin.dde.Timedate1.xml | 2 +- plugins/disk-mount/CMakeLists.txt | 26 --- .../dbus/com.deepin.daemon.DiskMount.xml | 31 ---- plugins/disk-mount/dbus/dbusdiskmount.cpp | 30 --- plugins/disk-mount/dbus/dbusdiskmount.h | 113 ------------ plugins/disk-mount/dbus/variant/diskinfo.cpp | 86 --------- plugins/disk-mount/dbus/variant/diskinfo.h | 61 ------ plugins/disk-mount/disk-mount.json | 3 - plugins/disk-mount/diskcontrolitem.cpp | 132 ------------- plugins/disk-mount/diskcontrolitem.h | 59 ------ plugins/disk-mount/diskcontrolwidget.cpp | 100 ---------- plugins/disk-mount/diskcontrolwidget.h | 55 ------ plugins/disk-mount/diskmountplugin.cpp | 144 --------------- plugins/disk-mount/diskmountplugin.h | 66 ------- plugins/disk-mount/diskpluginitem.cpp | 91 --------- plugins/disk-mount/diskpluginitem.h | 58 ------ plugins/disk-mount/imageutil.cpp | 38 ---- plugins/disk-mount/imageutil.h | 34 ---- plugins/disk-mount/resources.qrc | 10 - plugins/disk-mount/resources/icon-small.svg | 13 -- plugins/disk-mount/resources/icon.svg | 28 --- plugins/disk-mount/resources/unknown.svg | 40 ---- .../disk-mount/resources/unmount-hover.png | Bin 449 -> 0 bytes .../disk-mount/resources/unmount-normal.png | Bin 497 -> 0 bytes .../disk-mount/resources/unmount-press.png | Bin 493 -> 0 bytes plugins/display/brightnessmodel.cpp | 6 +- plugins/display/collaborationdevmodel.cpp | 6 +- plugins/keyboard-layout/dbusadaptors.cpp | 17 +- plugins/keyboard-layout/dbusadaptors.h | 8 +- ... org.deepin.dde.InputDevice1.Keyboard.xml} | 2 +- plugins/keyboard-layout/keyboardplugin.cpp | 6 +- plugins/keyboard-layout/keybord_layout.json | 12 +- ... => org.deepin.dde.daemon.Dock1.Entry.xml} | 0 ...ck.xml => org.deepin.dde.daemon.Dock1.xml} | 0 plugins/onboard/onboardplugin.cpp | 4 +- plugins/overlay-warning/CMakeLists.txt | 2 +- ...icy => org.deepin.dde.dock.overlay.policy} | 0 .../overlay-warning-plugin.cpp | 2 +- .../plugin-guide/plugins-developer-guide.md | 6 +- plugins/power/dbus/dbusaccount.cpp | 2 +- plugins/power/dbus/dbusaccount.h | 14 +- plugins/power/dbus/dbuspower.cpp | 4 +- plugins/power/dbus/dbuspower.h | 12 +- ...on.Power.xml => org.deepin.dde.Power1.xml} | 2 +- ...er.xml => org.deepin.dde.SystemPower1.xml} | 2 +- plugins/power/power.json | 2 +- plugins/power/powerplugin.cpp | 16 +- plugins/power/powerplugin.h | 4 +- plugins/shutdown/dbus/dbusaccount.cpp | 2 +- plugins/shutdown/dbus/dbusaccount.h | 14 +- plugins/shutdown/dbus/dbuspowermanager.cpp | 2 +- plugins/shutdown/dbus/dbuspowermanager.h | 8 +- plugins/shutdown/shutdownplugin.cpp | 30 +-- ...ink.xml => org.deepin.dde.Audio1.Sink.xml} | 2 +- .../xml/org.deepin.dde.Audio1.xml | 2 +- plugins/sound/sound.json | 2 +- plugins/sound/soundapplet.cpp | 6 +- plugins/sound/soundapplet.h | 8 +- plugins/sound/sounddeviceswidget.cpp | 6 +- plugins/sound/sounddeviceswidget.h | 8 +- plugins/sound/sounditem.cpp | 10 - plugins/sound/sounditem.h | 4 +- plugins/sound/soundwidget.cpp | 6 +- plugins/sound/soundwidget.h | 8 +- plugins/tray/dbus/dbustraymanager.cpp | 2 +- plugins/tray/dbus/dbustraymanager.h | 2 +- ...er.xml => org.deepin.dde.TrayManager1.xml} | 2 +- .../xml/org.deepin.dde.Gesture1.xml | 2 +- .../xml/org.deepin.dde.daemon.Dock1.xml | 2 +- .../fashiontray/fashiontraywidgetwrapper.h | 4 +- plugins/tray/indicatortraywidget.cpp | 4 +- plugins/tray/snitraywidget.h | 2 +- rpm/dde-dock.spec | 2 +- tests/item/ut_appitem.cpp | 2 +- tests/util/ut_menuworker.cpp | 4 +- 138 files changed, 211 insertions(+), 1971 deletions(-) delete mode 100644 frame/dbus/dbusclientmanager.cpp delete mode 100644 frame/dbus/dbusclientmanager.h rename frame/dbus/{com.deepin.dde.daemon.Dock.xml => org.deepin.dde.daemon.Dock1.xml} (96%) rename frame/dbusinterface/xml/{org.deepin.daemon.Audio.Sink.xml => org.deepin.dde.Audio1.Sink.xml} (96%) rename plugins/sound/dbusinterface/xml/org.deepin.daemon.Audio.xml => frame/dbusinterface/xml/org.deepin.dde.Audio1.xml (97%) rename frame/dbusinterface/xml/{org.deepin.daemon.Display.xml => org.deepin.dde.Display1.xml} (98%) rename plugins/tray/dbusinterface/xml/org.deepin.daemon.Gesture.xml => frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml (95%) rename frame/dbusinterface/xml/{org.deepin.dde.Launcher.xml => org.deepin.dde.Launcher1.xml} (100%) rename plugins/datetime/dbusinterface/xml/org.deepin.daemon.Timedate.xml => frame/dbusinterface/xml/org.deepin.dde.Timedate1.xml (98%) rename frame/dbusinterface/xml/{org.deepin.api.XEventMonitor.xml => org.deepin.dde.XEventMonitor1.xml} (96%) rename plugins/tray/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml => frame/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml (98%) rename plugins/airplane-mode/dbusinterface/xml/{org.deepin.daemon.AirplaneMode.xml => org.deepin.dde.AirplaneMode1.xml} (91%) rename plugins/bluetooth/dbusinterface/xml/{org.deepin.daemon.AirplaneMode.xml => org.deepin.dde.AirplaneMode1.xml} (91%) rename plugins/bluetooth/dbusinterface/xml/{org.deepin.daemon.Bluetooth.xml => org.deepin.dde.Bluetooth1.xml} (99%) rename frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml => plugins/datetime/dbusinterface/xml/org.deepin.dde.Timedate1.xml (98%) delete mode 100644 plugins/disk-mount/CMakeLists.txt delete mode 100644 plugins/disk-mount/dbus/com.deepin.daemon.DiskMount.xml delete mode 100644 plugins/disk-mount/dbus/dbusdiskmount.cpp delete mode 100644 plugins/disk-mount/dbus/dbusdiskmount.h delete mode 100644 plugins/disk-mount/dbus/variant/diskinfo.cpp delete mode 100644 plugins/disk-mount/dbus/variant/diskinfo.h delete mode 100644 plugins/disk-mount/disk-mount.json delete mode 100644 plugins/disk-mount/diskcontrolitem.cpp delete mode 100644 plugins/disk-mount/diskcontrolitem.h delete mode 100644 plugins/disk-mount/diskcontrolwidget.cpp delete mode 100644 plugins/disk-mount/diskcontrolwidget.h delete mode 100644 plugins/disk-mount/diskmountplugin.cpp delete mode 100644 plugins/disk-mount/diskmountplugin.h delete mode 100644 plugins/disk-mount/diskpluginitem.cpp delete mode 100644 plugins/disk-mount/diskpluginitem.h delete mode 100644 plugins/disk-mount/imageutil.cpp delete mode 100644 plugins/disk-mount/imageutil.h delete mode 100644 plugins/disk-mount/resources.qrc delete mode 100644 plugins/disk-mount/resources/icon-small.svg delete mode 100644 plugins/disk-mount/resources/icon.svg delete mode 100644 plugins/disk-mount/resources/unknown.svg delete mode 100644 plugins/disk-mount/resources/unmount-hover.png delete mode 100644 plugins/disk-mount/resources/unmount-normal.png delete mode 100644 plugins/disk-mount/resources/unmount-press.png rename plugins/keyboard-layout/dbusinterface/xml/{org.deepin.daemon.InputDevice.Keyboard.xml => org.deepin.dde.InputDevice1.Keyboard.xml} (96%) rename plugins/onboard/dbusinterface/xml/{org.deepin.dde.daemon.Dock.Entry.xml => org.deepin.dde.daemon.Dock1.Entry.xml} (100%) rename plugins/onboard/dbusinterface/xml/{org.deepin.dde.daemon.Dock.xml => org.deepin.dde.daemon.Dock1.xml} (100%) rename plugins/overlay-warning/{com.deepin.dde.dock.overlay.policy => org.deepin.dde.dock.overlay.policy} (100%) rename plugins/power/dbus/{com.deepin.daemon.Power.xml => org.deepin.dde.Power1.xml} (96%) rename plugins/power/dbusinterface/xml/{org.deepin.system.SystemPower.xml => org.deepin.dde.SystemPower1.xml} (97%) rename plugins/sound/dbusinterface/xml/{org.deepin.daemon.Audio.Sink.xml => org.deepin.dde.Audio1.Sink.xml} (96%) rename frame/dbusinterface/xml/org.deepin.daemon.Audio.xml => plugins/sound/dbusinterface/xml/org.deepin.dde.Audio1.xml (97%) rename plugins/tray/dbus/{com.deepin.dde.TrayManager.xml => org.deepin.dde.TrayManager1.xml} (95%) rename frame/dbusinterface/xml/org.deepin.daemon.Gesture.xml => plugins/tray/dbusinterface/xml/org.deepin.dde.Gesture1.xml (95%) rename frame/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml => plugins/tray/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml (98%) diff --git a/.project b/.project index 97bc60c00..5199dabb7 100644 --- a/.project +++ b/.project @@ -2,6 +2,5 @@ "type": "homebrew" | "opensource", "3rdparty: ["*.xml"], "ignore": ["CHANGELOG.md", "./debian", "README.md", "./cmake", "technology-overview.md", "CMakeLists.txt", "CMakeLists.txt.user", "./plugins/plugin-guide", "./.tx", "*.qrc", "*.svg", "*.png", "*.qm", "*.ts"], - "license": ["LICENSE"], - "importantFile": ["gschema/com.deepin.dde.dock.module.gschema.xml", "interfaces/constants.h", "interfaces/pluginproxyinterface.h", "interfaces/pluginsiteminterface.h"] + "license": ["LICENSE"] } diff --git a/CMakeLists.txt b/CMakeLists.txt index 7689c1b3f..175e386f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,6 @@ endfunction(generation_dbus_interface) file(GLOB INTERFACES "interfaces/*.h") -add_compile_definitions(USE_AM) - #因为单元测试需要直接测试源代码,而主程序代码中include的单元使用了相对路径 #单元测试的CMakeLists和主程序的CMakeLists路径不同,编译单元测试时会提示找不到文件 #因此设置搜索路径 diff --git a/frame/controller/dockitemmanager.cpp b/frame/controller/dockitemmanager.cpp index 3c8e39f66..9184cbfae 100644 --- a/frame/controller/dockitemmanager.cpp +++ b/frame/controller/dockitemmanager.cpp @@ -55,17 +55,11 @@ DockItemManager::DockItemManager(QObject *parent) connect(it, &AppItem::requestActivateWindow, m_appInter, &DockInter::ActivateWindow, Qt::QueuedConnection); connect(it, &AppItem::requestPreviewWindow, m_appInter, &DockInter::PreviewWindow); connect(it, &AppItem::requestCancelPreview, m_appInter, &DockInter::CancelPreviewWindow); - -#ifdef USE_AM connect(it, &AppItem::windowCountChanged, this, &DockItemManager::onAppWindowCountChanged); -#endif - connect(this, &DockItemManager::requestUpdateDockItem, it, &AppItem::requestUpdateEntryGeometries); m_itemList.append(it); -#ifdef USE_AM updateMultiItems(it); -#endif } // 托盘区域和插件区域 由DockPluginsController获取 @@ -86,9 +80,7 @@ DockItemManager::DockItemManager(QObject *parent) connect(m_appInter, &DockInter::EntryAdded, this, &DockItemManager::appItemAdded); connect(m_appInter, &DockInter::EntryRemoved, this, static_cast(&DockItemManager::appItemRemoved), Qt::QueuedConnection); connect(m_appInter, &DockInter::ServiceRestarted, this, &DockItemManager::reloadAppItems); -#ifdef USE_AM connect(m_appInter, &DockInter::ShowMultiWindowChanged, this, &DockItemManager::onShowMultiWindowChanged); -#endif DApplication *app = qobject_cast(qApp); if (app) { @@ -225,9 +217,7 @@ void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index) connect(item, &AppItem::requestActivateWindow, m_appInter, &DockInter::ActivateWindow, Qt::QueuedConnection); connect(item, &AppItem::requestPreviewWindow, m_appInter, &DockInter::PreviewWindow); connect(item, &AppItem::requestCancelPreview, m_appInter, &DockInter::CancelPreviewWindow); -#ifdef USE_AM connect(item, &AppItem::windowCountChanged, this, &DockItemManager::onAppWindowCountChanged); -#endif connect(this, &DockItemManager::requestUpdateDockItem, item, &AppItem::requestUpdateEntryGeometries); m_itemList.insert(insertIndex, item); @@ -239,10 +229,8 @@ void DockItemManager::appItemAdded(const QDBusObjectPath &path, const int index) // 插入dockItem emit itemInserted(itemIndex, item); -#ifdef USE_AM // 向后插入多开窗口 updateMultiItems(item, true); -#endif } void DockItemManager::appItemRemoved(const QString &appId) @@ -385,7 +373,6 @@ void DockItemManager::onPluginLoadFinished() m_loadFinished = true; } -#ifdef USE_AM void DockItemManager::onAppWindowCountChanged() { AppItem *appItem = static_cast(sender()); @@ -496,4 +483,3 @@ void DockItemManager::onShowMultiWindowChanged() } } } -#endif diff --git a/frame/controller/dockitemmanager.h b/frame/controller/dockitemmanager.h index dad07c475..c0e12d798 100644 --- a/frame/controller/dockitemmanager.h +++ b/frame/controller/dockitemmanager.h @@ -67,10 +67,8 @@ private Q_SLOTS: void onPluginItemRemoved(PluginsItemInterface *itemInter); void onPluginUpdate(PluginsItemInterface *itemInter); -#ifdef USE_AM void onAppWindowCountChanged(); void onShowMultiWindowChanged(); -#endif private: explicit DockItemManager(QObject *parent = nullptr); @@ -82,11 +80,9 @@ private: void manageItem(DockItem *item); void pluginItemInserted(PluginsItem *item); -#ifdef USE_AM void updateMultiItems(AppItem *appItem, bool emitSignal = false); bool multiWindowExist(quint32 winId) const; bool needRemoveMultiWindow(AppMultiItem *multiItem) const; -#endif private: DockInter *m_appInter; diff --git a/frame/controller/recentapphelper.cpp b/frame/controller/recentapphelper.cpp index fdeb1ec15..bec585701 100644 --- a/frame/controller/recentapphelper.cpp +++ b/frame/controller/recentapphelper.cpp @@ -42,9 +42,6 @@ void RecentAppHelper::setDisplayMode(Dock::DisplayMode displayMode) { bool lastVisible = dockAppIsVisible(); m_displayMode = displayMode; -#ifndef USE_AM - resetDockItems(); -#endif updateRecentVisible(); updateDockAppVisible(lastVisible); } @@ -52,35 +49,7 @@ void RecentAppHelper::setDisplayMode(Dock::DisplayMode displayMode) // 当在应用区域调整位置的时候,需要重新设置索引 void RecentAppHelper::resetAppInfo() { - #ifndef USE_AM - // 获取应用区域和最近打开区域的app图标 - QList appDockItem = appItems(m_appWidget); - // 获取应用区域图标在原来列表中的位置 - QList dockIndex; - for (DockItem *appItem : appDockItem) - dockIndex << m_sequentDockItems.indexOf(appItem); - - // 按照从小到大排序 - std::sort(dockIndex.begin(), dockIndex.end(), [ = ](int index1, int index2) { return index1 < index2; }); - QMap dockItemIndex; - for (int i = 0; i < appDockItem.size(); i++) { - DockItem *item = appDockItem[i]; - dockItemIndex[item] = dockIndex[i]; - } - - // 替换原来的位置 - for (DockItem *appItem : appDockItem) { - int index = -1; - if (dockItemIndex.contains(appItem)) - index = dockItemIndex.value(appItem); - - if (index >= 0) - m_sequentDockItems[index] = appItem; - else - m_sequentDockItems << appItem; - } -#endif } void RecentAppHelper::addAppItem(int index, DockItem *dockItem) @@ -96,21 +65,7 @@ void RecentAppHelper::addAppItem(int index, DockItem *dockItem) AppItem *appItem = qobject_cast(dockItem); -#ifdef USE_AM connect(appItem, &AppItem::modeChanged, this, &RecentAppHelper::onModeChanged); -#else - connect(dockItem, &QWidget::destroyed, this, [ this, dockItem ] { - if (m_sequentDockItems.contains(dockItem)) - m_sequentDockItems.removeOne(dockItem); - }); - connect(appItem, &AppItem::isDockChanged, this, &RecentAppHelper::onItemChanged); - - // 如果索引值大于0,说明它是插入到固定位置的,否则,则认为它是顺序排列的 - if (index >= 0 && index < m_sequentDockItems.size()) - m_sequentDockItems.insert(index, dockItem); - else - m_sequentDockItems << dockItem; -#endif } void RecentAppHelper::removeAppItem(DockItem *dockItem) @@ -119,10 +74,6 @@ void RecentAppHelper::removeAppItem(DockItem *dockItem) removeRecentAreaItem(dockItem); else removeAppAreaItem(dockItem); -#ifndef USE_AM - AppItem *appItem = qobject_cast(dockItem); - disconnect(appItem, &AppItem::isDockChanged, this, &RecentAppHelper::onItemChanged); -#endif } bool RecentAppHelper::recentIsVisible() const @@ -159,7 +110,6 @@ bool RecentAppHelper::eventFilter(QObject *watched, QEvent *event) return QObject::eventFilter(watched, event); } -#ifdef USE_AM void RecentAppHelper::onModeChanged(int mode) { AppItem *appItem = qobject_cast(sender()); @@ -182,32 +132,14 @@ void RecentAppHelper::onModeChanged(int mode) } updateRecentVisible(); } -#else -void RecentAppHelper::onItemChanged() -{ - bool lastVisible = dockAppIsVisible(); - resetDockItems(); - updateRecentVisible(); - updateDockAppVisible(lastVisible); -} -#endif bool RecentAppHelper::appInRecent(DockItem *item) const { -#ifdef USE_AM AppItem *appItem = qobject_cast(item); if (!appItem) return false; return (appItem->mode() == ENTRY_RECENT); -#else - // 先判断当前是否为时尚模式,只有时尚模式下才支持最近打开的应用 - if (m_displayMode != Dock::DisplayMode::Fashion) - return false; - // 只有当应用没有固定到任务栏上才认为它是最新打开的应用 - AppItem *appItem = qobject_cast(item); - return (appItem && !appItem->isDocked()); -#endif } void RecentAppHelper::addAppAreaItem(int index, DockItem *wdg) @@ -265,112 +197,6 @@ void RecentAppHelper::removeAppAreaItem(DockItem *wdg) updateDockAppVisible(lastVisible); } -#ifndef USE_AM -QList RecentAppHelper::dockItemToAppArea() const -{ - QList dockItems; - if (m_displayMode == Dock::DisplayMode::Efficient) { - // 由特效模式变成高效模式,将所有的最近打开的应用移动到左侧的应用区域 - for (int i = 0; i < m_recentWidget->layout()->count(); i++) { - DockItem *appItem = qobject_cast(m_recentWidget->layout()->itemAt(i)->widget()); - if (!appItem) - continue; - - dockItems << appItem; - } - } else { - // 如果是特效模式下,则查找所有已驻留的应用,将其移动到应用区域 - for (int i = 0; i < m_recentWidget->layout()->count(); i++) { - DockItem *appItem = qobject_cast(m_recentWidget->layout()->itemAt(i)->widget()); - if (!appItem || appInRecent(appItem)) - continue; - - dockItems << appItem; - } - } - - return dockItems; -} - -void RecentAppHelper::resetDockItems() -{ - // 先将所有的最近打开的区域移动到应用区域 - QList recentAppItems = dockItemToAppArea(); - - // 从最近使用应用中移除 - for (DockItem *appItem : recentAppItems) - m_recentWidget->layout()->removeWidget(appItem); - - // 将这些图标添加到应用区域 - QBoxLayout *boxLayout = static_cast(m_appWidget->layout()); - for (DockItem *appItem : recentAppItems) { - int index = getDockItemIndex(appItem, false); - if (index >= 0) - boxLayout->insertWidget(index, appItem); - else - boxLayout->addWidget(appItem); - } - - if (m_displayMode == Dock::DisplayMode::Fashion) { - // 由高效模式变成特效模式后,将左侧未驻留的应用移动到右侧的最近打开应用中 - QList unDockItems; - for (int i = 0; i < m_appWidget->layout()->count() ; i++) { - DockItem *appItem = qobject_cast(m_appWidget->layout()->itemAt(i)->widget()); - if (!appInRecent(appItem)) - continue; - - unDockItems << appItem; - } - - // 从应用区域中删除未驻留的应用 - for (DockItem *appItem : unDockItems) - m_appWidget->layout()->removeWidget(appItem); - - // 将这些图标添加到最近打开区域 - QBoxLayout *recentLayout = static_cast(m_recentWidget->layout()); - for (DockItem *appItem : unDockItems) { - int index = getDockItemIndex(appItem, true); - if (index >= 0) - recentLayout->insertWidget(index, appItem); - else - recentLayout->addWidget(appItem); - } - } -} - -int RecentAppHelper::getDockItemIndex(DockItem *dockItem, bool isRecent) const -{ - // 当从最近区域移动到应用区域的时候,重新计算插入索引值 - if (!m_sequentDockItems.contains(dockItem)) - return -1; - - QList sequeDockItems = m_sequentDockItems; - if (isRecent) { - // 如果是最近打开区域,需要按照时间从小到大排列(先打开的排在前面) - std::sort(sequeDockItems.begin(), sequeDockItems.end(), [](DockItem *item1, DockItem *item2) { - AppItem *appItem1 = qobject_cast(item1); - AppItem *appItem2 = qobject_cast(item2); - if (!appItem1 || !appItem2) - return false; - - return appItem1->appOpenMSecs() < appItem2->appOpenMSecs(); - }); - } - - int index = sequeDockItems.indexOf(dockItem); - // 查找所有在应用区域的图标 - QList dockApps = appItems(isRecent ? m_recentWidget : m_appWidget); - for (int i = index + 1; i < sequeDockItems.size(); i++) { - DockItem *item = sequeDockItems[i]; - int itemIndex = dockApps.indexOf(static_cast(item)); - if (itemIndex >= 0) - return itemIndex; - } - - return -1; -} -#endif - int RecentAppHelper::getEntryIndex(DockItem *dockItem, QWidget *widget) const { AppItem *appItem = qobject_cast(dockItem); diff --git a/frame/controller/recentapphelper.h b/frame/controller/recentapphelper.h index 5b69c51af..d67c038b6 100644 --- a/frame/controller/recentapphelper.h +++ b/frame/controller/recentapphelper.h @@ -66,27 +66,16 @@ private: void removeRecentAreaItem(DockItem *wdg); void removeAppAreaItem(DockItem *wdg); -#ifndef USE_AM - QList dockItemToAppArea() const; - void resetDockItems(); - int getDockItemIndex(DockItem *dockItem, bool isRecent) const; -#endif int getEntryIndex(DockItem *dockItem, QWidget *widget) const; QList appItems(QWidget *widget) const; private Q_SLOTS: -#ifdef USE_AM void onModeChanged(int mode); -#else - void onItemChanged(); -#endif + private: QWidget *m_appWidget; QWidget *m_recentWidget; -#ifndef USE_AM - QList m_sequentDockItems; -#endif Dock::DisplayMode m_displayMode; DockInter *m_dockInter; }; diff --git a/frame/dbus/dbusclientmanager.cpp b/frame/dbus/dbusclientmanager.cpp deleted file mode 100644 index ead7b6905..000000000 --- a/frame/dbus/dbusclientmanager.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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("com.deepin.daemon.Dock", "/dde/dock/ClientManager", staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusClientManager::~DBusClientManager() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/frame/dbus/dbusclientmanager.h b/frame/dbus/dbusclientmanager.h deleted file mode 100644 index 4ccf9b2a0..000000000 --- a/frame/dbus/dbusclientmanager.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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_1465195317 -#define DBUSCLIENTMANAGER_H_1465195317 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface dde.dock.ClientManager - */ -class DBusClientManager: 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.ClientManager") - 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 "dde.dock.ClientManager"; } - -public: - explicit DBusClientManager(QObject *parent = 0); - - ~DBusClientManager(); - -public Q_SLOTS: // METHODS - inline QDBusPendingReply ActivateWindow(uint in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("ActivateWindow"), 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); - } - -Q_SIGNALS: // SIGNALS - void ActiveWindowChanged(uint activeWinId); -// begin property changed signals -}; - -namespace dde { - namespace dock { - typedef ::DBusClientManager ClientManager; - } -} -#endif diff --git a/frame/dbus/dbusdisplay.cpp b/frame/dbus/dbusdisplay.cpp index 4ab7f5aa4..9cb7adf5d 100644 --- a/frame/dbus/dbusdisplay.cpp +++ b/frame/dbus/dbusdisplay.cpp @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p DBusDisplay -c DBusDisplay com.deepin.daemon.Display.xml + * Command line was: qdbusxml2cpp -p DBusDisplay -c DBusDisplay org.deepin.dde.Display1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * diff --git a/frame/dbus/dbusdisplay.h b/frame/dbus/dbusdisplay.h index ced30d75d..e99cdabab 100644 --- a/frame/dbus/dbusdisplay.h +++ b/frame/dbus/dbusdisplay.h @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -p DBusDisplay -c DBusDisplay com.deepin.daemon.Display.xml + * Command line was: qdbusxml2cpp -p DBusDisplay -c DBusDisplay org.deepin.dde.Display1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -44,7 +44,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, DisplayRect &rect QDebug operator<<(QDebug deg, const DisplayRect &rect); /* - * Proxy class for interface com.deepin.daemon.Display + * Proxy class for interface org.deepin.dde.Display1 */ class DBusDisplay: public QDBusAbstractInterface { @@ -56,7 +56,7 @@ class DBusDisplay: public QDBusAbstractInterface if (3 != arguments.count()) return; QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName !="com.deepin.daemon.Display") + if (interfaceName !="org.deepin.dde.Display1") return; QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); QStringList keys = changedProps.keys(); @@ -72,11 +72,11 @@ class DBusDisplay: public QDBusAbstractInterface } public: static inline const char *staticInterfaceName() - { return "com.deepin.daemon.Display"; } + { return "org.deepin.dde.Display1"; } static inline const char *staticServiceName() - { return "com.deepin.daemon.Display"; } + { return "org.deepin.dde.Display1"; } static inline const char *staticObjectPath() - { return "/com/deepin/daemon/Display"; } + { return "/org/deepin/dde/Display1"; } public: explicit DBusDisplay(QObject *parent = 0); diff --git a/frame/dbus/dbusdockadaptors.h b/frame/dbus/dbusdockadaptors.h index 57527b455..18f060e39 100644 --- a/frame/dbus/dbusdockadaptors.h +++ b/frame/dbus/dbusdockadaptors.h @@ -28,7 +28,7 @@ #include /* - * Adaptor class for interface com.deepin.dde.Dock + * Adaptor class for interface org.deepin.dde.Dock1 */ class QGSettings; class WindowManager; @@ -60,9 +60,9 @@ void registerPluginInfoMetaType(); class DBusDockAdaptors: public QDBusAbstractAdaptor { Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.Dock") + Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Dock1") Q_CLASSINFO("D-Bus Introspection", "" - " \n" + " \n" " \n" " \n" " " diff --git a/frame/dbus/dockinterface.cpp b/frame/dbus/dockinterface.cpp index 8a5ab875f..05f16acd4 100644 --- a/frame/dbus/dockinterface.cpp +++ b/frame/dbus/dockinterface.cpp @@ -21,9 +21,8 @@ #include "dockinterface.h" -#include "com_deepin_dde_daemon_dock.h" +#include "org_deepin_dde_daemon_dock1.h" -#ifdef USE_AM // 因为 types/dockrect.h 文件中定义了DockRect类,而在此处也定义了DockRect, // 所以在此处先加上DOCKRECT_H宏(types/dockrect.h文件中定义的宏)来禁止包含types/dockrect.h头文件 // 否则会出现重复定义的错误 @@ -61,7 +60,7 @@ public: // 窗管中提供的ActiveWindow接口,MinimizeWindow目前还在开发过程中,因此,关于这两个接口暂时使用v23的后端接口 // 等窗管完成了这几个接口后,删除此处v20的接口,改成v23提供的新接口即可 -using DockInter = com::deepin::dde::daemon::Dock; +using DockInter = org::deepin::dde::daemon::Dock1; /** * @brief 任务栏的部分DBUS接口是通过窗管获取的,由于AM后端并未提供窗管的相关接口,因此, * 此处先将窗管的接口集成进来,作为私有类,只提供任务栏接口使用 @@ -106,7 +105,7 @@ private: WM::WM(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) - , m_dockInter(new DockInter("com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this)) + , m_dockInter(new DockInter("org.deepin.dde.daemon.Dock1", "/org/deepin/dde/daemon/Dock1", QDBusConnection::sessionBus(), this)) { } @@ -337,6 +336,4 @@ void Dde_Dock::onPendingCallFinished(QDBusPendingCallWatcher *w) const auto args = d_ptr->m_waittingCalls.take(callName); CallQueued(callName, args); -} - -#endif +} \ No newline at end of file diff --git a/frame/dbus/dockinterface.h b/frame/dbus/dockinterface.h index 21cc0a4fc..44530470a 100644 --- a/frame/dbus/dockinterface.h +++ b/frame/dbus/dockinterface.h @@ -22,8 +22,6 @@ #ifndef DOCK_INTERFACE #define DOCK_INTERFACE -#ifdef USE_AM - #include "types/dockrect.h" #include @@ -36,7 +34,7 @@ #include /* - * Proxy class for interface com.deepin.dde.daemon.Dock + * Proxy class for interface org.deepin.dde.daemon.Dock1 */ class DockPrivate; class WM; @@ -336,6 +334,5 @@ namespace org { } } -#endif // USE_AM #endif // DOCK_INTERFACE diff --git a/frame/dbus/entryinterface.cpp b/frame/dbus/entryinterface.cpp index dd292f4f5..3d7e1e276 100644 --- a/frame/dbus/entryinterface.cpp +++ b/frame/dbus/entryinterface.cpp @@ -24,9 +24,6 @@ /* * Implementation of interface class __Entry */ - -#ifdef USE_AM - void registerWindowListMetaType() { qRegisterMetaType(); @@ -296,5 +293,3 @@ void Dock_Entry::onPendingCallFinished(QDBusPendingCallWatcher *w) const auto args = d_ptr->m_waittingCalls.take(callName); CallQueued(callName, args); } - -#endif diff --git a/frame/dbus/entryinterface.h b/frame/dbus/entryinterface.h index 08f81640c..2c8513bf5 100644 --- a/frame/dbus/entryinterface.h +++ b/frame/dbus/entryinterface.h @@ -22,8 +22,6 @@ #ifndef DOCK_ENTRY_H #define DOCK_ENTRY_H -#ifdef USE_AM - #define WINDOWLIST_H #define WINDOWINFOLIST_H @@ -65,7 +63,7 @@ void registerWindowInfoMetaType(); void registerWindowInfoMapMetaType(); /* - * Proxy class for interface com.deepin.dde.daemon.Dock.Entry + * Proxy class for interface org.deepin.dde.daemon.Dock1.Entry */ class EntryPrivate; @@ -281,6 +279,4 @@ namespace org { } } -#endif // USE_AM - #endif // DOCK_ENTRY_H diff --git a/frame/dbus/com.deepin.dde.daemon.Dock.xml b/frame/dbus/org.deepin.dde.daemon.Dock1.xml similarity index 96% rename from frame/dbus/com.deepin.dde.daemon.Dock.xml rename to frame/dbus/org.deepin.dde.daemon.Dock1.xml index dc10e442b..4b81b9dea 100644 --- a/frame/dbus/com.deepin.dde.daemon.Dock.xml +++ b/frame/dbus/org.deepin.dde.daemon.Dock1.xml @@ -1,4 +1,4 @@ - + diff --git a/frame/dbusinterface/xml/org.deepin.daemon.Audio.Sink.xml b/frame/dbusinterface/xml/org.deepin.dde.Audio1.Sink.xml similarity index 96% rename from frame/dbusinterface/xml/org.deepin.daemon.Audio.Sink.xml rename to frame/dbusinterface/xml/org.deepin.dde.Audio1.Sink.xml index 347056803..72f6f68b0 100644 --- a/frame/dbusinterface/xml/org.deepin.daemon.Audio.Sink.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.Audio1.Sink.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/sound/dbusinterface/xml/org.deepin.daemon.Audio.xml b/frame/dbusinterface/xml/org.deepin.dde.Audio1.xml similarity index 97% rename from plugins/sound/dbusinterface/xml/org.deepin.daemon.Audio.xml rename to frame/dbusinterface/xml/org.deepin.dde.Audio1.xml index 056518152..7fbe4885f 100644 --- a/plugins/sound/dbusinterface/xml/org.deepin.daemon.Audio.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.Audio1.xml @@ -1,4 +1,4 @@ - + diff --git a/frame/dbusinterface/xml/org.deepin.daemon.Display.xml b/frame/dbusinterface/xml/org.deepin.dde.Display1.xml similarity index 98% rename from frame/dbusinterface/xml/org.deepin.daemon.Display.xml rename to frame/dbusinterface/xml/org.deepin.dde.Display1.xml index 7862b7175..c6e6235b8 100644 --- a/frame/dbusinterface/xml/org.deepin.daemon.Display.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.Display1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/tray/dbusinterface/xml/org.deepin.daemon.Gesture.xml b/frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml similarity index 95% rename from plugins/tray/dbusinterface/xml/org.deepin.daemon.Gesture.xml rename to frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml index e28032954..de90b4a78 100644 --- a/plugins/tray/dbusinterface/xml/org.deepin.daemon.Gesture.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.Gesture1.xml @@ -1,4 +1,4 @@ - + diff --git a/frame/dbusinterface/xml/org.deepin.dde.Launcher.xml b/frame/dbusinterface/xml/org.deepin.dde.Launcher1.xml similarity index 100% rename from frame/dbusinterface/xml/org.deepin.dde.Launcher.xml rename to frame/dbusinterface/xml/org.deepin.dde.Launcher1.xml diff --git a/plugins/datetime/dbusinterface/xml/org.deepin.daemon.Timedate.xml b/frame/dbusinterface/xml/org.deepin.dde.Timedate1.xml similarity index 98% rename from plugins/datetime/dbusinterface/xml/org.deepin.daemon.Timedate.xml rename to frame/dbusinterface/xml/org.deepin.dde.Timedate1.xml index 935a74c77..f3a46e3bf 100644 --- a/plugins/datetime/dbusinterface/xml/org.deepin.daemon.Timedate.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.Timedate1.xml @@ -1,4 +1,4 @@ - + diff --git a/frame/dbusinterface/xml/org.deepin.api.XEventMonitor.xml b/frame/dbusinterface/xml/org.deepin.dde.XEventMonitor1.xml similarity index 96% rename from frame/dbusinterface/xml/org.deepin.api.XEventMonitor.xml rename to frame/dbusinterface/xml/org.deepin.dde.XEventMonitor1.xml index f19d6af06..633c6c1d6 100644 --- a/frame/dbusinterface/xml/org.deepin.api.XEventMonitor.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.XEventMonitor1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/tray/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml b/frame/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml similarity index 98% rename from plugins/tray/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml rename to frame/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml index ce2cec070..e41888c48 100644 --- a/plugins/tray/dbusinterface/xml/com.deepin.dde.daemon.Dock.xml +++ b/frame/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml @@ -1,4 +1,4 @@ - + diff --git a/frame/display/displaymanager.h b/frame/display/displaymanager.h index 009394adf..a09c007f8 100644 --- a/frame/display/displaymanager.h +++ b/frame/display/displaymanager.h @@ -26,9 +26,9 @@ #include "singleton.h" #include "constants.h" -#include "org_deepin_daemon_display.h" +#include "org_deepin_dde_display1.h" -using DisplayInter = com::deepin::daemon::Display; +using DisplayInter = org::deepin::dde::Display1; using namespace Dock; class QScreen; diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index d6ca1547b..187209e16 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -97,11 +97,7 @@ AppItem::AppItem(DockInter *dockInter, const QGSettings *appSettings, const QGSe connect(m_itemEntryInter, &DockEntryInter::IsActiveChanged, this, static_cast(&AppItem::update)); connect(m_itemEntryInter, &DockEntryInter::WindowInfosChanged, this, &AppItem::updateWindowInfos, Qt::QueuedConnection); connect(m_itemEntryInter, &DockEntryInter::IconChanged, this, &AppItem::refreshIcon); -#ifdef USE_AM connect(m_itemEntryInter, &DockEntryInter::ModeChanged, this, &AppItem::modeChanged); -#else - connect(m_itemEntryInter, &DockEntryInter::IsDockedChanged, this, &AppItem::isDockChanged); -#endif connect(m_updateIconGeometryTimer, &QTimer::timeout, this, &AppItem::updateWindowIconGeometries, Qt::QueuedConnection); connect(m_retryObtainIconTimer, &QTimer::timeout, this, &AppItem::refreshIcon, Qt::QueuedConnection); @@ -216,13 +212,11 @@ bool AppItem::splitWindowOnScreen(ScreenSpliter::SplitDirection direction) return m_screenSpliter->split(direction); } -#ifdef USE_AM int AppItem::mode() const { return m_itemEntryInter->mode(); } -#endif DockEntryInter *AppItem::itemEntryInter() const { @@ -296,9 +290,7 @@ void AppItem::paintEvent(QPaintEvent *e) path.addRoundedRect(backgroundRect, 8, 8); // 在没有开启窗口多开的情况下,显示背景色 -#ifdef USE_AM if (!m_dockInter->showMultiWindow()) { -#endif if (m_active) { QColor color = Qt::black; color.setAlpha(255 * 0.8); @@ -312,9 +304,7 @@ void AppItem::paintEvent(QPaintEvent *e) painter.fillPath(path, color); } } -#ifdef USE_AM } -#endif } else { if (!m_windowInfos.isEmpty()) { QPoint p; @@ -407,21 +397,17 @@ void AppItem::mouseReleaseEvent(QMouseEvent *e) qDebug() << "app item clicked, name:" << m_itemEntryInter->name() << "id:" << m_itemEntryInter->id() << "my-id:" << m_id << "icon:" << m_itemEntryInter->icon(); -#ifdef USE_AM if (m_dockInter->showMultiWindow()) { // 如果开启了多窗口显示,则直接新建一个窗口 m_itemEntryInter->NewInstance(QX11Info::getTimestamp()); } else { -#endif // 如果没有开启新窗口显示,则 m_itemEntryInter->Activate(QX11Info::getTimestamp()); // play launch effect if (m_windowInfos.isEmpty() && DGuiApplicationHelper::isSpecialEffectsEnvironment()) playSwingEffect(); } -#ifdef USE_AM } -#endif } void AppItem::mousePressEvent(QMouseEvent *e) diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 6495718b6..118f505ba 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -26,7 +26,6 @@ #include "dockitem.h" #include "previewcontainer.h" #include "appdrag.h" -#include "dbusclientmanager.h" #include "../widgets/tipswidget.h" #include "dbusutil.h" @@ -59,9 +58,7 @@ public: void startSplit(const QRect &rect); bool supportSplitWindow(); bool splitWindowOnScreen(ScreenSpliter::SplitDirection direction); -#ifdef USE_AM int mode() const; -#endif DockEntryInter *itemEntryInter() const; inline ItemType itemType() const override { return App; } QPixmap appIcon(){ return m_appIcon; } @@ -80,11 +77,7 @@ signals: void requestUpdateEntryGeometries() const; void windowCountChanged() const; -#ifdef USE_AM void modeChanged(int) const; -#else - void isDockChanged(bool) const; -#endif private: void moveEvent(QMoveEvent *e) override; diff --git a/frame/item/appmultiitem.cpp b/frame/item/appmultiitem.cpp index cabb94260..877ea11a6 100644 --- a/frame/item/appmultiitem.cpp +++ b/frame/item/appmultiitem.cpp @@ -90,9 +90,7 @@ void AppMultiItem::initConnection() void AppMultiItem::onOpen() { -#ifdef USE_AM m_entryInter->ActiveWindow(m_winId); -#endif } void AppMultiItem::onCurrentWindowChanged(uint32_t value) @@ -152,9 +150,7 @@ void AppMultiItem::paintEvent(QPaintEvent *) void AppMultiItem::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { -#ifdef USE_AM m_entryInter->ActiveWindow(m_winId); -#endif } else { QPoint currentPoint = QCursor::pos(); m_menu->exec(currentPoint); diff --git a/frame/item/components/appdragwidget.cpp b/frame/item/components/appdragwidget.cpp index 7f1cff367..6c185c5ed 100644 --- a/frame/item/components/appdragwidget.cpp +++ b/frame/item/components/appdragwidget.cpp @@ -24,13 +24,13 @@ #include "utils.h" #include "displaymanager.h" -#include "org_deepin_api_xeventmonitor.h" +#include "org_deepin_dde_xeventmonitor1.h" #define SPLIT_NONE 0 #define SPLIT_LEFT 1 #define SPLIT_RIGHT 2 -using XEventMonitor = ::org::deepin::api::XEventMonitor1; +using XEventMonitor = ::org::deepin::dde::XEventMonitor1; AppDragWidget::AppDragWidget(QWidget *parent) : QGraphicsView(parent) diff --git a/frame/main.cpp b/frame/main.cpp index 16bc9890b..def51f55a 100644 --- a/frame/main.cpp +++ b/frame/main.cpp @@ -241,8 +241,8 @@ int main(int argc, char *argv[]) // 注册任务栏的DBus服务 DBusDockAdaptors adaptor(&windowManager); - QDBusConnection::sessionBus().registerService("com.deepin.dde.Dock"); - QDBusConnection::sessionBus().registerObject("/com/deepin/dde/Dock", "com.deepin.dde.Dock", &windowManager); + QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1"); + QDBusConnection::sessionBus().registerObject("/org/deepin/dde/Dock1", "org.deepin.dde.Dock1", &windowManager); // 当任务栏以-r参数启动时,设置CANSHOW未false,之后调用launch不显示任务栏 qApp->setProperty("CANSHOW", !parser.isSet(runOption)); diff --git a/frame/util/dbusutil.h b/frame/util/dbusutil.h index f9c8ff4d3..3738a4194 100644 --- a/frame/util/dbusutil.h +++ b/frame/util/dbusutil.h @@ -21,20 +21,14 @@ #ifndef DBUSUTIL_H #define DBUSUTIL_H -#ifdef USE_AM #include "dockinterface.h" #include "entryinterface.h" -#else -#include -#include -#endif -#ifdef USE_AM using DockInter = org::deepin::dde::daemon::DdeDock; using DockEntryInter = org::deepin::dde::daemon::dock::DockEntry; -const QString xEventMonitorService = "org.deepin.api.XEventMonitor1"; -const QString xEventMonitorPath = "/org/deepin/api/XEventMonitor1"; +const QString xEventMonitorService = "org.deepin.dde.XEventMonitor1"; +const QString xEventMonitorPath = "/org/deepin/dde/XEventMonitor1"; const QString launcherService = "org.deepin.dde.Launcher1"; const QString launcherPath = "/org/deepin/dde/Launcher1"; @@ -44,53 +38,22 @@ const QString controllCenterService = "org.deepin.dde.ControlCenter1"; const QString controllCenterPath = "/org/deepin/dde/ControlCenter1"; const QString controllCenterInterface = "org.deepin.dde.ControlCenter1"; -const QString notificationService = "com.deepin.dde.Notification"; -const QString notificationPath = "/com/deepin/dde/Notification"; -const QString notificationInterface = "com.deepin.dde.Notification"; +const QString notificationService = "org.deepin.dde.Notification1"; +const QString notificationPath = "/org/deepin/dde/Notification1"; +const QString notificationInterface = "org.deepin.dde.Notification1"; -const QString sessionManagerService = "com.deepin.SessionManager"; -const QString sessionManagerPath = "/com/deepin/SessionManager"; -const QString sessionManagerInterface = "com.deepin.SessionManager"; -#else -using DockInter = com::deepin::dde::daemon::Dock; -using DockEntryInter = com::deepin::dde::daemon::dock::Entry; - -const QString xEventMonitorService = "com.deepin.api.XEventMonitor"; -const QString xEventMonitorPath = "/com/deepin/api/XEventMonitor"; - -const QString launcherService = "com.deepin.dde.Launcher"; -const QString launcherPath = "/com/deepin/dde/Launcher"; -const QString launcherInterface = "com.deepin.dde.Launcher"; - -const QString controllCenterService = "com.deepin.dde.ControlCenter"; -const QString controllCenterPath = "/com/deepin/dde/ControlCenter"; -const QString controllCenterInterface = "com.deepin.dde.ControlCenter"; - -const QString notificationService = "com.deepin.dde.Notification"; -const QString notificationPath = "/com/deepin/dde/Notification"; -const QString notificationInterface = "com.deepin.dde.Notification"; - -const QString sessionManagerService = "com.deepin.SessionManager"; -const QString sessionManagerPath = "/com/deepin/SessionManager"; -const QString sessionManagerInterface = "com.deepin.SessionManager"; -#endif +const QString sessionManagerService = "org.deepin.dde.SessionManager1"; +const QString sessionManagerPath = "/org/deepin/dde/SessionManager1"; +const QString sessionManagerInterface = "org.deepin.dde.SessionManager1"; inline const QString dockServiceName() { -#ifdef USE_AM return QString("org.deepin.dde.daemon.Dock1"); -#else - return QString("com.deepin.dde.daemon.Dock"); -#endif } inline const QString dockServicePath() { -#ifdef USE_AM return QString("/org/deepin/dde/daemon/Dock1"); -#else - return QString("/com/deepin/dde/daemon/Dock"); -#endif } #endif // DBUSUTIL_H diff --git a/frame/util/dockpopupwindow.h b/frame/util/dockpopupwindow.h index 81b1af7a1..c96695be4 100644 --- a/frame/util/dockpopupwindow.h +++ b/frame/util/dockpopupwindow.h @@ -22,7 +22,7 @@ #ifndef DOCKPOPUPWINDOW_H #define DOCKPOPUPWINDOW_H -#include "org_deepin_api_xeventmonitor.h" +#include "org_deepin_dde_xeventmonitor1.h" #include #include @@ -31,7 +31,7 @@ DWIDGET_USE_NAMESPACE DGUI_USE_NAMESPACE -using XEventMonitor = ::org::deepin::api::XEventMonitor1; +using XEventMonitor = org::deepin::dde::XEventMonitor1; class DockPopupWindow : public Dtk::Widget::DArrowRectangle { diff --git a/frame/util/menuworker.cpp b/frame/util/menuworker.cpp index a260fabfe..91e18dcd2 100644 --- a/frame/util/menuworker.cpp +++ b/frame/util/menuworker.cpp @@ -155,21 +155,12 @@ void MenuWorker::createMenu(QMenu *settingsMenu) void MenuWorker::onDockSettingsTriggered() { -#ifdef USE_AM DDBusSender().service(controllCenterService) .path(controllCenterPath) .interface(controllCenterInterface) .method("ShowPage") .arg(QString("personalization/desktop/dock")) .call(); -#else - DDBusSender().service(controllCenterService) - .path("controllCenterPath") - .interface(controllCenterInterface) - .method("ShowPage") - .arg(QString("personalization/dock")) - .call(); -#endif } void MenuWorker::exec() diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index 314e63aa1..e24141166 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -113,35 +113,6 @@ void MultiScreenWorker::onAutoHideChanged(const bool autoHide) } } -#ifndef USE_AM -void MultiScreenWorker::handleDbusSignal(QDBusMessage msg) -{ - QList arguments = msg.arguments(); - // 参数固定长度 - if (3 != arguments.count()) - return; - - // 返回的数据中,这一部分对应的是数据发送方的interfacename,可判断是否是自己需要的服务 - QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName != DockInter::staticInterfaceName()) - return; - - QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); - QStringList keys = changedProps.keys(); - foreach (const QString &prop, keys) { - if (prop == "Position") { - onPositionChanged(changedProps.value(prop).toInt()); - } else if (prop == "DisplayMode") { - onDisplayModeChanged(changedProps.value(prop).toInt()); - } else if (prop == "HideMode") { - onHideModeChanged(changedProps.value(prop).toInt()); - } else if (prop == "HideState") { - onHideStateChanged(changedProps.value(prop).toInt()); - } - } -} -#endif - void MultiScreenWorker::onRegionMonitorChanged(int x, int y, const QString &key) { if (m_registerKey != key || testState(MousePress)) @@ -601,18 +572,10 @@ void MultiScreenWorker::initConnection() connect(m_launcherInter, static_cast(&DBusLuncher::VisibleChanged), this, [ = ](bool value) { setStates(LauncherDisplay, value); }); -#ifdef USE_AM connect(m_dockInter, &DockInter::PositionChanged, this, &MultiScreenWorker::onPositionChanged); connect(m_dockInter, &DockInter::DisplayModeChanged, this, &MultiScreenWorker::onDisplayModeChanged); connect(m_dockInter, &DockInter::HideModeChanged, this, &MultiScreenWorker::onHideModeChanged); connect(m_dockInter, &DockInter::HideStateChanged, this, &MultiScreenWorker::onHideStateChanged); -#else - QDBusConnection::sessionBus().connect(dockServiceName(), dockServicePath(), - "org.freedesktop.DBus.Properties", - "PropertiesChanged", - "sa{sv}as", - this, SLOT(handleDbusSignal(QDBusMessage))); -#endif connect(this, &MultiScreenWorker::requestUpdatePosition, this, &MultiScreenWorker::onRequestUpdatePosition); connect(this, &MultiScreenWorker::requestUpdateMonitorInfo, this, &MultiScreenWorker::onRequestUpdateMonitorInfo); @@ -734,7 +697,7 @@ void MultiScreenWorker::resetDockScreen() /** * @brief checkDaemonDockService - * 避免com.deepin.dde.daemon.Dock服务比dock晚启动,导致dock启动后的状态错误 + * org.deepin.dde.daemon.Dock1服务比dock晚启动,导致dock启动后的状态错误 */ void MultiScreenWorker::checkDaemonDockService() { @@ -828,7 +791,7 @@ bool MultiScreenWorker::isCursorOut(int x, int y) /** * @brief checkDaemonXEventMonitorService - * 避免com.deepin.api.XEventMonitor服务比dock晚启动,导致dock启动后的状态错误 + * org.deepin.dde.XEventMonitor1服务比dock晚启动,导致dock启动后的状态错误 */ void MultiScreenWorker::checkXEventMonitorService() { diff --git a/frame/util/multiscreenworker.h b/frame/util/multiscreenworker.h index 2ae61f496..dc5b517ad 100644 --- a/frame/util/multiscreenworker.h +++ b/frame/util/multiscreenworker.h @@ -28,8 +28,8 @@ #include "xcb_misc.h" #include "dbusutil.h" -#include "org_deepin_api_xeventmonitor.h" -#include "org_deepin_dde_launcher.h" +#include "org_deepin_dde_xeventmonitor1.h" +#include "org_deepin_dde_launcher1.h" #include @@ -53,7 +53,7 @@ DGUI_USE_NAMESPACE #define DRAG_AREA_SIZE (5) #define DOCKSPACE (WINDOWMARGIN * 2) -using XEventMonitor = ::org::deepin::api::XEventMonitor1; +using XEventMonitor = ::org::deepin::dde::XEventMonitor1; using DBusLuncher = ::org::deepin::dde::Launcher1; using namespace Dock; @@ -129,10 +129,6 @@ public slots: void onAutoHideChanged(const bool autoHide); void onRequestUpdateRegionMonitor(); -#ifndef USE_AM - void handleDbusSignal(QDBusMessage); -#endif - private slots: // Region Monitor void onRegionMonitorChanged(int x, int y, const QString &key); diff --git a/frame/util/touchsignalmanager.cpp b/frame/util/touchsignalmanager.cpp index 1b8f7328e..f866818f5 100644 --- a/frame/util/touchsignalmanager.cpp +++ b/frame/util/touchsignalmanager.cpp @@ -11,7 +11,7 @@ TouchSignalManager *TouchSignalManager::m_touchManager = nullptr; TouchSignalManager::TouchSignalManager(QObject *parent) : QObject(parent) - , m_gestureInter(new Gesture("com.deepin.daemon.Gesture", "/com/deepin/daemon/Gesture", QDBusConnection::systemBus(), this)) + , m_gestureInter(new Gesture("org.deepin.dde.Gesture1", "/org/deepin/dde/Gesture1", QDBusConnection::systemBus(), this)) , m_dragIconPressed(false) { // 处理后端触屏信号 diff --git a/frame/util/touchsignalmanager.h b/frame/util/touchsignalmanager.h index 3cd09fd7e..188f93e3f 100644 --- a/frame/util/touchsignalmanager.h +++ b/frame/util/touchsignalmanager.h @@ -22,11 +22,11 @@ #ifndef TOUCHSIGNALMANAGER_H #define TOUCHSIGNALMANAGER_H -#include "org_deepin_daemon_gesture.h" +#include "org_deepin_dde_gesture1.h" #include -using Gesture = com::deepin::daemon::Gesture1; +using Gesture = org::deepin::dde::Gesture1; class TouchSignalManager : public QObject { diff --git a/frame/window/components/datetimedisplayer.cpp b/frame/window/components/datetimedisplayer.cpp index aa6f2310b..a4144cd07 100644 --- a/frame/window/components/datetimedisplayer.cpp +++ b/frame/window/components/datetimedisplayer.cpp @@ -44,7 +44,7 @@ static QMap timeFormat{{0, "h:mm"}, {1, "hh:mm"}}; DateTimeDisplayer::DateTimeDisplayer(bool showMultiRow, QWidget *parent) : QWidget (parent) - , m_timedateInter(new Timedate("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", QDBusConnection::sessionBus(), this)) + , m_timedateInter(new Timedate("org.deepin.dde.Timedate1", "/org/deepin/dde/Timedate1", QDBusConnection::sessionBus(), this)) , m_position(Dock::Position::Bottom) , m_dateFont(DFontSizeManager::instance()->t10()) , m_tipsWidget(new Dock::TipsWidget(this)) @@ -156,9 +156,9 @@ void DateTimeDisplayer::mouseReleaseEvent(QMouseEvent *event) { Q_UNUSED(event); - DDBusSender().service("org.deepin.dde.Widgets") + DDBusSender().service("org.deepin.dde.Widgets1") .path("/") - .interface("org.deepin.dde.Widgets") + .interface("org.deepin.dde.Widgets1") .method("Toggle").call(); } diff --git a/frame/window/components/datetimedisplayer.h b/frame/window/components/datetimedisplayer.h index 37fa224f9..d21ea6cdd 100644 --- a/frame/window/components/datetimedisplayer.h +++ b/frame/window/components/datetimedisplayer.h @@ -23,7 +23,7 @@ #include "constants.h" -#include "org_deepin_daemon_timedate.h" +#include "org_deepin_dde_timedate1.h" #include #include @@ -33,7 +33,7 @@ namespace Dock { class TipsWidget; } class DockPopupWindow; class QMenu; -using Timedate = org::deepin::daemon::Timedate1; +using Timedate = org::deepin::dde::Timedate1; class DateTimeDisplayer : public QWidget { diff --git a/frame/window/mainpanelcontrol.cpp b/frame/window/mainpanelcontrol.cpp index 45b7eea9d..4fe441b9b 100755 --- a/frame/window/mainpanelcontrol.cpp +++ b/frame/window/mainpanelcontrol.cpp @@ -319,10 +319,9 @@ void MainPanelControl::dockRecentApp(DockItem *dockItem) return; // 如果控制中心设置不开启最近应用,则不让其驻留 -#ifdef USE_AM if (!m_dockInter->showRecent()) return; -#endif + // 如果控制中心开启了最近应用并且当前应用是未驻留应用,则可以驻留 if (!appItem->isDocked()) appItem->requestDock(); diff --git a/frame/window/tray/dbustraymanager.h b/frame/window/tray/dbustraymanager.h index f47136cb5..bdf313b95 100644 --- a/frame/window/tray/dbustraymanager.h +++ b/frame/window/tray/dbustraymanager.h @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager org.deepin.dde.TrayManager.xml + * Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager org.deepin.dde.TrayManager1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * diff --git a/frame/window/tray/widgets/indicatortrayitem.cpp b/frame/window/tray/widgets/indicatortrayitem.cpp index b37a9a81c..361882edc 100644 --- a/frame/window/tray/widgets/indicatortrayitem.cpp +++ b/frame/window/tray/widgets/indicatortrayitem.cpp @@ -57,8 +57,8 @@ IndicatorTrayItem::IndicatorTrayItem(const QString &indicatorName, QWidget *pare setLayout(layout); // register dbus - auto path = QString("/com/deepin/dde/Dock/Indicator/") + m_indicatorName; - auto interface = QString("com.deepin.dde.Dock.Indicator.") + m_indicatorName; + auto path = QString("/org/deepin/dde/Dock1/Indicator/") + m_indicatorName; + auto interface = QString("org.deepin.dde.Dock1.Indicator.") + m_indicatorName; auto sessionBus = QDBusConnection::sessionBus(); sessionBus.registerObject(path, interface, diff --git a/frame/window/traymanagerwindow.h b/frame/window/traymanagerwindow.h index 7631dc43a..9f49601f2 100644 --- a/frame/window/traymanagerwindow.h +++ b/frame/window/traymanagerwindow.h @@ -24,7 +24,7 @@ #include "constants.h" #include "dbusutil.h" -#include "org_deepin_daemon_timedate.h" +#include "org_deepin_dde_timedate1.h" #include @@ -33,7 +33,7 @@ namespace Dtk { namespace Gui { class DRegionMonitor; }; using namespace Dtk::Widget; -using Timedate = org::deepin::daemon::Timedate1; +using Timedate = org::deepin::dde::Timedate1; class QuickPluginWindow; class QBoxLayout; diff --git a/frame/window/windowmanager.cpp b/frame/window/windowmanager.cpp index 536c3f2ff..7d9b2975d 100644 --- a/frame/window/windowmanager.cpp +++ b/frame/window/windowmanager.cpp @@ -115,7 +115,7 @@ void WindowManager::sendNotifications() QStringList actionButton; actionButton << "reload" << tr("Exit Safe Mode"); QVariantMap hints; - hints["x-deepin-action-reload"] = QString("dbus-send,--session,--dest=com.deepin.dde.Dock,--print-reply,/com/deepin/dde/Dock,com.deepin.dde.Dock.ReloadPlugins"); + hints["x-deepin-action-reload"] = QString("dbus-send,--session,--dest=org.deepin.dde.Dock1,--print-reply,/org/deepin/dde/Dock1,org.deepin.dde.Dock1.ReloadPlugins"); // 在进入安全模式时,执行此DBUS耗时25S左右,导致任务栏显示阻塞,所以使用线程调用 QtConcurrent::run(QThreadPool::globalInstance(), [ = ] { DDBusSender() @@ -655,7 +655,7 @@ void WindowManager::onChangeDockPosition(QString fromScreen, QString toScreen, c void WindowManager::onRequestUpdateFrontendGeometry() { QRect rect = getDockGeometry(true); - // 向com.deepin.dde.daemon.Dock的SetFrontendWindowRect接口设置区域时,此区域的高度或宽度不能为0,否则会导致其HideState属性循环切换,造成任务栏循环显示或隐藏 + // org.deepin.dde.daemon.Dock1的SetFrontendWindowRect接口设置区域时,此区域的高度或宽度不能为0,否则会导致其HideState属性循环切换,造成任务栏循环显示或隐藏 if (rect.width() == 0 || rect.height() == 0) return; diff --git a/interfaces/constants.h b/interfaces/constants.h index 08a8b8b3b..9def9a1e5 100644 --- a/interfaces/constants.h +++ b/interfaces/constants.h @@ -70,11 +70,7 @@ enum DisplayMode { enum HideMode { KeepShowing = 0, KeepHidden = 1, -#ifdef USE_AM - SmartHide = 2, -#else - SmartHide = 3, -#endif + SmartHide = 2 }; #define PROP_POSITION "Position" diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 3d57fffe6..7f830eb24 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,5 +1,4 @@ #add_subdirectory("datetime") -#add_subdirectory("disk-mount") add_subdirectory("shutdown") add_subdirectory("power") add_subdirectory("sound") diff --git a/plugins/airplane-mode/airplanemodeitem.cpp b/plugins/airplane-mode/airplanemodeitem.cpp index 7147307c3..29c3ca882 100644 --- a/plugins/airplane-mode/airplanemodeitem.cpp +++ b/plugins/airplane-mode/airplanemodeitem.cpp @@ -43,8 +43,8 @@ AirplaneModeItem::AirplaneModeItem(QWidget *parent) : QWidget(parent) , m_tipsLabel(new Dock::TipsWidget(this)) , m_applet(new AirplaneModeApplet(this)) - , m_airplaneModeInter(new DBusAirplaneMode("org.deepin.daemon.AirplaneMode1", - "/org/deepin/daemon/AirplaneMode1", + , m_airplaneModeInter(new DBusAirplaneMode("org.deepin.dde.AirplaneMode1", + "/org/deepin/dde/AirplaneMode1", QDBusConnection::systemBus(), this)) { @@ -113,7 +113,6 @@ void AirplaneModeItem::invokeMenuItem(const QString menuId, const bool checked) if (menuId == SHIFT) m_airplaneModeInter->Enable(!m_airplaneModeInter->enabled()); else if (menuId == SETTINGS) -#ifdef USE_AM DDBusSender() .service("org.deepin.dde.ControlCenter1") .interface("org.deepin.dde.ControlCenter1") @@ -122,16 +121,6 @@ void AirplaneModeItem::invokeMenuItem(const QString menuId, const bool checked) .arg(QString("network")) .arg(QString("Airplane Mode")) .call(); -#else - DDBusSender() - .service("com.deepin.dde.ControlCenter") - .interface("com.deepin.dde.ControlCenter") - .path("/com/deepin/dde/ControlCenter") - .method(QString("ShowPage")) - .arg(QString("network")) - .arg(QString("Airplane Mode")) - .call(); -#endif */ } diff --git a/plugins/airplane-mode/airplanemodeitem.h b/plugins/airplane-mode/airplanemodeitem.h index 8517d475d..6987aed0b 100644 --- a/plugins/airplane-mode/airplanemodeitem.h +++ b/plugins/airplane-mode/airplanemodeitem.h @@ -23,11 +23,11 @@ #ifndef AIRPLANEMODEITEM_H #define AIRPLANEMODEITEM_H -#include "org_deepin_daemon_airplanemode.h" +#include "org_deepin_dde_airplanemode1.h" #include -using DBusAirplaneMode = org::deepin::daemon::AirplaneMode1; +using DBusAirplaneMode = org::deepin::dde::AirplaneMode1; namespace Dock { class TipsWidget; diff --git a/plugins/airplane-mode/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml b/plugins/airplane-mode/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml similarity index 91% rename from plugins/airplane-mode/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml rename to plugins/airplane-mode/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml index b558d3014..31a4284b4 100644 --- a/plugins/airplane-mode/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml +++ b/plugins/airplane-mode/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/bluetooth/bluetooth.json b/plugins/bluetooth/bluetooth.json index 8400bab79..eb60829b1 100644 --- a/plugins/bluetooth/bluetooth.json +++ b/plugins/bluetooth/bluetooth.json @@ -1,4 +1,4 @@ { "api": "2.0.0", - "depends-daemon-dbus-service": "org.deepin.daemon.Bluetooth1" + "depends-daemon-dbus-service": "org.deepin.dde.Bluetooth1" } diff --git a/plugins/bluetooth/bluetoothitem.cpp b/plugins/bluetooth/bluetoothitem.cpp index daf706d0f..d025eb19b 100644 --- a/plugins/bluetooth/bluetoothitem.cpp +++ b/plugins/bluetooth/bluetoothitem.cpp @@ -119,7 +119,6 @@ void BluetoothItem::invokeMenuItem(const QString menuId, const bool checked) if (menuId == SHIFT) { m_applet->setAdapterPowered(!m_adapterPowered); } else if (menuId == SETTINGS) { -#ifdef USE_AM DDBusSender() .service("org.deepin.dde.ControlCenter1") .interface("org.deepin.dde.ControlCenter1") @@ -127,15 +126,6 @@ void BluetoothItem::invokeMenuItem(const QString menuId, const bool checked) .method(QString("ShowPage")) .arg(QString("bluetooth")) .call(); -#else - DDBusSender() - .service("com.deepin.dde.ControlCenter") - .interface("com.deepin.dde.ControlCenter") - .path("/com/deepin/dde/ControlCenter") - .method(QString("ShowPage")) - .arg(QString("bluetooth")) - .call(); -#endif } } diff --git a/plugins/bluetooth/componments/adaptersmanager.cpp b/plugins/bluetooth/componments/adaptersmanager.cpp index 3307e1165..3c4c266f5 100644 --- a/plugins/bluetooth/componments/adaptersmanager.cpp +++ b/plugins/bluetooth/componments/adaptersmanager.cpp @@ -31,8 +31,8 @@ AdaptersManager::AdaptersManager(QObject *parent) : QObject(parent) - , m_bluetoothInter(new DBusBluetooth("org.deepin.daemon.Bluetooth1", - "/org/deepin/daemon/Bluetooth1", + , m_bluetoothInter(new DBusBluetooth("org.deepin.dde.Bluetooth1", + "/org/deepin/dde/Bluetooth1", QDBusConnection::sessionBus(), this)) { @@ -65,9 +65,9 @@ AdaptersManager::AdaptersManager(QObject *parent) }); #endif - QDBusInterface inter("org.deepin.daemon.Bluetooth1", - "/org/deepin/daemon/Bluetooth1", - "org.deepin.daemon.Bluetooth1", + QDBusInterface inter("org.deepin.dde.Bluetooth1", + "/org/deepin/dde/Bluetooth1", + "org.deepin.dde.Bluetooth1", QDBusConnection::sessionBus()); QDBusReply reply = inter.call(QDBus::Block, "GetAdapters"); const QString replyStr = reply.value(); diff --git a/plugins/bluetooth/componments/adaptersmanager.h b/plugins/bluetooth/componments/adaptersmanager.h index 598cb53e5..223d9d684 100644 --- a/plugins/bluetooth/componments/adaptersmanager.h +++ b/plugins/bluetooth/componments/adaptersmanager.h @@ -23,8 +23,8 @@ #ifndef ADAPTERSMANAGER_H #define ADAPTERSMANAGER_H -#include "org_deepin_daemon_bluetooth.h" -using DBusBluetooth = org::deepin::daemon::Bluetooth1; +#include "org_deepin_dde_bluetooth1.h" +using DBusBluetooth = org::deepin::dde::Bluetooth1; class Adapter; class Device; diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index 77f563160..697d5c21e 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -150,7 +150,7 @@ BluetoothAdapterItem::BluetoothAdapterItem(Adapter *adapter, QWidget *parent) , m_itemDelegate(new DStyledItemDelegate(m_deviceListview)) , m_deviceModel(new QStandardItemModel(m_deviceListview)) , m_refreshBtn(new RefreshButton(this)) - , m_bluetoothInter(new DBusBluetooth("org.deepin.daemon.Bluetooth1", "/org/deepin/daemon/Bluetooth1", QDBusConnection::sessionBus(), this)) + , m_bluetoothInter(new DBusBluetooth("org.deepin.dde.Bluetooth1", "/org/deepin/dde/Bluetooth1", QDBusConnection::sessionBus(), this)) , m_showUnnamedDevices(false) , m_seperator(new HorizontalSeperator(this)) { diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.h b/plugins/bluetooth/componments/bluetoothadapteritem.h index b26408a5b..489c63ea4 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.h +++ b/plugins/bluetooth/componments/bluetoothadapteritem.h @@ -32,9 +32,9 @@ #include #include -#include "org_deepin_daemon_bluetooth.h" +#include "org_deepin_dde_bluetooth1.h" -using DBusBluetooth = org::deepin::daemon::Bluetooth1; +using DBusBluetooth = org::deepin::dde::Bluetooth1; DWIDGET_USE_NAMESPACE diff --git a/plugins/bluetooth/componments/bluetoothapplet.cpp b/plugins/bluetooth/componments/bluetoothapplet.cpp index bd5077f8f..550721711 100644 --- a/plugins/bluetooth/componments/bluetoothapplet.cpp +++ b/plugins/bluetooth/componments/bluetoothapplet.cpp @@ -121,7 +121,7 @@ BluetoothApplet::BluetoothApplet(AdaptersManager *adapterManager, QWidget *paren , m_mainLayout(new QVBoxLayout(this)) , m_contentLayout(new QVBoxLayout(m_contentWidget)) , m_seperator(new HorizontalSeperator(this)) - , m_airPlaneModeInter(new DBusAirplaneMode("org.deepin.daemon.AirplaneMode1", "/org/deepin/daemon/AirplaneMode1", QDBusConnection::systemBus(), this)) + , m_airPlaneModeInter(new DBusAirplaneMode("org.deepin.dde.AirplaneMode1", "/org/deepin/dde/AirplaneMode1", QDBusConnection::systemBus(), this)) , m_airplaneModeEnable(false) { initUi(); @@ -283,7 +283,6 @@ void BluetoothApplet::initConnect() connect(m_adaptersManager, &AdaptersManager::adapterIncreased, this, &BluetoothApplet::onAdapterAdded); connect(m_adaptersManager, &AdaptersManager::adapterDecreased, this, &BluetoothApplet::onAdapterRemoved); connect(m_settingLabel, &SettingLabel::clicked, this, [ = ] { -#ifdef USE_AM DDBusSender() .service("org.deepin.dde.ControlCenter1") .interface("org.deepin.dde.ControlCenter1") @@ -291,15 +290,6 @@ void BluetoothApplet::initConnect() .method(QString("ShowPage")) .arg(QString("bluetooth")) .call(); -#else - DDBusSender() - .service("com.deepin.dde.ControlCenter") - .interface("com.deepin.dde.ControlCenter") - .path("/com/deepin/dde/ControlCenter") - .method(QString("ShowPage")) - .arg(QString("bluetooth")) - .call(); -#endif }); connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, this, &BluetoothApplet::updateIconTheme); connect(m_airPlaneModeInter, &DBusAirplaneMode::EnabledChanged, this, &BluetoothApplet::setAirplaneModeEnabled); diff --git a/plugins/bluetooth/componments/bluetoothapplet.h b/plugins/bluetooth/componments/bluetoothapplet.h index ccf8f9c8d..2eada4c6f 100644 --- a/plugins/bluetooth/componments/bluetoothapplet.h +++ b/plugins/bluetooth/componments/bluetoothapplet.h @@ -29,7 +29,7 @@ #include -#include "org_deepin_daemon_airplanemode.h" +#include "org_deepin_dde_airplanemode1.h" class QVBoxLayout; class QHBoxLayout; @@ -48,7 +48,7 @@ DWIDGET_END_NAMESPACE DWIDGET_USE_NAMESPACE -using DBusAirplaneMode = org::deepin::daemon::AirplaneMode1; +using DBusAirplaneMode = org::deepin::dde::AirplaneMode1; class SettingLabel : public QWidget { diff --git a/plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml b/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml similarity index 91% rename from plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml rename to plugins/bluetooth/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml index b558d3014..31a4284b4 100644 --- a/plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.AirplaneMode.xml +++ b/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.AirplaneMode1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.Bluetooth.xml b/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.Bluetooth1.xml similarity index 99% rename from plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.Bluetooth.xml rename to plugins/bluetooth/dbusinterface/xml/org.deepin.dde.Bluetooth1.xml index 289f981c5..2060c2fa1 100644 --- a/plugins/bluetooth/dbusinterface/xml/org.deepin.daemon.Bluetooth.xml +++ b/plugins/bluetooth/dbusinterface/xml/org.deepin.dde.Bluetooth1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/datetime/datetime.json b/plugins/datetime/datetime.json index 783887388..b69248a3b 100644 --- a/plugins/datetime/datetime.json +++ b/plugins/datetime/datetime.json @@ -1,4 +1,4 @@ { "api": "2.0.0", - "depends-daemon-dbus-service": "org.deepin.daemon.Timedate1" + "depends-daemon-dbus-service": "org.deepin.dde.Timedate1" } diff --git a/plugins/datetime/datetimeplugin.cpp b/plugins/datetime/datetimeplugin.cpp index 99716be84..de63bdf82 100644 --- a/plugins/datetime/datetimeplugin.cpp +++ b/plugins/datetime/datetimeplugin.cpp @@ -42,7 +42,7 @@ DatetimePlugin::DatetimePlugin(QObject *parent) , m_pluginLoaded(false) { QDBusConnection sessionBus = QDBusConnection::sessionBus(); - sessionBus.connect("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(propertiesChanged())); + sessionBus.connect("org.deepin.dde.Timedate1", "/org/deepin/dde/Timedate1", "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(propertiesChanged())); } PluginsItemInterface::PluginSizePolicy DatetimePlugin::pluginSizePolicy() const @@ -149,7 +149,7 @@ const QString DatetimePlugin::itemCommand(const QString &itemKey) { Q_UNUSED(itemKey); - return "dbus-send --print-reply --dest=org.deepin.dde.Widgets / org.deepin.dde.Widgets.Toggle"; + return "dbus-send --print-reply --dest=org.deepin.dde.Widgets1 /org/deepin/dde/Widgets1 org.deepin.dde.Widgets1.Toggle"; } const QString DatetimePlugin::itemContextMenu(const QString &itemKey) @@ -190,7 +190,6 @@ void DatetimePlugin::invokedMenuItem(const QString &itemKey, const QString &menu Q_UNUSED(checked) if (menuId == "open") { -#ifdef USE_AM DDBusSender() .service("org.deepin.dde.ControlCenter1") .interface("org.deepin.dde.ControlCenter1") @@ -198,15 +197,6 @@ void DatetimePlugin::invokedMenuItem(const QString &itemKey, const QString &menu .method(QString("ShowPage")) .arg(QString("datetime")) .call(); -#else - DDBusSender() - .service("com.deepin.dde.ControlCenter") - .interface("com.deepin.dde.ControlCenter") - .path("/com/deepin/dde/ControlCenter") - .method(QString("ShowPage")) - .arg(QString("datetime")) - .call(); -#endif } else { const bool value = timedateInterface()->property(TIME_FORMAT_KEY).toBool(); timedateInterface()->setProperty(TIME_FORMAT_KEY, !value); @@ -268,11 +258,11 @@ void DatetimePlugin::propertiesChanged() QDBusInterface* DatetimePlugin::timedateInterface() { if (!m_interface) { - if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.deepin.daemon.Timedate1")) { - m_interface = new QDBusInterface("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", "org.deepin.daemon.Timedate1", QDBusConnection::sessionBus(), this); + if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.deepin.dde.Timedate1")) { + m_interface = new QDBusInterface("org.deepin.dde.Timedate1", "/org/deepin/dde/Timedate1", "org.deepin.dde.Timedate1", QDBusConnection::sessionBus(), this); } else { - const QString path = QString("/org/deepin/daemon/Accounts/User%1").arg(QString::number(getuid())); - QDBusInterface * systemInterface = new QDBusInterface("org.deepin.daemon.Accounts1", path, "org.deepin.daemon.Accounts.User", + const QString path = QString("/org/deepin/dde/Accounts1/User%1").arg(QString::number(getuid())); + QDBusInterface * systemInterface = new QDBusInterface("org.deepin.dde.Accounts1", path, "org.deepin.dde.Accounts1.User", QDBusConnection::systemBus(), this); return systemInterface; } diff --git a/plugins/datetime/datetimewidget.cpp b/plugins/datetime/datetimewidget.cpp index 8d34940ce..dfbcb0e77 100644 --- a/plugins/datetime/datetimewidget.cpp +++ b/plugins/datetime/datetimewidget.cpp @@ -40,7 +40,7 @@ DatetimeWidget::DatetimeWidget(QWidget *parent) : QWidget(parent) , m_24HourFormat(false) , m_timeOffset(false) - , m_timedateInter(new Timedate("org.deepin.daemon.Timedate1", "/org/deepin/daemon/Timedate1", QDBusConnection::sessionBus(), this)) + , m_timedateInter(new Timedate("org.deepin.dde.Timedate1", "/org/deepin/dde/Timedate1", QDBusConnection::sessionBus(), this)) , m_shortDateFormat("yyyy-MM-dd") , m_shortTimeFormat("hh:mm") { diff --git a/plugins/datetime/datetimewidget.h b/plugins/datetime/datetimewidget.h index 21a2e60bf..f1faa02e1 100644 --- a/plugins/datetime/datetimewidget.h +++ b/plugins/datetime/datetimewidget.h @@ -22,11 +22,11 @@ #ifndef DATETIMEWIDGET_H #define DATETIMEWIDGET_H -#include "org_deepin_daemon_timedate.h" +#include "org_deepin_dde_timedate1.h" #include -using Timedate = org::deepin::daemon::Timedate1; +using Timedate = org::deepin::dde::Timedate1; class DatetimeWidget : public QWidget { diff --git a/frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml b/plugins/datetime/dbusinterface/xml/org.deepin.dde.Timedate1.xml similarity index 98% rename from frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml rename to plugins/datetime/dbusinterface/xml/org.deepin.dde.Timedate1.xml index 935a74c77..f3a46e3bf 100644 --- a/frame/dbusinterface/xml/org.deepin.daemon.Timedate.xml +++ b/plugins/datetime/dbusinterface/xml/org.deepin.dde.Timedate1.xml @@ -1,4 +1,4 @@ - + diff --git a/plugins/disk-mount/CMakeLists.txt b/plugins/disk-mount/CMakeLists.txt deleted file mode 100644 index e9ec9bb55..000000000 --- a/plugins/disk-mount/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - -set(PLUGIN_NAME "disk-mount") - -project(${PLUGIN_NAME}) - -# Sources files -file(GLOB SRCS "*.h" "*.cpp") - -find_package(PkgConfig REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5Svg REQUIRED) -find_package(Qt5DBus REQUIRED) -find_package(DtkWidget REQUIRED) - -add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN") -add_library(${PLUGIN_NAME} SHARED ${SRCS} resources.qrc) -set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../) -target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ../../interfaces) -target_link_libraries(${PLUGIN_NAME} PRIVATE - ${DtkWidget_LIBRARIES} - ${Qt5Widgets_LIBRARIES} - ${Qt5Svg_LIBRARIES} - ${Qt5DBus_LIBRARIES} -) - -install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) diff --git a/plugins/disk-mount/dbus/com.deepin.daemon.DiskMount.xml b/plugins/disk-mount/dbus/com.deepin.daemon.DiskMount.xml deleted file mode 100644 index f0ad16d00..000000000 --- a/plugins/disk-mount/dbus/com.deepin.daemon.DiskMount.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/disk-mount/dbus/dbusdiskmount.cpp b/plugins/disk-mount/dbus/dbusdiskmount.cpp deleted file mode 100644 index faa781e8f..000000000 --- a/plugins/disk-mount/dbus/dbusdiskmount.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDiskMount -p dbusdiskmount com.deepin.daemon.DiskMount.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 "dbusdiskmount.h" - -/* - * Implementation of interface class DBusDiskMount - */ - -DBusDiskMount::DBusDiskMount(QObject *parent) - : QDBusAbstractInterface("com.deepin.daemon.DiskMount", "/com/deepin/daemon/DiskMount", staticInterfaceName(), QDBusConnection::sessionBus(), parent) -{ - DiskInfo::registerMetaType(); - - QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage))); -} - -DBusDiskMount::~DBusDiskMount() -{ - QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage))); -} - diff --git a/plugins/disk-mount/dbus/dbusdiskmount.h b/plugins/disk-mount/dbus/dbusdiskmount.h deleted file mode 100644 index 63c21d6c5..000000000 --- a/plugins/disk-mount/dbus/dbusdiskmount.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusDiskMount -p dbusdiskmount com.deepin.daemon.DiskMount.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 DBUSDISKMOUNT_H_1468893654 -#define DBUSDISKMOUNT_H_1468893654 - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "variant/diskinfo.h" - -/* - * Proxy class for interface com.deepin.daemon.DiskMount - */ -class DBusDiskMount: 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.DiskMount") - 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.daemon.DiskMount"; } - -public: - explicit DBusDiskMount(QObject *parent = 0); - - ~DBusDiskMount(); - - Q_PROPERTY(DiskInfoList DiskList READ diskList NOTIFY DiskListChanged) - inline DiskInfoList diskList() const - { return qvariant_cast< DiskInfoList >(property("DiskList")); } - -public Q_SLOTS: // METHODS - inline QDBusPendingReply<> Eject(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("Eject"), argumentList); - } - - inline QDBusPendingReply ListDisk() - { - QList argumentList; - return asyncCallWithArgumentList(QStringLiteral("ListDisk"), argumentList); - } - - inline QDBusPendingReply<> Mount(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("Mount"), argumentList); - } - - inline QDBusPendingReply QueryDisk(const QString &in0) - { - QList argumentList; - argumentList << QVariant::fromValue(in0); - return asyncCallWithArgumentList(QStringLiteral("QueryDisk"), argumentList); - } - - inline QDBusPendingReply<> Unmount(const QString &diskId) - { - QList argumentList; - argumentList << QVariant::fromValue(diskId); - return asyncCallWithArgumentList(QStringLiteral("Unmount"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void Changed(int in0, const QString &in1); - void Error(const QString &uuid, const QString &info); -// begin property changed signals -void DiskListChanged(); -}; - -namespace com { - namespace deepin { - namespace daemon { - typedef ::DBusDiskMount DiskMount; - } - } -} -#endif diff --git a/plugins/disk-mount/dbus/variant/diskinfo.cpp b/plugins/disk-mount/dbus/variant/diskinfo.cpp deleted file mode 100644 index cbc34b8f2..000000000 --- a/plugins/disk-mount/dbus/variant/diskinfo.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "diskinfo.h" - -DiskInfo::DiskInfo() -{ - -} - -void DiskInfo::registerMetaType() -{ - qRegisterMetaType("DiskInfo"); - qDBusRegisterMetaType(); - - qRegisterMetaType("DiskInfoList"); - qDBusRegisterMetaType(); -} - -QDebug operator<<(QDebug debug, const DiskInfo &info) -{ - debug << info.m_id << info.m_name << info.m_type << info.m_path << info.m_mountPoint << info.m_icon; - debug << '\t' << info.m_unmountable << '\t' << info.m_ejectable; - debug << '\t' << info.m_usedSize << '\t' << info.m_totalSize; - debug << endl; - - return debug; -} - -const QDataStream &operator>>(QDataStream &args, DiskInfo &info) -{ - args >> info.m_id >> info.m_name >> info.m_type >> info.m_path >> info.m_mountPoint >> info.m_icon; - args >> info.m_unmountable >> info.m_ejectable; - args >> info.m_usedSize >> info.m_totalSize; - - return args; -} - -const QDBusArgument &operator>>(const QDBusArgument &args, DiskInfo &info) -{ - args.beginStructure(); - args >> info.m_id >> info.m_name >> info.m_type >> info.m_path >> info.m_mountPoint >> info.m_icon; - args >> info.m_unmountable >> info.m_ejectable; - args >> info.m_usedSize >> info.m_totalSize; - args.endStructure(); - - return args; -} - -QDataStream &operator<<(QDataStream &args, const DiskInfo &info) -{ - args << info.m_id << info.m_name << info.m_type << info.m_path << info.m_mountPoint << info.m_icon; - args << info.m_unmountable << info.m_ejectable; - args << info.m_usedSize << info.m_totalSize; - - return args; -} - -QDBusArgument &operator<<(QDBusArgument &args, const DiskInfo &info) -{ - args.beginStructure(); - args << info.m_id << info.m_name << info.m_type << info.m_path << info.m_mountPoint << info.m_icon; - args << info.m_unmountable << info.m_ejectable; - args << info.m_usedSize << info.m_totalSize; - args.endStructure(); - - return args; -} diff --git a/plugins/disk-mount/dbus/variant/diskinfo.h b/plugins/disk-mount/dbus/variant/diskinfo.h deleted file mode 100644 index fc5282261..000000000 --- a/plugins/disk-mount/dbus/variant/diskinfo.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef DISKINFO_H -#define DISKINFO_H - -#include -#include -#include - -class DiskInfo -{ -public: - DiskInfo(); - static void registerMetaType(); - - friend QDebug operator<<(QDebug debug, const DiskInfo &info); - friend QDBusArgument &operator<<(QDBusArgument &args, const DiskInfo &info); - friend QDataStream &operator<<(QDataStream &args, const DiskInfo &info); - friend const QDBusArgument &operator>>(const QDBusArgument &args, DiskInfo &info); - friend const QDataStream &operator>>(QDataStream &args, DiskInfo &info); - -public: - QString m_id; - QString m_name; - QString m_type; - QString m_path; - QString m_mountPoint; - QString m_icon; - - bool m_unmountable; - bool m_ejectable; - - quint64 m_usedSize; - quint64 m_totalSize; -}; - -typedef QList DiskInfoList; - -Q_DECLARE_METATYPE(DiskInfo) -Q_DECLARE_METATYPE(DiskInfoList) - -#endif // DISKINFO_H diff --git a/plugins/disk-mount/disk-mount.json b/plugins/disk-mount/disk-mount.json deleted file mode 100644 index bec81f0da..000000000 --- a/plugins/disk-mount/disk-mount.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "api": "2.0.0" -} diff --git a/plugins/disk-mount/diskcontrolitem.cpp b/plugins/disk-mount/diskcontrolitem.cpp deleted file mode 100644 index 3485e3ba8..000000000 --- a/plugins/disk-mount/diskcontrolitem.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "diskcontrolitem.h" - -#include -#include - -DWIDGET_USE_NAMESPACE - -DiskControlItem::DiskControlItem(const DiskInfo &info, QWidget *parent) - : QFrame(parent), - - m_unknowIcon(":/icons/resources/unknown.svg"), - - m_diskIcon(new QLabel), - m_diskName(new QLabel), - m_diskCapacity(new QLabel), - m_capacityValueBar(new QProgressBar), - m_unmountButton(new DImageButton) -{ -// QIcon::setThemeName("deepin"); - - m_diskName->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - m_diskName->setStyleSheet("color:white;"); - - m_diskCapacity->setStyleSheet("color:rgba(255, 255, 255, .6);"); - - m_capacityValueBar->setTextVisible(false); - m_capacityValueBar->setFixedHeight(2); - m_capacityValueBar->setStyleSheet("QProgressBar {" - "border:none;" - "background-color:rgba(255, 255, 255, .1);" - "}" - "QProgressBar::chunk {" - "background-color:rgba(255, 255, 255, .8);" - "}"); - - m_unmountButton->setNormalPic(":/icons/resources/unmount-normal.png"); - m_unmountButton->setHoverPic(":/icons/resources/unmount-hover.png"); - m_unmountButton->setPressPic(":/icons/resources/unmount-press.png"); - m_unmountButton->setStyleSheet("margin-top:12px;"); - - QVBoxLayout *infoLayout = new QVBoxLayout; - infoLayout->addWidget(m_diskName); - infoLayout->addWidget(m_diskCapacity); - infoLayout->setSpacing(0); - infoLayout->setContentsMargins(3, 6, 0, 8); - - QHBoxLayout *unmountLayout = new QHBoxLayout; - unmountLayout->addLayout(infoLayout); - unmountLayout->addWidget(m_unmountButton); - unmountLayout->setSpacing(0); - unmountLayout->setMargin(0); - - QVBoxLayout *progressLayout = new QVBoxLayout; - progressLayout->addLayout(unmountLayout); - progressLayout->addWidget(m_capacityValueBar); - progressLayout->setSpacing(0); - progressLayout->setContentsMargins(10, 0, 0, 5); - - QHBoxLayout *centralLayout = new QHBoxLayout; - centralLayout->addWidget(m_diskIcon); - centralLayout->addLayout(progressLayout); - centralLayout->setSpacing(0); - centralLayout->setContentsMargins(0, 0, 5, 0); - - setLayout(centralLayout); - setObjectName("DiskItem"); - setStyleSheet("QFrame #DiskItem:hover {" - "background-color:rgba(255, 255, 255, .1);" - "border-radius:4px;" - "}"); - - connect(m_unmountButton, &DImageButton::clicked, [this] {emit requestUnmount(m_info.m_id);}); - - updateInfo(info); -} - -void DiskControlItem::updateInfo(const DiskInfo &info) -{ - m_info = info; - - m_diskIcon->setPixmap(QIcon::fromTheme(info.m_icon, m_unknowIcon).pixmap(48, 48)); - if (!info.m_name.isEmpty()) - m_diskName->setText(info.m_name); - else - m_diskName->setText(tr("Unknown device")); - if (info.m_totalSize) - m_diskCapacity->setText(QString("%1/%2").arg(formatDiskSize(info.m_usedSize)).arg(formatDiskSize(info.m_totalSize))); - else if (info.m_name.isEmpty()) - m_diskCapacity->clear(); - else - m_diskCapacity->setText(tr("Unknown volume")); - m_capacityValueBar->setMinimum(0); - m_capacityValueBar->setMaximum(std::max(1ull, info.m_totalSize)); - m_capacityValueBar->setValue(info.m_usedSize); -} - -const QString DiskControlItem::formatDiskSize(const quint64 size) const -{ - const quint64 mSize = 1000; - const quint64 gSize = mSize * 1000; - const quint64 tSize = gSize * 1000; - - if (size >= tSize) - return QString::number(double(size) / tSize, 'f', 2) + 'T'; - else if (size >= gSize) - return QString::number(double(size) / gSize, 'f', 2) + "G"; - else if (size >= mSize) - return QString::number(double(size) / mSize, 'f', 1) + "M"; - else - return QString::number(size) + "K"; -} diff --git a/plugins/disk-mount/diskcontrolitem.h b/plugins/disk-mount/diskcontrolitem.h deleted file mode 100644 index a9da2421c..000000000 --- a/plugins/disk-mount/diskcontrolitem.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef DISKCONTROLITEM_H -#define DISKCONTROLITEM_H - -#include "dbus/dbusdiskmount.h" - -#include - -#include -#include -#include -#include - -class DiskControlItem : public QFrame -{ - Q_OBJECT - -public: - explicit DiskControlItem(const DiskInfo &info, QWidget *parent = 0); - -signals: - void requestUnmount(const QString &diskId) const; - -private slots: - void updateInfo(const DiskInfo &info); - const QString formatDiskSize(const quint64 size) const; - -private: - DiskInfo m_info; - QIcon m_unknowIcon; - - QLabel *m_diskIcon; - QLabel *m_diskName; - QLabel *m_diskCapacity; - QProgressBar *m_capacityValueBar; - Dtk::Widget::DImageButton *m_unmountButton; -}; - -#endif // DISKCONTROLITEM_H diff --git a/plugins/disk-mount/diskcontrolwidget.cpp b/plugins/disk-mount/diskcontrolwidget.cpp deleted file mode 100644 index 09c82fc5b..000000000 --- a/plugins/disk-mount/diskcontrolwidget.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "diskcontrolwidget.h" -#include "diskcontrolitem.h" - -#define WIDTH 300 - -DiskControlWidget::DiskControlWidget(QWidget *parent) - : QScrollArea(parent), - - m_centralLayout(new QVBoxLayout), - m_centralWidget(new QWidget), - - m_diskInter(new DBusDiskMount(this)) -{ - m_centralWidget->setLayout(m_centralLayout); - m_centralWidget->setFixedWidth(WIDTH); - - setWidget(m_centralWidget); - setFixedWidth(WIDTH); - setFrameStyle(QFrame::NoFrame); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setStyleSheet("background-color:transparent;"); - - connect(m_diskInter, &DBusDiskMount::DiskListChanged, this, &DiskControlWidget::diskListChanged); - connect(m_diskInter, &DBusDiskMount::Error, this, &DiskControlWidget::unmountFinished); - - QMetaObject::invokeMethod(this, "diskListChanged", Qt::QueuedConnection); -} - -void DiskControlWidget::unmountAll() -{ - for (auto disk : m_diskInfoList) - unmountDisk(disk.m_id); -} - -void DiskControlWidget::diskListChanged() -{ - DiskInfoList diskList = m_diskInter->diskList(); - - while (QLayoutItem *item = m_centralLayout->takeAt(0)) - { - delete item->widget(); - delete item; - } - - int mountedCount = 0; - for (auto info : diskList) - { - if (info.m_mountPoint.isEmpty()) - continue; - else - ++mountedCount; - - DiskControlItem *item = new DiskControlItem(info, this); - - connect(item, &DiskControlItem::requestUnmount, this, &DiskControlWidget::unmountDisk); - - m_centralLayout->addWidget(item); - m_diskInfoList.append(info); - } - - emit diskCountChanged(mountedCount); - - const int contentHeight = mountedCount * 70; - const int maxHeight = std::min(contentHeight, 70 * 6); - - m_centralWidget->setFixedHeight(contentHeight); - setFixedHeight(maxHeight); -} - -void DiskControlWidget::unmountDisk(const QString &diskId) const -{ - m_diskInter->Unmount(diskId); -} - -void DiskControlWidget::unmountFinished(const QString &uuid, const QString &info) -{ - qDebug() << uuid << info; -} diff --git a/plugins/disk-mount/diskcontrolwidget.h b/plugins/disk-mount/diskcontrolwidget.h deleted file mode 100644 index ea8144aac..000000000 --- a/plugins/disk-mount/diskcontrolwidget.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef DISKCONTROLWIDGET_H -#define DISKCONTROLWIDGET_H - -#include "dbus/dbusdiskmount.h" - -#include -#include - -class DiskControlWidget : public QScrollArea -{ - Q_OBJECT - -public: - explicit DiskControlWidget(QWidget *parent = 0); - - void unmountAll(); - -signals: - void diskCountChanged(const int count) const; - -private slots: - void diskListChanged(); - void unmountDisk(const QString &diskId) const; - void unmountFinished(const QString &uuid, const QString &info); - -private: - QVBoxLayout *m_centralLayout; - QWidget *m_centralWidget; - DBusDiskMount *m_diskInter; - - DiskInfoList m_diskInfoList; -}; - -#endif // DISKCONTROLWIDGET_H diff --git a/plugins/disk-mount/diskmountplugin.cpp b/plugins/disk-mount/diskmountplugin.cpp deleted file mode 100644 index e21a6906e..000000000 --- a/plugins/disk-mount/diskmountplugin.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "diskmountplugin.h" - -#define OPEN "open" -#define UNMOUNT_ALL "unmount_all" - -DiskMountPlugin::DiskMountPlugin(QObject *parent) - : QObject(parent), - - m_pluginAdded(false), - - m_tipsLabel(new QLabel), - m_diskPluginItem(new DiskPluginItem), - m_diskControlApplet(nullptr) -{ - m_diskPluginItem->setVisible(false); - - m_tipsLabel->setObjectName("diskmount"); - m_tipsLabel->setVisible(false); - m_tipsLabel->setText(tr("Disk")); - m_tipsLabel->setStyleSheet("color:white;" - "padding:5px 10px;"); - - connect(m_diskPluginItem, &DiskPluginItem::requestContextMenu, [this] {m_proxyInter->requestContextMenu(this, QString());}); -} - -const QString DiskMountPlugin::pluginName() const -{ - return "disk-mount"; -} - -void DiskMountPlugin::init(PluginProxyInterface *proxyInter) -{ - m_proxyInter = proxyInter; - - initCompoments(); - m_diskPluginItem->setDockDisplayMode(displayMode()); -} - -QWidget *DiskMountPlugin::itemWidget(const QString &itemKey) -{ - Q_UNUSED(itemKey); - - return m_diskPluginItem; -} - -QWidget *DiskMountPlugin::itemTipsWidget(const QString &itemKey) -{ - Q_UNUSED(itemKey); - - return m_tipsLabel; -} - -QWidget *DiskMountPlugin::itemPopupApplet(const QString &itemKey) -{ - Q_UNUSED(itemKey); - - return m_diskControlApplet; -} - -const QString DiskMountPlugin::itemContextMenu(const QString &itemKey) -{ - Q_UNUSED(itemKey); - - QList items; - items.reserve(2); - - QMap open; - open["itemId"] = OPEN; - open["itemText"] = tr("Open"); - open["isActive"] = true; - items.push_back(open); - - QMap unmountAll; - unmountAll["itemId"] = UNMOUNT_ALL; - unmountAll["itemText"] = tr("Unmount all"); - unmountAll["isActive"] = true; - items.push_back(unmountAll); - - QMap menu; - menu["items"] = items; - menu["checkableMenu"] = false; - menu["singleCheck"] = false; - - return QJsonDocument::fromVariant(menu).toJson(); -} - -void DiskMountPlugin::invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) -{ - Q_UNUSED(itemKey) - Q_UNUSED(checked) - - if (menuId == OPEN) - QProcess::startDetached("gvfs-open", QStringList() << "computer://"); - else if (menuId == UNMOUNT_ALL) - m_diskControlApplet->unmountAll(); -} - -void DiskMountPlugin::initCompoments() -{ - m_diskControlApplet = new DiskControlWidget; - m_diskControlApplet->setObjectName("dist-mount"); - m_diskControlApplet->setVisible(false); - - connect(m_diskControlApplet, &DiskControlWidget::diskCountChanged, this, &DiskMountPlugin::diskCountChanged); -} - -void DiskMountPlugin::displayModeChanged(const Dock::DisplayMode mode) -{ - m_diskPluginItem->setDockDisplayMode(mode); -} - -void DiskMountPlugin::diskCountChanged(const int count) -{ - if (m_pluginAdded == bool(count)) - return; - - m_pluginAdded = bool(count); - - if (m_pluginAdded) - m_proxyInter->itemAdded(this, QString()); - else - m_proxyInter->itemRemoved(this, QString()); -} diff --git a/plugins/disk-mount/diskmountplugin.h b/plugins/disk-mount/diskmountplugin.h deleted file mode 100644 index 046ba35a5..000000000 --- a/plugins/disk-mount/diskmountplugin.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef DISKMOUNTPLUGIN_H -#define DISKMOUNTPLUGIN_H - -#include - -#include "pluginsiteminterface.h" -#include "diskcontrolwidget.h" -#include "diskpluginitem.h" - -class DiskMountPlugin : public QObject, PluginsItemInterface -{ - Q_OBJECT - Q_INTERFACES(PluginsItemInterface) - Q_PLUGIN_METADATA(IID "com.deepin.dock.PluginsItemInterface" FILE "disk-mount.json") - -public: - explicit DiskMountPlugin(QObject *parent = 0); - - const QString pluginName() const; - void init(PluginProxyInterface *proxyInter); - - QWidget *itemWidget(const QString &itemKey); - QWidget *itemTipsWidget(const QString &itemKey); - QWidget *itemPopupApplet(const QString &itemKey); - - const QString itemContextMenu(const QString &itemKey); - void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked); - -private: - void initCompoments(); - - void displayModeChanged(const Dock::DisplayMode mode); - -private slots: - void diskCountChanged(const int count); - -private: - bool m_pluginAdded; - - QLabel *m_tipsLabel; - DiskPluginItem *m_diskPluginItem; - DiskControlWidget *m_diskControlApplet; -}; - -#endif // DISKMOUNTPLUGIN_H diff --git a/plugins/disk-mount/diskpluginitem.cpp b/plugins/disk-mount/diskpluginitem.cpp deleted file mode 100644 index 4dc2454a4..000000000 --- a/plugins/disk-mount/diskpluginitem.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "diskpluginitem.h" -#include "imageutil.h" - -#include -#include -#include -#include - -DiskPluginItem::DiskPluginItem(QWidget *parent) - : QWidget(parent), - m_displayMode(Dock::Efficient) -{ -// QIcon::setThemeName("deepin"); -} - -void DiskPluginItem::setDockDisplayMode(const Dock::DisplayMode mode) -{ - m_displayMode = mode; - - updateIcon(); -} - -void DiskPluginItem::paintEvent(QPaintEvent *e) -{ - QWidget::paintEvent(e); - - QPainter painter(this); - const QRectF &rf = QRectF(rect()); - const QRectF &rfp = QRectF(m_icon.rect()); - painter.drawPixmap(rf.center() - rfp.center(), m_icon); -} - -void DiskPluginItem::resizeEvent(QResizeEvent *e) -{ - QWidget::resizeEvent(e); - - updateIcon(); -} - -void DiskPluginItem::mousePressEvent(QMouseEvent *e) -{ - if (e->button() != Qt::RightButton) - return QWidget::mousePressEvent(e); - - const QPoint p(e->pos() - rect().center()); - if (p.manhattanLength() < std::min(width(), height()) * 0.8 * 0.5) - { - emit requestContextMenu(); - return; - } - - QWidget::mousePressEvent(e); -} - -QSize DiskPluginItem::sizeHint() const -{ - return QSize(26, 26); -} - -void DiskPluginItem::updateIcon() -{ - if (m_displayMode == Dock::Efficient) -// m_icon = ImageUtil::loadSvg(":/icons/resources/icon-small.svg", 16); - m_icon = QIcon::fromTheme("drive-removable-dock-symbolic").pixmap(16, 16); - else -// m_icon = ImageUtil::loadSvg(":/icons/resources/icon.svg", std::min(width(), height()) * 0.8); - m_icon = QIcon::fromTheme("drive-removable-dock").pixmap(std::min(width(), height()) * 0.8, std::min(width(), height()) * 0.8); - - update(); -} diff --git a/plugins/disk-mount/diskpluginitem.h b/plugins/disk-mount/diskpluginitem.h deleted file mode 100644 index bd0ca2648..000000000 --- a/plugins/disk-mount/diskpluginitem.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef DISKPLUGINITEM_H -#define DISKPLUGINITEM_H - -#include "constants.h" - -#include -#include - -class DiskPluginItem : public QWidget -{ - Q_OBJECT - -public: - explicit DiskPluginItem(QWidget *parent = 0); - -signals: - void requestContextMenu() const; - -public slots: - void setDockDisplayMode(const Dock::DisplayMode mode); - -protected: - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void mousePressEvent(QMouseEvent *e); - QSize sizeHint() const; - -private: - void updateIcon(); - -private: - Dock::DisplayMode m_displayMode; - - QPixmap m_icon; -}; - -#endif // DISKPLUGINITEM_H diff --git a/plugins/disk-mount/imageutil.cpp b/plugins/disk-mount/imageutil.cpp deleted file mode 100644 index 2ff32f629..000000000 --- a/plugins/disk-mount/imageutil.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "imageutil.h" - -#include - -const QPixmap ImageUtil::loadSvg(const QString &path, const int size) -{ - QPixmap pixmap(size, size); - QSvgRenderer renderer(path); - pixmap.fill(Qt::transparent); - - QPainter painter; - painter.begin(&pixmap); - renderer.render(&painter); - painter.end(); - - return pixmap; -} diff --git a/plugins/disk-mount/imageutil.h b/plugins/disk-mount/imageutil.h deleted file mode 100644 index 59c90c06d..000000000 --- a/plugins/disk-mount/imageutil.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. - * - * Author: sbw - * - * Maintainer: sbw - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef IMAGEUTIL_H -#define IMAGEUTIL_H - -#include -#include - -class ImageUtil -{ -public: - static const QPixmap loadSvg(const QString &path, const int size); -}; - -#endif // IMAGEUTIL_H diff --git a/plugins/disk-mount/resources.qrc b/plugins/disk-mount/resources.qrc deleted file mode 100644 index f36bff8c2..000000000 --- a/plugins/disk-mount/resources.qrc +++ /dev/null @@ -1,10 +0,0 @@ - - - resources/icon-small.svg - resources/icon.svg - resources/unmount-press.png - resources/unmount-normal.png - resources/unmount-hover.png - resources/unknown.svg - - diff --git a/plugins/disk-mount/resources/icon-small.svg b/plugins/disk-mount/resources/icon-small.svg deleted file mode 100644 index 549ca8a0e..000000000 --- a/plugins/disk-mount/resources/icon-small.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - drive_harddisk_usb_symbolic_active_16px - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/plugins/disk-mount/resources/icon.svg b/plugins/disk-mount/resources/icon.svg deleted file mode 100644 index 952b644bf..000000000 --- a/plugins/disk-mount/resources/icon.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - 磁盘挂载-48px - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/disk-mount/resources/unknown.svg b/plugins/disk-mount/resources/unknown.svg deleted file mode 100644 index 8156620ab..000000000 --- a/plugins/disk-mount/resources/unknown.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - drive-unknown - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/disk-mount/resources/unmount-hover.png b/plugins/disk-mount/resources/unmount-hover.png deleted file mode 100644 index 863e17ac03dfed09eee3213abce398b5d6c219e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 449 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc0wmQNuC@UwmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^> z;_2(k{(xPW%SycQqqjCt=%lBMV~EE2sgpPI9x@Pct=G8}Xuwdtfl<`AtH<#upGb%4 zB_)-x1!tHhDqUQ<$e35ehO6bHD&wKmHP6@o`29zj)#Ie*iVqc9Ttz{pii?-|`lh+| z@y@^T;GUEA?xJm%zAv1nTKsO=WZU%#d*7;bmY&YmD!OcCI8nt-#@AllHRRq5*89Pa zw+MuWtUIG4Hu198j{q5usLglVZ0A2Py_T=%ca~x16^p6sOD{PKO!NEg7=Ndn{hqt; zt?wxs{bm0xegZwETH+c}l9E`GYL#4+3Zxi}3=GY5 z4a{{7Ekg_qtV}JejEuDnEUXL+0_PTop=ij>PsvQH#H~T$!0A^&4Gf;HelF{r5}E*y CaGZJo diff --git a/plugins/disk-mount/resources/unmount-normal.png b/plugins/disk-mount/resources/unmount-normal.png deleted file mode 100644 index 77feec2ea7b4a1ae0bb8217dee61d0d42ebfb4da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 497 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc0wmQNuC@UwmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^> z;_2(k{(xPW%SycQqqjCt=%=TPV~EE2sgpPQ9X1eX+rK*`=}gEoo2Jh~H&@%Z+;8Wd z%2>9@!$(6QPEpJwr{j&FlcYluN1DRcH)2bl&i`}2)^5K4wg*pzc-neIBwlQYklY^m zF~aZUqzK!oTNqzV5oN7ky>ME7K!a?~6XgO{Z3foq??ZM!Q~K0;+A-EivURP^3FGa7 zYf3tk7HRJ(WIe#E?^x0q=yT<+n;m0Hig0Px6rBxQ_x#$qw^%a8NcHQp&fgmhE1#U3 z9dbufUFO`Hr Bv?~Ar diff --git a/plugins/disk-mount/resources/unmount-press.png b/plugins/disk-mount/resources/unmount-press.png deleted file mode 100644 index a3e0692cd9b6a2d234b8d343dd249ca3acb8b03c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc0wmQNuC@UwmUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^> z;_2(k{(xPW%SycQqqjCt=&PrTV~EE2sgn);m<yO zDABKvH*A-SL`&PO%NZMm92nJ%&g&(b@-{fFP|MTTF^+5JGI{aOt!1+R&u6yXrjDYM zZ4*x$GvxnKxoGKT7+K!GiCN&h(d#Q3sZQ~!vd_0Y)jT=HOYo$)d}i{dMZHTV6ddn4 z{UfwZJH_D4i=C3*wldET|E+i-T0V902OC7#SFv=^B{p8d`=J w8d#ZHSQ!~>8(3Hw7zEBO4nxt9o1c=IR*74K!hzGTfEpM)UHx3vIVCg!00qUXoB#j- diff --git a/plugins/display/brightnessmodel.cpp b/plugins/display/brightnessmodel.cpp index 9d05e97f1..b560d8548 100644 --- a/plugins/display/brightnessmodel.cpp +++ b/plugins/display/brightnessmodel.cpp @@ -32,9 +32,9 @@ #include #include -static const QString serviceName("com.deepin.daemon.Display"); -static const QString servicePath("/com/deepin/daemon/Display"); -static const QString serviceInterface("com.deepin.daemon.Display"); +static const QString serviceName("org.deepin.dde.Display1"); +static const QString servicePath("/org/deepin/dde/Display1"); +static const QString serviceInterface("org.deepin.dde.Display1"); static const QString propertiesInterface("org.freedesktop.DBus.Properties"); BrightnessModel::BrightnessModel(QObject *parent) diff --git a/plugins/display/collaborationdevmodel.cpp b/plugins/display/collaborationdevmodel.cpp index 6305ec88a..e9bbe3609 100644 --- a/plugins/display/collaborationdevmodel.cpp +++ b/plugins/display/collaborationdevmodel.cpp @@ -32,9 +32,9 @@ DGUI_USE_NAMESPACE DCORE_USE_NAMESPACE -static const QString CollaborationService = "com.deepin.Cooperation"; -static const QString CollaborationPath = "/com/deepin/Cooperation"; -static const QString CollaborationInterface = "com.deepin.Cooperation"; +static const QString CollaborationService = "org.deepin.dde.Cooperation1"; +static const QString CollaborationPath = "/org/deepin/dde/Cooperation1"; +static const QString CollaborationInterface = "org.deepin.dde.Cooperation1"; static const QString ColPropertiesInterface = "org.freedesktop.DBus.Properties"; CollaborationDevModel::CollaborationDevModel(QObject *parent) diff --git a/plugins/keyboard-layout/dbusadaptors.cpp b/plugins/keyboard-layout/dbusadaptors.cpp index 1ecdfc82d..2c1cd39d4 100644 --- a/plugins/keyboard-layout/dbusadaptors.cpp +++ b/plugins/keyboard-layout/dbusadaptors.cpp @@ -25,10 +25,10 @@ DBusAdaptors::DBusAdaptors(QObject *parent) : QDBusAbstractAdaptor(parent), - m_keyboard(new Keyboard("com.deepin.daemon.InputDevices", - "/com/deepin/daemon/InputDevice/Keyboard", + m_keyboard(new Keyboard("org.deepin.dde.InputDevices1", + "/org/deepin/dde/InputDevice1/Keyboard", QDBusConnection::sessionBus(), this)), - m_menu(new QMenu()), + m_menu(new QMenu()), m_gsettings(Utils::ModuleSettingsPtr("keyboard", QByteArray(), this)) { m_keyboard->setSync(false); @@ -173,7 +173,6 @@ void DBusAdaptors::refreshMenuSelection() void DBusAdaptors::handleActionTriggered(QAction *action) { if (action == m_addLayoutAction) { -#ifdef USE_AM DDBusSender() .service("org.deepin.dde.ControlCenter1") .interface("org.deepin.dde.ControlCenter1") @@ -182,16 +181,6 @@ void DBusAdaptors::handleActionTriggered(QAction *action) .arg(QString("keyboard")) .arg(QString("Keyboard Layout/Add Keyboard Layout")) .call(); -#else - DDBusSender() - .service("com.deepin.dde.ControlCenter") - .interface("com.deepin.dde.ControlCenter") - .path("/com/deepin/dde/ControlCenter") - .method("ShowPage") - .arg(QString("keyboard")) - .arg(QString("Keyboard Layout/Add Keyboard Layout")) - .call(); -#endif } const QString layout = action->objectName(); diff --git a/plugins/keyboard-layout/dbusadaptors.h b/plugins/keyboard-layout/dbusadaptors.h index 99d345cec..befa7d2d1 100644 --- a/plugins/keyboard-layout/dbusadaptors.h +++ b/plugins/keyboard-layout/dbusadaptors.h @@ -22,17 +22,17 @@ #include #include -#include "org_deepin_daemon_inputdevice_keyboard.h" +#include "org_deepin_dde_inputdevice1_keyboard.h" -using Keyboard = org::deepin::daemon::inputdevice::Keyboard1; +using Keyboard = org::deepin::dde::inputdevice1::Keyboard1; class QGSettings; class DBusAdaptors : public QDBusAbstractAdaptor { Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.Keyboard") + Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.Dock1.KeyboardLayout") // Q_CLASSINFO("D-Bus Introspection", "" -// " \n" +// " \n" // " \n" // " " // " " diff --git a/plugins/keyboard-layout/dbusinterface/xml/org.deepin.daemon.InputDevice.Keyboard.xml b/plugins/keyboard-layout/dbusinterface/xml/org.deepin.dde.InputDevice1.Keyboard.xml similarity index 96% rename from plugins/keyboard-layout/dbusinterface/xml/org.deepin.daemon.InputDevice.Keyboard.xml rename to plugins/keyboard-layout/dbusinterface/xml/org.deepin.dde.InputDevice1.Keyboard.xml index d37690b89..633c33581 100644 --- a/plugins/keyboard-layout/dbusinterface/xml/org.deepin.daemon.InputDevice.Keyboard.xml +++ b/plugins/keyboard-layout/dbusinterface/xml/org.deepin.dde.InputDevice1.Keyboard.xml @@ -1,5 +1,5 @@ - + diff --git a/plugins/keyboard-layout/keyboardplugin.cpp b/plugins/keyboard-layout/keyboardplugin.cpp index dba1ef731..eb9f24b5e 100644 --- a/plugins/keyboard-layout/keyboardplugin.cpp +++ b/plugins/keyboard-layout/keyboardplugin.cpp @@ -44,7 +44,7 @@ void KeyboardPlugin::init(PluginProxyInterface *proxyInter) m_proxyInter = proxyInter; if (!m_dbusAdaptors) { - QString serverName = "com.deepin.daemon.InputDevices"; + QString serverName = "org.deepin.dde.InputDevices1"; QDBusConnectionInterface *ifc = QDBusConnection::sessionBus().interface(); if (!ifc->isServiceRegistered(serverName)) { @@ -60,8 +60,8 @@ void KeyboardPlugin::init(PluginProxyInterface *proxyInter) m_dbusAdaptors = new DBusAdaptors(this); } - QDBusConnection::sessionBus().registerService("com.deepin.dde.Keyboard"); - QDBusConnection::sessionBus().registerObject("/com/deepin/dde/Keyboard", "com.deepin.dde.Keyboard", this); + QDBusConnection::sessionBus().registerService("org.deepin.dde.Dock1.KeyboardLayout"); + QDBusConnection::sessionBus().registerObject("/org/deepin/dde/Dock1/KeyboardLayout", "org.deepin.dde.Dock1.KeyboardLayout", this); } } diff --git a/plugins/keyboard-layout/keybord_layout.json b/plugins/keyboard-layout/keybord_layout.json index ca5193e33..ade26475f 100644 --- a/plugins/keyboard-layout/keybord_layout.json +++ b/plugins/keyboard-layout/keybord_layout.json @@ -1,17 +1,17 @@ { "data": { "text": { - "dbus_service": "com.deepin.dde.Keyboard", - "dbus_path": "/com/deepin/dde/Keyboard", - "dbus_interface": "com.deepin.dde.Keyboard", + "dbus_service": "org.deepin.dde.Dock1.KeyboardLayout", + "dbus_path": "/org/deepin/dde/Dock1/KeyboardLayout", + "dbus_interface": "org.deepin.dde.Dock1.KeyboardLayout", "dbus_properties": "layout" } }, "action": { "trigger": { - "dbus_service": "com.deepin.dde.Keyboard", - "dbus_path": "/com/deepin/dde/Keyboard", - "dbus_interface": "com.deepin.dde.Keyboard", + "dbus_service": "org.deepin.dde.Dock1.KeyboardLayout", + "dbus_path": "/org/deepin/dde/Dock1/KeyboardLayout", + "dbus_interface": "org.deepin.dde.Dock1.KeyboardLayout", "dbus_method": "onClicked" } } diff --git a/plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock.Entry.xml b/plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock1.Entry.xml similarity index 100% rename from plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock.Entry.xml rename to plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock1.Entry.xml diff --git a/plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock.xml b/plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml similarity index 100% rename from plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock.xml rename to plugins/onboard/dbusinterface/xml/org.deepin.dde.daemon.Dock1.xml diff --git a/plugins/onboard/onboardplugin.cpp b/plugins/onboard/onboardplugin.cpp index 986108160..1274b663c 100644 --- a/plugins/onboard/onboardplugin.cpp +++ b/plugins/onboard/onboardplugin.cpp @@ -22,8 +22,8 @@ #include "onboardplugin.h" #include "../widgets/tipswidget.h" -#include "org_deepin_dde_daemon_dock.h" -#include "org_deepin_dde_daemon_dock_entry.h" +#include "org_deepin_dde_daemon_dock1.h" +#include "org_deepin_dde_daemon_dock1_entry.h" #include diff --git a/plugins/overlay-warning/CMakeLists.txt b/plugins/overlay-warning/CMakeLists.txt index 6041f163e..7f0d65ad7 100644 --- a/plugins/overlay-warning/CMakeLists.txt +++ b/plugins/overlay-warning/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) # policy kit -install(FILES com.deepin.dde.dock.overlay.policy +install(FILES org.deepin.dde.dock.overlay.policy DESTINATION share/polkit-1/actions/) diff --git a/plugins/overlay-warning/com.deepin.dde.dock.overlay.policy b/plugins/overlay-warning/org.deepin.dde.dock.overlay.policy similarity index 100% rename from plugins/overlay-warning/com.deepin.dde.dock.overlay.policy rename to plugins/overlay-warning/org.deepin.dde.dock.overlay.policy diff --git a/plugins/overlay-warning/overlay-warning-plugin.cpp b/plugins/overlay-warning/overlay-warning-plugin.cpp index 504ec497a..229144d15 100644 --- a/plugins/overlay-warning/overlay-warning-plugin.cpp +++ b/plugins/overlay-warning/overlay-warning-plugin.cpp @@ -31,7 +31,7 @@ #define PLUGIN_STATE_KEY "enable" #define OverlayFileSystemType "overlay" -#define AuthAgentDbusService "com.deepin.Polkit1AuthAgent" +#define AuthAgentDbusService "org.deepin.dde.Polkit1.AuthAgent" DWIDGET_USE_NAMESPACE diff --git a/plugins/plugin-guide/plugins-developer-guide.md b/plugins/plugin-guide/plugins-developer-guide.md index a54ce3c78..fde7dbce7 100644 --- a/plugins/plugin-guide/plugins-developer-guide.md +++ b/plugins/plugin-guide/plugins-developer-guide.md @@ -230,12 +230,12 @@ install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) } ``` -另外(可选的)还支持指定一个 dbus 服务,dock 在加载插件时会检查此插件所依赖的 dbus 服务,如果服务没有启动则不会初始化这个插件,直到服务启动,如下表示依赖 dbus 地址为 "com.deepin.daemon.Network" 的 dbus 服务。 +另外(可选的)还支持指定一个 dbus 服务,dock 在加载插件时会检查此插件所依赖的 dbus 服务,如果服务没有启动则不会初始化这个插件,直到服务启动,如下表示依赖 dbus 地址为 "org.deepin.dde.Network1" 的 dbus 服务。 ``` json { "api": "2.0.0", - "depends-daemon-dbus-service": "com.deepin.daemon.Network" + "depends-daemon-dbus-service": "org.deepin.dde.Network1" } ``` @@ -245,7 +245,7 @@ install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins) { "api": "2.0.0", "order": 1, - "depends-daemon-dbus-service": "org.deepin.daemon.Audio1" + "depends-daemon-dbus-service": "org.deepin.dde.Audio1" } ``` diff --git a/plugins/power/dbus/dbusaccount.cpp b/plugins/power/dbus/dbusaccount.cpp index bf0b3173e..3597ae66f 100644 --- a/plugins/power/dbus/dbusaccount.cpp +++ b/plugins/power/dbus/dbusaccount.cpp @@ -21,7 +21,7 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusAccount -p dbusaccount org.deepin.daemon.Accounts.xml + * Command line was: qdbusxml2cpp -c DBusAccount -p dbusaccount org.deepin.dde.Accounts1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * diff --git a/plugins/power/dbus/dbusaccount.h b/plugins/power/dbus/dbusaccount.h index a722bd55d..b8f8e8126 100644 --- a/plugins/power/dbus/dbusaccount.h +++ b/plugins/power/dbus/dbusaccount.h @@ -21,7 +21,7 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusAccount -p dbusaccount org.deepin.daemon.Accounts.xml + * Command line was: qdbusxml2cpp -c DBusAccount -p dbusaccount org.deepin.dde.Accounts1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -42,7 +42,7 @@ #include /* - * Proxy class for interface org.deepin.daemon.Accounts1 + * Proxy class for interface org.deepin.dde.Accounts1 */ class DBusAccount: public QDBusAbstractInterface { @@ -55,7 +55,7 @@ class DBusAccount: public QDBusAbstractInterface return; } QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName != "org.deepin.daemon.Accounts1") { + if (interfaceName != "org.deepin.dde.Accounts1") { return; } QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); @@ -72,11 +72,11 @@ class DBusAccount: public QDBusAbstractInterface } public: static inline const char *staticService() - { return "org.deepin.daemon.Accounts1"; } + { return "org.deepin.dde.Accounts1"; } static inline const char *staticInterfacePath() - { return "/org/deepin/daemon/Accounts1"; } + { return "/org/deepin/dde/Accounts1"; } static inline const char *staticInterfaceName() - { return "org.deepin.daemon.Accounts1"; } + { return "org.deepin.dde.Accounts1"; } public: explicit DBusAccount(QObject *parent = 0); @@ -90,7 +90,7 @@ public: //namespace com { // namespace deepin { -// namespace daemon { +// namespace dde { // typedef ::DBusAccount Accounts; // } // } diff --git a/plugins/power/dbus/dbuspower.cpp b/plugins/power/dbus/dbuspower.cpp index 1c952860c..ababc6e45 100644 --- a/plugins/power/dbus/dbuspower.cpp +++ b/plugins/power/dbus/dbuspower.cpp @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusPower -p dbuspower org.deepin.daemon.Power.xml + * Command line was: qdbusxml2cpp -c DBusPower -p dbuspower org.deepin.dde.Power1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -16,7 +16,7 @@ */ DBusPower::DBusPower(QObject *parent) - : QDBusAbstractInterface("org.deepin.daemon.Power1", "/org/deepin/daemon/Power1", staticInterfaceName(), QDBusConnection::sessionBus(), parent) + : QDBusAbstractInterface("org.deepin.dde.Power1", "/org/deepin/dde/Power1", staticInterfaceName(), QDBusConnection::sessionBus(), parent) { qRegisterMetaType("BatteryStateMap"); qDBusRegisterMetaType(); diff --git a/plugins/power/dbus/dbuspower.h b/plugins/power/dbus/dbuspower.h index 646c857c7..1f0417b1f 100644 --- a/plugins/power/dbus/dbuspower.h +++ b/plugins/power/dbus/dbuspower.h @@ -1,6 +1,6 @@ /* * This file was generated by qdbusxml2cpp version 0.8 - * Command line was: qdbusxml2cpp -c DBusPower -p dbuspower org.deepin.daemon.Power.xml + * Command line was: qdbusxml2cpp -c DBusPower -p dbuspower org.deepin.dde.Power1.xml * * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). * @@ -26,7 +26,7 @@ Q_DECLARE_METATYPE(BatteryPercentageMap) Q_DECLARE_METATYPE(BatteryStateMap) /* - * Proxy class for interface org.deepin.daemon.Power + * Proxy class for interface org.deepin.dde.Power1 */ class DBusPower: public QDBusAbstractInterface { @@ -38,7 +38,7 @@ class DBusPower: public QDBusAbstractInterface if (3 != arguments.count()) return; QString interfaceName = msg.arguments().at(0).toString(); - if (interfaceName !="org.deepin.daemon.Power1") + if (interfaceName !="org.deepin.dde.Power1") return; QVariantMap changedProps = qdbus_cast(arguments.at(1).value()); foreach(const QString &prop, changedProps.keys()) { @@ -53,7 +53,7 @@ class DBusPower: public QDBusAbstractInterface } public: static inline const char *staticInterfaceName() - { return "org.deepin.daemon.Power1"; } + { return "org.deepin.dde.Power1"; } public: explicit DBusPower(QObject *parent = 0); @@ -82,8 +82,8 @@ void BatteryStateChanged(); namespace org { namespace deepin { - namespace daemon { - typedef ::DBusPower Power1; + namespace dde { + typedef ::DBusPower SessionPower1; } } } diff --git a/plugins/power/dbus/com.deepin.daemon.Power.xml b/plugins/power/dbus/org.deepin.dde.Power1.xml similarity index 96% rename from plugins/power/dbus/com.deepin.daemon.Power.xml rename to plugins/power/dbus/org.deepin.dde.Power1.xml index af034c1f2..9589fe74c 100644 --- a/plugins/power/dbus/com.deepin.daemon.Power.xml +++ b/plugins/power/dbus/org.deepin.dde.Power1.xml @@ -1,4 +1,4 @@ - +