diff --git a/debian/control b/debian/control index 505922762..d02f5779b 100644 --- a/debian/control +++ b/debian/control @@ -34,6 +34,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, deepin-desktop-schemas (>=5.8.0.34), libdframeworkdbus2 (>=5.3.0.24), libdde-network-utils (>=5.3.0.5), + dde-qt5xcb-plugin (>=5.0.19), dde-daemon (>=5.12.0.31), startdde (>=5.6.0.34), lastore-daemon (>=5.1.0.21) diff --git a/frame/dbus/dbusdockadaptors.cpp b/frame/dbus/dbusdockadaptors.cpp index a2d7bb390..c6d8abeef 100644 --- a/frame/dbus/dbusdockadaptors.cpp +++ b/frame/dbus/dbusdockadaptors.cpp @@ -45,8 +45,12 @@ void DBusDockAdaptors::callShow() return parent()->callShow(); } +void DBusDockAdaptors::ReloadPlugins() +{ + return parent()->relaodPlugins(); +} + QRect DBusDockAdaptors::geometry() const { return parent()->geometry(); } - diff --git a/frame/dbus/dbusdockadaptors.h b/frame/dbus/dbusdockadaptors.h index b7c8e3d61..255751f66 100644 --- a/frame/dbus/dbusdockadaptors.h +++ b/frame/dbus/dbusdockadaptors.h @@ -36,6 +36,7 @@ class DBusDockAdaptors: public QDBusAbstractAdaptor " \n" " \n" " " + " " " " "" "" @@ -50,6 +51,7 @@ public: public Q_SLOTS: // METHODS void callShow(); + void ReloadPlugins(); public: // PROPERTIES Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 9a101a234..b7f78ee29 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -142,6 +142,11 @@ AppItem::~AppItem() m_appNameTips->deleteLater(); } +void AppItem::checkEntry() +{ + m_itemEntryInter->Check(); +} + const QString AppItem::appId() const { return m_id; diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 8a037cd1a..435058fd6 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -46,6 +46,7 @@ public: explicit AppItem(const QDBusObjectPath &entry, QWidget *parent = nullptr); ~AppItem() override; + void checkEntry() override; const QString appId() const; bool isValid() const; void updateWindowIconGeometries(); diff --git a/frame/item/components/appdragwidget.cpp b/frame/item/components/appdragwidget.cpp index 6f4aed3ff..5c58554ae 100644 --- a/frame/item/components/appdragwidget.cpp +++ b/frame/item/components/appdragwidget.cpp @@ -203,7 +203,6 @@ void AppDragWidget::dropEvent(QDropEvent *event) } else { hide(); } - emit animationFinished(); AppItem *appItem = static_cast(event->source()); appItem->undock(); m_popupWindow->setVisible(false); @@ -267,7 +266,6 @@ void AppDragWidget::initAnimations() connect(m_animGroup, &QParallelAnimationGroup::stateChanged, this, &AppDragWidget::onRemoveAnimationStateChanged); connect(m_goBackAnim, &QPropertyAnimation::finished, this, &AppDragWidget::hide); - connect(m_goBackAnim, &QPropertyAnimation::finished, this, &AppDragWidget::animationFinished); } void AppDragWidget::initConfigurations() diff --git a/frame/item/components/appdragwidget.h b/frame/item/components/appdragwidget.h index b9aa00855..556fdb451 100644 --- a/frame/item/components/appdragwidget.h +++ b/frame/item/components/appdragwidget.h @@ -51,7 +51,6 @@ public: signals: void requestRemoveItem(); - void animationFinished(); protected: void mouseMoveEvent(QMouseEvent *event) override; diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index e5d235df2..346c95f72 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -58,14 +58,14 @@ AppSnapshot::AppSnapshot(const WId wid, QWidget *parent) : QWidget(parent) , m_wid(wid) , m_isWidowHidden(false) - , m_title(new TipsWidget) + , m_title(new TipsWidget(this)) , m_waitLeaveTimer(new QTimer(this)) , m_closeBtn2D(new DIconButton(this)) , m_wmHelper(DWindowManagerHelper::instance()) , m_dockDaemonInter(new DockDaemonInter("com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this)) { - m_closeBtn2D->setFixedSize(24, 24); - m_closeBtn2D->setIconSize(QSize(24, 24)); + m_closeBtn2D->setFixedSize(SNAP_CLOSE_BTN_WIDTH, SNAP_CLOSE_BTN_WIDTH); + m_closeBtn2D->setIconSize(QSize(SNAP_CLOSE_BTN_WIDTH, SNAP_CLOSE_BTN_WIDTH)); m_closeBtn2D->setObjectName("closebutton-2d"); m_closeBtn2D->setIcon(QIcon(":/icons/resources/close_round_normal.svg")); m_closeBtn2D->setVisible(false); @@ -210,7 +210,7 @@ void AppSnapshot::enterEvent(QEvent *e) QWidget::enterEvent(e); if (!m_wmHelper->hasComposite()) { - m_closeBtn2D->move(width() - m_closeBtn2D->width() - 5, (height() - m_closeBtn2D->height()) / 2); + m_closeBtn2D->move(width() - m_closeBtn2D->width() - SNAP_CLOSE_BTN_MARGIN, (height() - m_closeBtn2D->height()) / 2); m_closeBtn2D->setVisible(true); } else { emit entered(wid()); @@ -284,14 +284,12 @@ void AppSnapshot::mousePressEvent(QMouseEvent *e) bool AppSnapshot::eventFilter(QObject *watched, QEvent *e) { - if(watched == m_closeBtn2D) { - if(watched == m_closeBtn2D && (e->type() == QEvent::HoverEnter || e->type() == QEvent::HoverMove)) { + if (watched == m_closeBtn2D) { + if (watched == m_closeBtn2D && (e->type() == QEvent::HoverEnter || e->type() == QEvent::HoverMove)) { m_closeBtn2D->setIcon(QIcon(":/icons/resources/close_round_hover.svg")); - } - else if (watched == m_closeBtn2D && e->type() == QEvent::HoverLeave) { + } else if (watched == m_closeBtn2D && e->type() == QEvent::HoverLeave) { m_closeBtn2D->setIcon(QIcon(":/icons/resources/close_round_normal.svg")); - } - else if (watched == m_closeBtn2D && e->type() == QEvent::MouseButtonPress) { + } else if (watched == m_closeBtn2D && e->type() == QEvent::MouseButtonPress) { m_closeBtn2D->setIcon(QIcon(":/icons/resources/close_round_press.svg")); } } @@ -383,7 +381,7 @@ void AppSnapshot::getWindowState() } Atom *atoms = reinterpret_cast(properties); - for(i = 0; i < num_items; ++i) { + for (i = 0; i < num_items; ++i) { const char *atomName = XGetAtomName(display, atoms[i]); if (strcmp(atomName, "_NET_WM_STATE_HIDDEN") == 0) { diff --git a/frame/item/components/appsnapshot.h b/frame/item/components/appsnapshot.h index ee1de0da4..a8dd7a847 100644 --- a/frame/item/components/appsnapshot.h +++ b/frame/item/components/appsnapshot.h @@ -38,6 +38,9 @@ DGUI_USE_NAMESPACE #define SNAP_WIDTH 200 #define SNAP_HEIGHT 130 +#define SNAP_CLOSE_BTN_WIDTH (24) +#define SNAP_CLOSE_BTN_MARGIN (5) + struct SHMInfo; struct _XImage; typedef _XImage XImage; diff --git a/frame/item/components/previewcontainer.cpp b/frame/item/components/previewcontainer.cpp index e4d6166ed..61e7608ba 100644 --- a/frame/item/components/previewcontainer.cpp +++ b/frame/item/components/previewcontainer.cpp @@ -38,7 +38,7 @@ PreviewContainer::PreviewContainer(QWidget *parent) m_mouseLeaveTimer(new QTimer(this)), m_wmHelper(DWindowManagerHelper::instance()) { - m_windowListLayout = new QBoxLayout(QBoxLayout::LeftToRight); + m_windowListLayout = new QBoxLayout(QBoxLayout::LeftToRight, this); m_windowListLayout->setSpacing(SPACING); m_windowListLayout->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN); @@ -52,7 +52,6 @@ PreviewContainer::PreviewContainer(QWidget *parent) m_waitForShowPreviewTimer->setInterval(200); setAcceptDrops(true); - setLayout(m_windowListLayout); setFixedSize(SNAP_WIDTH, SNAP_HEIGHT); connect(m_mouseLeaveTimer, &QTimer::timeout, this, &PreviewContainer::checkMouseLeave, Qt::QueuedConnection); @@ -62,13 +61,11 @@ PreviewContainer::PreviewContainer(QWidget *parent) void PreviewContainer::setWindowInfos(const WindowInfoMap &infos, const WindowList &allowClose) { // check removed window - for (auto it(m_snapshots.begin()); it != m_snapshots.end();) - { + for (auto it(m_snapshots.begin()); it != m_snapshots.end();) { //初始化预览界面边距 it.value()->setContentsMargins(0, 0, 0, 0); - if (!infos.contains(it.key())) - { + if (!infos.contains(it.key())) { m_windowListLayout->removeWidget(it.value()); it.value()->deleteLater(); it = m_snapshots.erase(it); @@ -77,8 +74,7 @@ void PreviewContainer::setWindowInfos(const WindowInfoMap &infos, const WindowLi } } - for (auto it(infos.cbegin()); it != infos.cend(); ++it) - { + for (auto it(infos.cbegin()); it != infos.cend(); ++it) { const WId key = it.key(); if (!m_snapshots.contains(key)) appendSnapWidget(key); @@ -86,9 +82,10 @@ void PreviewContainer::setWindowInfos(const WindowInfoMap &infos, const WindowLi m_snapshots[key]->setCloseAble(allowClose.contains(key)); } - if (m_snapshots.isEmpty()) + if (m_snapshots.isEmpty()) { emit requestCancelPreviewWindow(); emit requestHidePopup(); + } adjustSize(); } @@ -140,41 +137,43 @@ void PreviewContainer::adjustSize() { const int count = m_snapshots.size(); const bool composite = m_wmHelper->hasComposite(); - if (!composite) - { + + if (composite) { + // 3D + const QRect r = qApp->primaryScreen()->geometry(); + const int padding = 20; + + const bool horizontal = m_windowListLayout->direction() == QBoxLayout::LeftToRight; + if (horizontal) { + const int h = SNAP_HEIGHT + MARGIN * 2; + const int w = SNAP_WIDTH * count + MARGIN * 2 + SPACING * (count - 1); + + setFixedHeight(h); + setFixedWidth(std::min(w, r.width() - padding)); + } else { + const int w = SNAP_WIDTH + MARGIN * 2; + const int h = SNAP_HEIGHT * count + MARGIN * 2 + SPACING * (count - 1); + + setFixedWidth(w); + setFixedHeight(std::min(h, r.height() - padding)); + } + } else if (m_windowListLayout->count()) { + // 2D const int h = SNAP_HEIGHT_WITHOUT_COMPOSITE * count + MARGIN * 2 + SPACING * (count - 1); - //根据appitem title 设置自适应宽度 - auto appSnapshot = static_cast(this->layout()->itemAt(0)->widget()); + // 根据appitem title 设置自适应宽度 + auto appSnapshot = static_cast(m_windowListLayout->itemAt(0)->widget()); + auto font = appSnapshot->layout()->itemAt(0)->widget()->font(); QFontMetrics fontMetrics(font); - const int fontSize = fontMetrics.boundingRect(appSnapshot->title()).width(); - //预留字体到边缘的间距,边缘距离10px,关闭按钮24px - if (fontSize < SNAP_WIDTH - 44) - setFixedSize(fontSize + 44, h); - else + const int titleWidth = fontMetrics.boundingRect(appSnapshot->title()).width(); + // 关闭按键的宽度和边缘间距的和,调整标题居中 + const int closeBtnMargin = 2 * (SNAP_CLOSE_BTN_WIDTH + SNAP_CLOSE_BTN_MARGIN); + if (titleWidth < SNAP_WIDTH - closeBtnMargin) { + setFixedSize(titleWidth + closeBtnMargin, h); + } else { setFixedSize(SNAP_WIDTH, h); - - return; - } - - const QRect r = qApp->primaryScreen()->geometry(); - const int padding = 20; - - const bool horizontal = m_windowListLayout->direction() == QBoxLayout::LeftToRight; - if (horizontal) - { - const int h = SNAP_HEIGHT + MARGIN * 2; - const int w = SNAP_WIDTH * count + MARGIN * 2 + SPACING * (count - 1); - - setFixedHeight(h); - setFixedWidth(std::min(w, r.width() - padding)); - } else { - const int w = SNAP_WIDTH + MARGIN * 2; - const int h = SNAP_HEIGHT * count + MARGIN * 2 + SPACING * (count - 1); - - setFixedWidth(w); - setFixedHeight(std::min(h, r.height() - padding)); + } } } @@ -185,7 +184,7 @@ void PreviewContainer::appendSnapWidget(const WId wid) connect(snap, &AppSnapshot::clicked, this, &PreviewContainer::onSnapshotClicked, Qt::QueuedConnection); connect(snap, &AppSnapshot::entered, this, &PreviewContainer::previewEntered, Qt::QueuedConnection); connect(snap, &AppSnapshot::requestCheckWindow, this, &PreviewContainer::requestCheckWindows, Qt::QueuedConnection); - connect(snap, &AppSnapshot::requestCloseAppSnapshot, this, [this](){ + connect(snap, &AppSnapshot::requestCloseAppSnapshot, this, [this]() { if (!m_wmHelper->hasComposite()) return ; @@ -281,7 +280,7 @@ void PreviewContainer::previewEntered(const WId wid) void PreviewContainer::previewFloating() { - if(!m_waitForShowPreviewTimer->isActive()){ + if (!m_waitForShowPreviewTimer->isActive()) { m_floatingPreview->setVisible(true); m_floatingPreview->raise(); diff --git a/frame/item/dockitem.h b/frame/item/dockitem.h index 95a082a08..8dc9d568a 100644 --- a/frame/item/dockitem.h +++ b/frame/item/dockitem.h @@ -67,6 +67,7 @@ public slots: void showPopupApplet(QWidget *const applet); void hidePopup(); virtual void setDraging(bool bDrag); + virtual void checkEntry() {} bool isDragging(); signals: diff --git a/frame/main.cpp b/frame/main.cpp index b244884f0..0c63c038a 100644 --- a/frame/main.cpp +++ b/frame/main.cpp @@ -54,7 +54,6 @@ DCORE_USE_NAMESPACE DUTIL_USE_NAMESPACE #endif -const int MAX_STACK_FRAMES = 128; const QString g_cfgPath = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation)[0] + "/dde-cfg.ini"; using namespace std; @@ -64,15 +63,14 @@ bool IsSaveMode() QSettings settings(g_cfgPath, QSettings::IniFormat); settings.beginGroup(qApp->applicationName()); int collapseNum = settings.value("collapse").toInt(); - - // 自动进入安全模式 + /* 崩溃次数达到3次,进入安全模式(不加载插件) */ if (collapseNum >= 3) { + settings.remove(""); // 删除记录的数据 settings.setValue("collapse", 0); settings.endGroup(); settings.sync(); return true; } - return false; } @@ -95,16 +93,38 @@ bool IsSaveMode() QSettings settings(g_cfgPath, QSettings::IniFormat); settings.beginGroup("dde-dock"); - QDateTime lastDate = QDateTime::fromString(settings.value("lastDate").toString(), "yyyy-MM-dd hh:mm:ss:zzz"); int collapseNum = settings.value("collapse").toInt(); - - // 10秒以内发生崩溃则累加,记录到文件中 - if (qAbs(lastDate.secsTo(QDateTime::currentDateTime())) < 10) { - settings.setValue("collapse", collapseNum + 1); - } else { - settings.setValue("collapse", 0); + /* 第一次崩溃或进入安全模式后的第一次崩溃,将时间重置 */ + if (collapseNum == 0) { + settings.setValue("first_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); } - settings.setValue("lastDate", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + QDateTime lastDate = QDateTime::fromString(settings.value("first_time").toString(), "yyyy-MM-dd hh:mm:ss:zzz"); + /* 将当前崩溃时间与第一次崩溃时间比较,小于9分钟,记录一次崩溃;大于9分钟,覆盖之前的崩溃时间 */ + if (qAbs(lastDate.secsTo(QDateTime::currentDateTime())) < 9 * 60) { + settings.setValue("collapse", collapseNum + 1); + switch (collapseNum) { + case 0: + settings.setValue("first_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + break; + case 1: + settings.setValue("second_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + break; + case 2: + settings.setValue("third_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + break; + default: + qDebug() << "Error, the collapse is wrong!"; + break; + } + } else { + if (collapseNum == 2){ + settings.setValue("first_time", settings.value("second_time").toString()); + settings.setValue("second_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + } else { + settings.setValue("first_time", QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss:zzz")); + } + } + settings.endGroup(); settings.sync(); @@ -128,38 +148,6 @@ bool IsSaveMode() + QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss:zzz]") + "[crash signal number:" + QString::number(sig) + "]\n"; file->write(head.toUtf8()); - -#ifdef Q_OS_LINUX - void *array[MAX_STACK_FRAMES]; - size_t size = 0; - char **strings = nullptr; - size_t i; - signal(sig, SIG_DFL); - size = static_cast(backtrace(array, MAX_STACK_FRAMES)); - strings = backtrace_symbols(array, int(size)); - for (i = 0; i < size; ++i) { - QString line = QString::number(i) + " " + QString::fromStdString(strings[i]) + "\n"; - file->write(line.toUtf8()); - - std::string symbol(strings[i]); - QString strSymbol = QString::fromStdString(symbol); - int pos1 = strSymbol.indexOf("["); - int pos2 = strSymbol.lastIndexOf("]"); - QString address = strSymbol.mid(pos1 + 1,pos2 - pos1 - 1); - - // 按照内存地址找到对应代码的行号 - QString cmd = "addr2line -C -f -e " + qApp->applicationName() + " " + address; - QProcess *p = new QProcess; - p->setReadChannel(QProcess::StandardOutput); - p->start(cmd); - p->waitForFinished(); - p->waitForReadyRead(); - file->write(p->readAllStandardOutput()); - delete p; - p = nullptr; - } - free(strings); -#endif // __linux } catch (...) { // } @@ -180,7 +168,6 @@ int main(int argc, char *argv[]) DockApplication app(argc, argv); //崩溃信号 - signal(SIGTERM, sig_crash); signal(SIGSEGV, sig_crash); signal(SIGILL, sig_crash); signal(SIGINT, sig_crash); @@ -243,6 +230,9 @@ int main(int argc, char *argv[]) if (!IsSaveMode() && !parser.isSet(disablePlugOption)) { DockItemManager::instance()->startLoadPlugins(); + qApp->setProperty("PLUGINSLOADED", true); + } else { + mw.sendNotifications(); } return app.exec(); diff --git a/frame/panel/mainpanelcontrol.cpp b/frame/panel/mainpanelcontrol.cpp index 1771a5910..5997bde30 100755 --- a/frame/panel/mainpanelcontrol.cpp +++ b/frame/panel/mainpanelcontrol.cpp @@ -351,6 +351,7 @@ void MainPanelControl::insertItem(int index, DockItem *item) QTimer::singleShot(0, [ = ] { updatePluginsLayout(); }); + item->checkEntry(); } void MainPanelControl::removeItem(DockItem *item) @@ -684,8 +685,9 @@ void MainPanelControl::mousePressEvent(QMouseEvent *e) QWidget::mousePressEvent(e); } -void MainPanelControl::startDrag(DockItem *item) +void MainPanelControl::startDrag(DockItem *dockItem) { + QPointer item = dockItem; const QPixmap pixmap = item->grab(); item->setDraging(true); @@ -699,18 +701,7 @@ void MainPanelControl::startDrag(DockItem *item) connect(m_appDragWidget, &AppDragWidget::destroyed, this, [ = ] { m_appDragWidget = nullptr; - }); - - connect(m_appDragWidget, &AppDragWidget::requestRemoveItem, this, [ = ] { - if (-1 != m_appAreaSonLayout->indexOf(item)) { - m_dragIndex = m_appAreaSonLayout->indexOf(item); - removeItem(item); - } - }); - - connect(m_appDragWidget, &AppDragWidget::animationFinished, this, [ = ] { - m_appDragWidget = nullptr; - if (qobject_cast(item)->isValid()) { + if (!item.isNull() && qobject_cast(item)->isValid()) { if (-1 == m_appAreaSonLayout->indexOf(item) && m_dragIndex != -1) { insertItem(m_dragIndex, item); m_dragIndex = -1; @@ -720,6 +711,13 @@ void MainPanelControl::startDrag(DockItem *item) } }); + connect(m_appDragWidget, &AppDragWidget::requestRemoveItem, this, [ = ] { + if (-1 != m_appAreaSonLayout->indexOf(item)) { + m_dragIndex = m_appAreaSonLayout->indexOf(item); + removeItem(item); + } + }); + appDrag->appDragWidget()->setOriginPos((m_appAreaSonWidget->mapToGlobal(item->pos()))); appDrag->appDragWidget()->setDockInfo(m_position, QRect(mapToGlobal(pos()), size())); const QPixmap &dragPix = qobject_cast(item)->appIcon(); @@ -1093,8 +1091,10 @@ void MainPanelControl::calcuDockIconSize(int w, int h, PluginsItem *trashPlugin, if (layout) { PluginsItem *pItem = static_cast(layout->itemAt(0)->widget()); if (pItem) { - if (pItem->sizeHint().width() == -1) { + if (pItem->sizeHint().height() == -1) { pItem->setFixedSize(tray_item_size, tray_item_size); + } else if (pItem->sizeHint().height() > height()) { + pItem->resize(pItem->width(), height()); } } } @@ -1108,6 +1108,8 @@ void MainPanelControl::calcuDockIconSize(int w, int h, PluginsItem *trashPlugin, if (pItem) { if (pItem->sizeHint().width() == -1) { pItem->setFixedSize(tray_item_size, tray_item_size); + } else if (pItem->sizeHint().width() > width()) { + pItem->resize(width(), pItem->height()); } } } diff --git a/frame/util/multiscreenworker.cpp b/frame/util/multiscreenworker.cpp index d5a0a93f0..ea8e51c9b 100644 --- a/frame/util/multiscreenworker.cpp +++ b/frame/util/multiscreenworker.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2018 ~ 2028 Deepin Technology Co., Ltd. * * Author: fanpengcheng @@ -207,6 +207,7 @@ void MultiScreenWorker::handleDbusSignal(QDBusMessage msg) m_screenRawWidth = m_displayInter->screenWidth(); } } + updateScreenSize(); } } @@ -735,78 +736,72 @@ void MultiScreenWorker::onRequestUpdateFrontendGeometry() emit requestUpdateDockEntry(); } +/** + * @brief 这里用到xcb去设置任务栏的高度,比较特殊,参考_NET_WM_STRUT_PARTIAL属性 + * 在屏幕旋转后,所有参数以控制中心自定义设置里主屏显示的图示为准(旋转不用特殊处理) + */ void MultiScreenWorker::onRequestNotifyWindowManager() { static QRect lastRect = QRect(); + static int lastScreenWith = 0; + static int lastScreenHeight = 0; - const auto ratio = qApp->devicePixelRatio(); - QRect rect; - if (m_hideMode == HideMode::KeepShowing) { - rect = getDockShowGeometry(m_ds.current(), m_position, m_displayMode); - } else { - rect = getDockHideGeometry(m_ds.current(), m_position, m_displayMode); - } - - // 已经设置过了,避免重复设置 - if (rect == lastRect) - return; - lastRect = rect; - qDebug() << "dock geometry:" << rect; - - // 先清除原先的窗管任务栏区域 - XcbMisc::instance()->clear_strut_partial(xcb_window_t(parent()->winId())); - - // 在副屏时,且为一直显示时,不要挤占应用,这是sp3的新需求 - if (m_ds.current() != m_ds.primary() && m_hideMode == HideMode::KeepShowing) { + /* 在非主屏或非一直显示状态时,清除任务栏区域,不挤占应用 */ + if (m_ds.current() != m_ds.primary() || m_hideMode != HideMode::KeepShowing) { lastRect = QRect(); - qDebug() << "don`t set dock area"; + XcbMisc::instance()->clear_strut_partial(xcb_window_t(parent()->winId())); return; } - // 除了"一直显示"模式,其他的都不要设置任务栏区域 - if (m_hideMode != Dock::KeepShowing) { - lastRect = QRect(); + QRect dockGeometry = getDockShowGeometry(m_ds.current(), m_position, m_displayMode, true); + if (lastRect == dockGeometry && lastScreenWith == m_screenRawWidth && lastScreenHeight == m_screenRawHeight) { return; } + lastRect = dockGeometry; + lastScreenWith = m_screenRawWidth; + lastScreenHeight = m_screenRawHeight; + qDebug() << "dock real geometry:" << dockGeometry; + qDebug() << "screen width:" << m_screenRawWidth << ", height:" << m_screenRawHeight; - const QPoint &p = rawXPosition(rect.topLeft()); - qDebug() << "dock topLeft position:" << p; - - QScreen const *currentScreen = Utils::screenAtByScaled(rect.topLeft()); + const qreal ratio = qApp->devicePixelRatio(); XcbMisc::Orientation orientation = XcbMisc::OrientationTop; - uint strut = 0; - uint strutStart = 0; - uint strutEnd = 0; + double strut = 0; + double strutStart = 0; + double strutEnd = 0; switch (m_position) { case Position::Top: orientation = XcbMisc::OrientationTop; - strut = p.y() + rect.height() * ratio; - strutStart = p.x(); - strutEnd = qMin(qRound(p.x() + rect.width() * ratio), rect.right()); + strut = dockGeometry.y() + dockGeometry.height(); + strutStart = dockGeometry.x(); + strutEnd = qMin(dockGeometry.x() + dockGeometry.width(), dockGeometry.right()); break; case Position::Bottom: orientation = XcbMisc::OrientationBottom; - strut = currentScreen->geometry().height() * ratio - p.y(); - strutStart = p.x(); - strutEnd = qMin(qRound(p.x() + rect.width() * ratio), rect.right()); + strut = m_screenRawHeight - dockGeometry.y(); + strutStart = dockGeometry.x(); + strutEnd = qMin(dockGeometry.x() + dockGeometry.width(), dockGeometry.right()); break; case Position::Left: orientation = XcbMisc::OrientationLeft; - strut = p.x() + rect.width() * ratio; - strutStart = p.y(); - strutEnd = qMin(qRound(p.y() + rect.height() * ratio), rect.bottom()); + strut = dockGeometry.x() + dockGeometry.width(); + strutStart = dockGeometry.y(); + strutEnd = qMin(dockGeometry.y() + dockGeometry.height(), dockGeometry.bottom()); break; case Position::Right: orientation = XcbMisc::OrientationRight; - strut = currentScreen->geometry().width() * ratio - p.x(); - strutStart = p.y(); - strutEnd = qMin(qRound(p.y() + rect.height() * ratio), rect.bottom()); + strut = m_screenRawWidth - dockGeometry.x(); + strutStart = dockGeometry.y(); + strutEnd = qMin(dockGeometry.y() + dockGeometry.height(), dockGeometry.bottom()); break; } - qDebug() << "set dock geometry to xcb:" << strut << strutStart << strutEnd; - XcbMisc::instance()->set_strut_partial(parent()->winId(), orientation, strut + WINDOWMARGIN * ratio, strutStart, strutEnd); + + qDebug() << "set reserved area to xcb:" << strut << strutStart << strutEnd; + XcbMisc::instance()->set_strut_partial(static_cast(parent()->winId()), orientation, + static_cast(strut + WINDOWMARGIN * ratio), // 设置窗口与屏幕边缘距离,需要乘缩放 + static_cast(strutStart), // 设置任务栏起点坐标(上下为x,左右为y) + static_cast(strutEnd)); // 设置任务栏终点坐标(上下为x,左右为y) } void MultiScreenWorker::onRequestUpdatePosition(const Position &fromPos, const Position &toPos) @@ -1092,6 +1087,7 @@ void MultiScreenWorker::initDBus() m_screenRawWidth = m_displayInter->screenWidth(); m_ds = DockScreen(m_displayInter->primary()); m_mtrInfo.setPrimary(m_displayInter->primary()); + updateScreenSize(); } } @@ -1550,82 +1546,47 @@ MainWindow *MultiScreenWorker::parent() return static_cast(m_parent); } +/** + * @brief 获取任务栏显示时的参数。目前多屏情况下缩放保持一致,如果后续缩放规则修改,这里需要重新调整 + * + * @param screenName 当前屏幕名字 + * @param pos 任务栏位置 + * @param displaymode 任务栏显示模式 + * @param withoutScale 是否考虑缩放(true:获取的是真实值; false:获取的是前端认为的值(默认)) + * @return QRect 任务栏参数 + */ QRect MultiScreenWorker::getDockShowGeometry(const QString &screenName, const Position &pos, const DisplayMode &displaymode, bool withoutScale) { - //!!! 注意,目前双屏情况下缩放保持一致,不会出现两个屏幕的缩放不一致的情况,如果后面出现了,那么这里可能会有问题 - const qreal scale = qApp->devicePixelRatio(); QRect rect; - if (withoutScale) {//后端真实大小 - foreach (Monitor *inter, m_mtrInfo.validMonitor()) { - if (inter->name() == screenName) { - // windowSizeFashion和windowSizeEfficient给出的值始终对应前端认为的界面高度或宽度(受缩放影响) - const int dockSize = int(displaymode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() : m_dockInter->windowSizeEfficient()) * scale; - switch (static_cast(pos)) { - case Top: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(inter->w() - 2 * WINDOWMARGIN); - rect.setHeight(dockSize); - } + const double ratio = withoutScale ? 1 : qApp->devicePixelRatio(); + const int margin = static_cast((displaymode == DisplayMode::Fashion ? 10 : 0) * (withoutScale ? qApp->devicePixelRatio() : 1)); + const int dockSize = static_cast((displaymode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() : m_dockInter->windowSizeEfficient()) * (withoutScale ? qApp->devicePixelRatio() : 1)); + for (Monitor *monitor : m_mtrInfo.validMonitor()) { + if (monitor->name() == screenName) { + switch (pos) { + case Position::Top: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(static_cast(monitor->w() / ratio - 2 * margin)); + rect.setHeight(dockSize); break; - case Bottom: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + inter->h() - WINDOWMARGIN - dockSize); - rect.setWidth(inter->w() - 2 * WINDOWMARGIN); - rect.setHeight(dockSize); - } + case Position::Bottom: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + monitor->h() / ratio - margin - dockSize)); + rect.setWidth(static_cast(monitor->w() / ratio - 2 * margin)); + rect.setHeight(dockSize); break; - case Left: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(dockSize); - rect.setHeight(inter->h() - 2 * WINDOWMARGIN); - } + case Position::Left: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(dockSize); + rect.setHeight(static_cast(monitor->h() / ratio - 2 * margin)); break; - case Right: { - rect.setX(inter->x() + inter->w() - WINDOWMARGIN - dockSize); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(dockSize); - rect.setHeight(inter->h() - 2 * WINDOWMARGIN); - } - } - break; - } - } - } else {//前端真实大小 - foreach (Monitor *inter, m_mtrInfo.validMonitor()) { - if (inter->name() == screenName) { - // windowSizeFashion和windowSizeEfficient给出的值始终对应前端认为的界面高度或宽度(受缩放影响) - const int dockSize = int(displaymode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() : m_dockInter->windowSizeEfficient()); - switch (static_cast(pos)) { - case Top: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(inter->w() / scale - 2 * WINDOWMARGIN); - rect.setHeight(dockSize); - } - break; - case Bottom: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + inter->h() / scale - WINDOWMARGIN - dockSize); - rect.setWidth(inter->w() / scale - 2 * WINDOWMARGIN); - rect.setHeight(dockSize); - } - break; - case Left: { - rect.setX(inter->x() + WINDOWMARGIN); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(dockSize); - rect.setHeight(inter->h() / scale - 2 * WINDOWMARGIN); - } - break; - case Right: { - rect.setX(inter->x() + inter->w() / scale - WINDOWMARGIN - dockSize); - rect.setY(inter->y() + WINDOWMARGIN); - rect.setWidth(dockSize); - rect.setHeight(inter->h() / scale - 2 * WINDOWMARGIN); - } - } + case Position::Right: + rect.setX(static_cast(monitor->x() + monitor->w() / ratio - margin - dockSize)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(dockSize); + rect.setHeight(static_cast(monitor->h() / ratio - 2 * margin)); break; } } @@ -1633,83 +1594,47 @@ QRect MultiScreenWorker::getDockShowGeometry(const QString &screenName, const Po return rect; } +/** + * @brief 获取任务栏隐藏时的参数。目前多屏情况下缩放保持一致,如果后续缩放规则修改,这里需要重新调整 + * + * @param screenName 当前屏幕名字 + * @param pos 任务栏位置 + * @param displaymode 任务栏显示模式 + * @param withoutScale 是否考虑缩放(true:获取的是真实值; false:获取的是前端认为的值(默认)) + * @return QRect 任务栏参数 + */ QRect MultiScreenWorker::getDockHideGeometry(const QString &screenName, const Position &pos, const DisplayMode &displaymode, bool withoutScale) { - //!!! 注意,目前双屏情况下缩放保持一致,不会出现两个屏幕的缩放不一致的情况,如果后面出现了,那么这里可能会有问题 - const qreal scale = qApp->devicePixelRatio(); QRect rect; - if (withoutScale) {//后端真实大小 - foreach (Monitor *inter, m_mtrInfo.validMonitor()) { - if (inter->name() == screenName) { - const int margin = (displaymode == DisplayMode::Fashion ? WINDOWMARGIN : 0); - - switch (static_cast(pos)) { - case Top: { - rect.setX(inter->x() + margin); - rect.setY(inter->y()); - rect.setWidth(inter->w() - 2 * margin); - rect.setHeight(0); - } + const double ratio = withoutScale ? 1 : qApp->devicePixelRatio(); + const int margin = static_cast((displaymode == DisplayMode::Fashion ? 10 : 0) * (withoutScale ? qApp->devicePixelRatio() : 1)); + for (Monitor *monitor : m_mtrInfo.validMonitor()) { + if (monitor->name() == screenName) { + switch (pos) { + case Position::Top: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(static_cast(monitor->w() / ratio - 2 * margin)); + rect.setHeight(0); break; - case Bottom: { - rect.setX(inter->x() + margin); - rect.setY(inter->y() + inter->h()); - rect.setWidth(inter->w() - 2 * margin); - rect.setHeight(0); - } + case Position::Bottom: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + monitor->h() / ratio - margin)); + rect.setWidth(static_cast(monitor->w() / ratio - 2 * margin)); + rect.setHeight(0); break; - case Left: { - rect.setX(inter->x()); - rect.setY(inter->y() + margin); - rect.setWidth(0); - rect.setHeight(inter->h() - 2 * margin); - } + case Position::Left: + rect.setX(static_cast(monitor->x() + margin)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(0); + rect.setHeight(static_cast(monitor->h() / ratio - 2 * margin)); break; - case Right: { - rect.setX(inter->x() + inter->w()); - rect.setY(inter->y() + margin); - rect.setWidth(0); - rect.setHeight(inter->h() - 2 * margin); - } + case Position::Right: + rect.setX(static_cast(monitor->x() + monitor->w() / ratio - margin)); + rect.setY(static_cast(monitor->y() + margin)); + rect.setWidth(0); + rect.setHeight(static_cast(monitor->h() / ratio - 2 * margin)); break; - } - } - } - } else {//前端真实大小 - foreach (Monitor *inter, m_mtrInfo.validMonitor()) { - if (inter->name() == screenName) { - const int margin = (displaymode == DisplayMode::Fashion ? WINDOWMARGIN : 0); - - switch (static_cast(pos)) { - case Top: { - rect.setX(inter->x() + margin); - rect.setY(inter->y()); - rect.setWidth(inter->w() / scale - 2 * margin); - rect.setHeight(0); - } - break; - case Bottom: { - rect.setX(inter->x() + margin); - rect.setY(inter->y() + inter->h() / scale); - rect.setWidth(inter->w() / scale - 2 * margin); - rect.setHeight(0); - } - break; - case Left: { - rect.setX(inter->x()); - rect.setY(inter->y() + margin); - rect.setWidth(0); - rect.setHeight(inter->h() / scale - 2 * margin); - } - break; - case Right: { - rect.setX(inter->x() + inter->w() / scale); - rect.setY(inter->y() + margin); - rect.setWidth(0); - rect.setHeight(inter->h() / scale - 2 * margin); - } - break; - } } } } @@ -1795,6 +1720,40 @@ const QPoint MultiScreenWorker::rawXPosition(const QPoint &scaledPos) : scaledPos; } +/** + * @brief 通过 xcb 获取屏幕的宽高。 + * display 服务中获取的屏幕宽高在旋转屏幕的特殊场景下会出错(宽高写反了),故通过这个方法修正, + * 后续 display 服务的数据正常后,这个方法可以用于异常处理时的备选方案。 + */ +void MultiScreenWorker::updateScreenSize() +{ + /* Open the connection to the X server. Use the DISPLAY environment variable */ + int screenNum; + xcb_connection_t *connection = xcb_connect(NULL, &screenNum); + + /* Check for failure */ + if (xcb_connection_has_error(connection)) { + xcb_disconnect(connection); + return; + } + + /* Get the screen whose number is screenNum */ + const xcb_setup_t *setup = xcb_get_setup(connection); + xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup); + + /* we want the screen at index screenNum of the iterator */ + for (int i = 0; i < screenNum; ++i) { + xcb_screen_next(&iter); + } + + xcb_screen_t *screen = iter.data; + + m_screenRawWidth = screen->width_in_pixels; + m_screenRawHeight = screen->height_in_pixels; + + xcb_disconnect(connection); +} + void MultiScreenWorker::onTouchPress(int type, int x, int y, const QString &key) { Q_UNUSED(type); diff --git a/frame/util/multiscreenworker.h b/frame/util/multiscreenworker.h index e5b9468cd..9ea51a35d 100644 --- a/frame/util/multiscreenworker.h +++ b/frame/util/multiscreenworker.h @@ -436,14 +436,7 @@ private: void checkXEventMonitorService(); MainWindow *parent(); - /** - * @brief getDockShowGeometry 获取任务栏显示时的位置 - * @param screenName 当前屏幕名 - * @param pos 任务栏位置 - * @param displaymode 显示模式 - * @param real 接口是否计算算法,false为计算,true为不计算(与后端接口大小的形式保持一致.比如,后端给出的屏幕大小是不计算缩放的) - * @return - */ + QRect getDockShowGeometry(const QString &screenName, const Position &pos, const DisplayMode &displaymode, bool withoutScale = false); QRect getDockHideGeometry(const QString &screenName, const Position &pos, const DisplayMode &displaymode, bool withoutScale = false); @@ -454,6 +447,7 @@ private: bool contains(const MonitRect &rect, const QPoint &pos); bool contains(const QList &rectList, const QPoint &pos); const QPoint rawXPosition(const QPoint &scaledPos); + void updateScreenSize(); private: QWidget *m_parent; @@ -490,7 +484,7 @@ private: //当前屏幕的方向 int m_monitorRotation; //当前屏幕的所有方向 - RotationList m_rotations; + RotationList m_rotations; // 逆时针旋转(向下,向右,向上,向左) /***************不和其他流程产生交互,尽量不要动这里的变量***************/ int m_screenRawHeight; diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index 4dc1dd8b2..30333c7e9 100755 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -187,6 +187,16 @@ void MainWindow::callShow() }); } +void MainWindow::relaodPlugins() +{ + if (qApp->property("PLUGINSLOADED").toBool()) { + return; + } + + DockItemManager::instance()->startLoadPlugins(); + qApp->setProperty("PLUGINSLOADED", true); +} + void MainWindow::showEvent(QShowEvent *e) { QWidget::showEvent(e); @@ -371,6 +381,7 @@ void MainWindow::adjustShadowMask() } m_platformWindowHandle.setWindowRadius(radius); + m_mainPanel->updatePluginsLayout(); } void MainWindow::onDbusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner) @@ -557,13 +568,38 @@ void MainWindow::touchRequestResizeDock() void MainWindow::setGeometry(const QRect &rect) { - static QRect lastRect; - if (lastRect == rect) { + if (rect == this->geometry()) { return; } - lastRect = rect; DBlurEffectWidget::setGeometry(rect); emit panelGeometryChanged(); } +/** + * @brief 当进入安全模式时,通过此方法发送通知告知用户 + */ +void MainWindow::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"); + QTimer::singleShot(0, this, [=] { + DDBusSender() + .service("com.deepin.dde.Notification") + .path("/com/deepin/dde/Notification") + .interface("com.deepin.dde.Notification") + .method(QString("Notify")) + .arg(QString("dde-control-center")) // appname + .arg(static_cast(0)) // id + .arg(QString("preferences-system")) // icon + .arg(QString(tr("Dock - Safe Mode"))) // summary + .arg(QString(tr("The Dock is in safe mode, please exit to show it properly"))) // content + .arg(actionButton) // actions + .arg(hints) // hints + .arg(15000) // timeout + .call(); + }); +} + #include "mainwindow.moc" diff --git a/frame/window/mainwindow.h b/frame/window/mainwindow.h index 67f917241..c514d0e87 100644 --- a/frame/window/mainwindow.h +++ b/frame/window/mainwindow.h @@ -122,6 +122,7 @@ public: void setEffectEnabled(const bool enabled); void setComposite(const bool hasComposite); void setGeometry(const QRect &rect); + void sendNotifications(); friend class MainPanel; friend class MainPanelControl; @@ -131,6 +132,7 @@ public: public slots: void launch(); void callShow(); + void relaodPlugins(); private: using QWidget::show; diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index a02a5d8ab..58323d5c7 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -24,6 +24,7 @@ #include "componments/adapter.h" #include "bluetoothapplet.h" #include "bluetoothconstants.h" +#include "refreshbutton.h" #include #include @@ -121,6 +122,7 @@ BluetoothAdapterItem::BluetoothAdapterItem(Adapter *adapter, QWidget *parent) , m_adapterStateBtn(new DSwitchButton(this)) , m_deviceListview(new DListView(this)) , m_deviceModel(new QStandardItemModel(m_deviceListview)) + , m_refreshBtn(new RefreshButton(this)) { initData(); initUi(); @@ -162,6 +164,15 @@ void BluetoothAdapterItem::onAdapterNameChanged(const QString name) m_adapterLabel->label()->setText(name); } +void BluetoothAdapterItem::updateIconTheme(DGuiApplicationHelper::ColorType type) +{ + if (type == DGuiApplicationHelper::LightType) { + m_refreshBtn->setRotateIcon(":/wireless/resources/wireless/refresh_dark.svg"); + } else { + m_refreshBtn->setRotateIcon(":/wireless/resources/wireless/refresh.svg"); + } +} + int BluetoothAdapterItem::currentDeviceCount() { return m_deviceItems.size(); @@ -222,10 +233,14 @@ void BluetoothAdapterItem::onDeviceRemoved(const Device *device) void BluetoothAdapterItem::initUi() { + m_refreshBtn->setFixedSize(24, 24); + m_refreshBtn->setVisible(m_adapter->powered()); + setAccessibleName(m_adapter->name()); setContentsMargins(0, 0, 0, 0); m_adapterLabel->setFixedSize(ItemWidth, TitleHeight); - m_adapterLabel->addSwichButton(m_adapterStateBtn); + m_adapterLabel->addButton(m_refreshBtn, 0); + m_adapterLabel->addButton(m_adapterStateBtn, 10); DFontSizeManager::instance()->bind(m_adapterLabel->label(), DFontSizeManager::T4); m_adapterStateBtn->setChecked(m_adapter->powered()); @@ -250,16 +265,35 @@ void BluetoothAdapterItem::initUi() mainLayout->addWidget(m_adapterLabel); mainLayout->addSpacing(2); mainLayout->addWidget(m_deviceListview); + + updateIconTheme(DGuiApplicationHelper::instance()->themeType()); + if (m_adapter->discover()) { + m_refreshBtn->startRotate(); + } } void BluetoothAdapterItem::initConnect() { + connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, this, &BluetoothAdapterItem::updateIconTheme); connect(m_adapter, &Adapter::deviceAdded, this, &BluetoothAdapterItem::onDeviceAdded); connect(m_adapter, &Adapter::deviceRemoved, this, &BluetoothAdapterItem::onDeviceRemoved); connect(m_adapter, &Adapter::nameChanged, this, &BluetoothAdapterItem::onAdapterNameChanged); connect(m_deviceListview, &DListView::clicked, this, &BluetoothAdapterItem::onConnectDevice); + connect(m_adapter, &Adapter::discoveringChanged, this, [ = ] (bool state) { + if (state) { + m_refreshBtn->startRotate(); + } else { + m_refreshBtn->stopRotate(); + } + }); + + connect(m_refreshBtn, &RefreshButton::clicked, this, [ = ] { + emit requestRefreshAdapter(m_adapter); + }); + connect(m_adapter, &Adapter::poweredChanged, this, [ = ] (bool state) { initData(); + m_refreshBtn->setVisible(state); m_deviceListview->setVisible(state); m_adapterStateBtn->setChecked(state); m_adapterStateBtn->setEnabled(true); @@ -271,6 +305,7 @@ void BluetoothAdapterItem::initConnect() m_deviceModel->clear(); m_deviceListview->setVisible(false); m_adapterStateBtn->setEnabled(false); + m_refreshBtn->setVisible(state); emit requestSetAdapterPower(m_adapter, state); }); } diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.h b/plugins/bluetooth/componments/bluetoothadapteritem.h index 699eb4a09..3bd61f3fb 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.h +++ b/plugins/bluetooth/componments/bluetoothadapteritem.h @@ -42,6 +42,7 @@ DWIDGET_END_NAMESPACE class Adapter; class SettingLabel; class QStandardItemModel; +class RefreshButton; const QString LightString = QString(":/light/buletooth_%1_light.svg"); const QString DarkString = QString(":/dark/buletooth_%1_dark.svg"); @@ -101,10 +102,12 @@ public slots: void onTopDeviceItem(DStandardItem* item); // 设置蓝牙适配器名称 void onAdapterNameChanged(const QString name); + void updateIconTheme(DGuiApplicationHelper::ColorType type); signals: void adapterPowerChanged(); void requestSetAdapterPower(Adapter *adapter, bool state); + void requestRefreshAdapter(Adapter *adapter); void connectDevice(const Device *device, Adapter *adapter); void deviceCountChanged(); void deviceStateChanged(const Device* device); @@ -119,6 +122,7 @@ private: DSwitchButton *m_adapterStateBtn = nullptr; DListView *m_deviceListview = nullptr; QStandardItemModel *m_deviceModel = nullptr; + RefreshButton *m_refreshBtn = nullptr; QMap m_deviceItems; }; diff --git a/plugins/bluetooth/componments/bluetoothapplet.cpp b/plugins/bluetooth/componments/bluetoothapplet.cpp index afbb5628c..2e163ac8f 100644 --- a/plugins/bluetooth/componments/bluetoothapplet.cpp +++ b/plugins/bluetooth/componments/bluetoothapplet.cpp @@ -50,12 +50,13 @@ SettingLabel::SettingLabel(QString text, QWidget *parent) m_layout->setMargin(0); m_layout->addSpacing(20); m_layout->addWidget(m_label, 0, Qt::AlignLeft | Qt::AlignHCenter); + m_layout->addStretch(); } -void SettingLabel::addSwichButton(DSwitchButton *button) +void SettingLabel::addButton(QWidget *button, int space) { m_layout->addWidget(button, 0, Qt::AlignRight | Qt::AlignHCenter); - m_layout->addSpacing(10); + m_layout->addSpacing(space); } void SettingLabel::mousePressEvent(QMouseEvent *ev) @@ -153,6 +154,7 @@ void BluetoothApplet::onAdapterAdded(Adapter *adapter) connect(adapterItem, &BluetoothAdapterItem::deviceCountChanged, this, &BluetoothApplet::updateSize); connect(adapterItem, &BluetoothAdapterItem::adapterPowerChanged, this, &BluetoothApplet::updateBluetoothPowerState); connect(adapterItem, &BluetoothAdapterItem::deviceStateChanged, this, &BluetoothApplet::deviceStateChanged); + connect(adapterItem, &BluetoothAdapterItem::requestRefreshAdapter, m_adaptersManager, &AdaptersManager::adapterRefresh); m_adapterItems.insert(adapter->id(), adapterItem); m_contentLayout->insertWidget(0, adapterItem, Qt::AlignTop | Qt::AlignVCenter); diff --git a/plugins/bluetooth/componments/bluetoothapplet.h b/plugins/bluetooth/componments/bluetoothapplet.h index 94b719052..19e50d773 100644 --- a/plugins/bluetooth/componments/bluetoothapplet.h +++ b/plugins/bluetooth/componments/bluetoothapplet.h @@ -49,7 +49,7 @@ class SettingLabel : public QWidget Q_OBJECT public: explicit SettingLabel(QString text, QWidget *parent = nullptr); - void addSwichButton(DSwitchButton *button); + void addButton(QWidget *button, int space); DLabel *label() { return m_label; } signals: void clicked(); diff --git a/plugins/bluetooth/componments/refreshbutton.cpp b/plugins/bluetooth/componments/refreshbutton.cpp new file mode 100644 index 000000000..b776e2598 --- /dev/null +++ b/plugins/bluetooth/componments/refreshbutton.cpp @@ -0,0 +1,73 @@ +#include "refreshbutton.h" + +#include +#include +#include +#include +#include +#include + +RefreshButton::RefreshButton(QWidget *parent) + : QWidget(parent) + , m_refreshTimer(new QTimer(this)) + , m_rotateAngle(0) +{ + setAccessibleName("RefreshButton"); + m_refreshTimer->setInterval(500 / 60); + initConnect(); +} + +void RefreshButton::setRotateIcon(QString path) +{ + m_pixmap = QIcon(path).pixmap(size()); +} + +void RefreshButton::startRotate() +{ + m_refreshTimer->start(); + if (m_rotateAngle == 360) { + m_rotateAngle = 0; + } + m_rotateAngle += 360 / 60; + update(); +} + +void RefreshButton::stopRotate() +{ + m_refreshTimer->stop(); + m_rotateAngle = 0; + update(); +} + +void RefreshButton::paintEvent(QPaintEvent *e) +{ + QPainter painter(this); + painter.setPen(Qt::NoPen); + painter.setBrush(Qt::NoBrush); + painter.setRenderHint(QPainter::SmoothPixmapTransform); + + painter.translate(this->width() / 2, this->height() / 2); + painter.rotate(m_rotateAngle); + painter.translate(-(this->width() / 2), -(this->height() / 2)); + painter.drawPixmap(this->rect(), m_pixmap); + + QWidget::paintEvent(e); +} + +void RefreshButton::mousePressEvent(QMouseEvent *event) +{ + m_pressPos = event->pos(); + return QWidget::mousePressEvent(event); +} + +void RefreshButton::mouseReleaseEvent(QMouseEvent *event) +{ + if (rect().contains(m_pressPos) && rect().contains(event->pos()) && !m_refreshTimer->isActive()) + Q_EMIT clicked(); + return QWidget::mouseReleaseEvent(event); +} + +void RefreshButton::initConnect() +{ + connect(m_refreshTimer, &QTimer::timeout, this, &RefreshButton::startRotate); +} diff --git a/plugins/bluetooth/componments/refreshbutton.h b/plugins/bluetooth/componments/refreshbutton.h new file mode 100644 index 000000000..a2d637f75 --- /dev/null +++ b/plugins/bluetooth/componments/refreshbutton.h @@ -0,0 +1,34 @@ +#ifndef REFRESHBUTTON_H +#define REFRESHBUTTON_H + +#include + +class QTimer; + +class RefreshButton : public QWidget +{ + Q_OBJECT +public: + explicit RefreshButton(QWidget *parent = nullptr); + void setRotateIcon(QString path); + void startRotate(); + void stopRotate(); + +signals: + void clicked(); + +protected: + void paintEvent(QPaintEvent *e) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + +private: + void initConnect(); + + QTimer *m_refreshTimer; + QPixmap m_pixmap; + QPoint m_pressPos; + int m_rotateAngle; +}; + +#endif // REFRESHBUTTON_H diff --git a/plugins/network/networkitem.cpp b/plugins/network/networkitem.cpp index a9a3d8e64..eca406714 100644 --- a/plugins/network/networkitem.cpp +++ b/plugins/network/networkitem.cpp @@ -477,9 +477,9 @@ void NetworkItem::wiredsEnable(bool enable) for (auto wiredItem : m_wiredItems) { if (wiredItem) { wiredItem->setDeviceEnabled(enable); + wiredItem->setVisible(enable); } } -// updateSelf(); } void NetworkItem::wirelessEnable(bool enable) @@ -492,7 +492,6 @@ void NetworkItem::wirelessEnable(bool enable) wirelessItem->itemApplet()->setVisible(enable); } } - updateSelf(); } void NetworkItem::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) @@ -1113,49 +1112,65 @@ int NetworkItem::getStrongestAp() return retStrength; } +/** + * @brief 更新有线(无线)适配器的开关状态,并根据开关状态显示设备列表。 + */ void NetworkItem::updateMasterControlSwitch() { - bool deviceState = false; - for (auto wirelessItem : m_wirelessItems) { - if (wirelessItem) - if (wirelessItem->deviceEanbled()) { - deviceState = true; - break; - } - } - m_switchWirelessBtn->blockSignals(true); - m_switchWirelessBtn->setChecked(deviceState); - m_loadingIndicator->setVisible(deviceState); - m_switchWirelessBtn->blockSignals(false); - if (deviceState) { - for (auto wirelessItem : m_wirelessItems) { - if (wirelessItem) { - m_wirelessLayout->addWidget(wirelessItem->itemApplet()); - wirelessItem->itemApplet()->setVisible(true); - } - } - } else { - for (auto wirelessItem : m_wirelessItems) { - if (wirelessItem) { - m_wirelessLayout->removeWidget(wirelessItem->itemApplet()); - wirelessItem->itemApplet()->setVisible(false); - } - } - } - m_switchWirelessBtnState = deviceState; + m_switchWiredBtnState = false; + m_switchWirelessBtnState = false; - deviceState = false; - for (auto wiredItem : m_wiredItems) { - if (wiredItem) - if (wiredItem->deviceEabled()) { - deviceState = true; - break; - } + /* 获取有线适配器启用状态 */ + for (WiredItem *wiredItem : m_wiredItems) { + if (wiredItem && wiredItem->deviceEabled()) { + m_switchWiredBtnState = wiredItem->deviceEabled(); + break; + } } + /* 更新有线适配器总开关状态(阻塞信号是为了防止重复设置适配器启用状态)*/ m_switchWiredBtn->blockSignals(true); - m_switchWiredBtn->setChecked(deviceState); + m_switchWiredBtn->setChecked(m_switchWiredBtnState); m_switchWiredBtn->blockSignals(false); - m_switchWiredBtnState = deviceState; + /* 根据有线适配器启用状态增/删布局中的组件 */ + for (WiredItem *wiredItem : m_wiredItems) { + if (!wiredItem) { + continue; + } + if (m_switchWiredBtnState) { + m_wiredLayout->addWidget(wiredItem->itemApplet()); + } else { + m_wiredLayout->removeWidget(wiredItem->itemApplet()); + } + // wiredItem->itemApplet()->setVisible(m_switchWiredBtnState); // TODO + wiredItem->setVisible(m_switchWiredBtnState); + } + + /* 获取无线适配器启用状态 */ + for (auto wirelessItem : m_wirelessItems) { + if (wirelessItem && wirelessItem->deviceEanbled()) { + m_switchWirelessBtnState = wirelessItem->deviceEanbled(); + break; + } + } + /* 更新无线适配器总开关状态(阻塞信号是为了防止重复设置适配器启用状态) */ + m_switchWirelessBtn->blockSignals(true); + m_switchWirelessBtn->setChecked(m_switchWirelessBtnState); + m_switchWirelessBtn->blockSignals(false); + /* 根据无线适配器启用状态增/删布局中的组件 */ + for (WirelessItem *wirelessItem : m_wirelessItems) { + if (!wirelessItem) { + continue; + } + if (m_switchWirelessBtnState) { + m_wirelessLayout->addWidget(wirelessItem->itemApplet()); + } else { + m_wirelessLayout->removeWidget(wirelessItem->itemApplet()); + } + wirelessItem->itemApplet()->setVisible(m_switchWirelessBtnState); + wirelessItem->setVisible(m_switchWirelessBtnState); + } + + m_loadingIndicator->setVisible(m_switchWirelessBtnState || m_switchWiredBtnState); } void NetworkItem::refreshTips() @@ -1220,7 +1235,7 @@ void NetworkItem::refreshTips() const QJsonObject ipv4 = info.value("Ip4").toObject(); if (!ipv4.contains("Address")) continue; - if (m_connectedWiredDevice.size() == 1) { + if (m_connectedWirelessDevice.size() == 1) { strTips = tr("Wireless connection: %1").arg(ipv4.value("Address").toString()) + '\n'; } else { strTips = tr("Wireless Network").append(QString("%1").arg(wirelessIndex++)).append(":"+ipv4.value("Address").toString()) + '\n'; diff --git a/plugins/trash/popupcontrolwidget.cpp b/plugins/trash/popupcontrolwidget.cpp index 12573d236..1fa2aac9f 100644 --- a/plugins/trash/popupcontrolwidget.cpp +++ b/plugins/trash/popupcontrolwidget.cpp @@ -80,7 +80,7 @@ QSize PopupControlWidget::sizeHint() const void PopupControlWidget::openTrashFloder() { - QProcess::startDetached("gio", QStringList() << "open" << "trash:///"); + DDesktopServices::showFolder(QUrl("trash:///")); } void PopupControlWidget::clearTrashFloder() diff --git a/plugins/trash/trashplugin.cpp b/plugins/trash/trashplugin.cpp index 7474f7ee4..1fd74fd00 100644 --- a/plugins/trash/trashplugin.cpp +++ b/plugins/trash/trashplugin.cpp @@ -28,6 +28,7 @@ #include "../../widgets/tipswidget.h" #include +#include #define PLUGIN_STATE_KEY "enable" @@ -110,9 +111,10 @@ QWidget *TrashPlugin::itemPopupApplet(const QString &itemKey) const QString TrashPlugin::itemCommand(const QString &itemKey) { Q_UNUSED(itemKey); + DDesktopServices::showFolder(QUrl("trash:///")); -// return QString(); - return "gio open trash:///"; + return QString(); + // return "gio open trash:///"; } const QString TrashPlugin::itemContextMenu(const QString &itemKey) diff --git a/translations/dde-dock.ts b/translations/dde-dock.ts index 98aeabbea..382988a8d 100644 --- a/translations/dde-dock.ts +++ b/translations/dde-dock.ts @@ -1,4 +1,6 @@ - + + + AbstractPluginsController @@ -151,6 +153,21 @@ Launcher + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker @@ -488,4 +505,4 @@ Wireless Network %1 - \ No newline at end of file + diff --git a/translations/dde-dock_ar.ts b/translations/dde-dock_ar.ts index 853cfd770..8a4616e25 100644 --- a/translations/dde-dock_ar.ts +++ b/translations/dde-dock_ar.ts @@ -151,6 +151,21 @@ المُطلق + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_az.ts b/translations/dde-dock_az.ts index cb1d8a0e1..6181cc7c5 100644 --- a/translations/dde-dock_az.ts +++ b/translations/dde-dock_az.ts @@ -151,6 +151,21 @@ Başladıcı + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_bo.ts b/translations/dde-dock_bo.ts index 1ab44012a..dfc057fc8 100644 --- a/translations/dde-dock_bo.ts +++ b/translations/dde-dock_bo.ts @@ -151,6 +151,21 @@ འགོ་སློང་ཆས། + + MainWindow + + Exit Safe Mode + བདེ་འཇགས་དཔེ་རྣམ་ལས་ཕྱིར་དོན་པ། + + + Dock - Safe Mode + ལས་འགན་ཚན་བྱང་གི་བདེ་འཇགས་དཔེ་རྣམ། + + + The Dock is in safe mode, please exit to show it properly + ལས་འགན་ཚན་བྱང་བདེ་འཇགས་དཔེ་རྣམ་ནང་མཛུལ་ཟིན་པས། བདེ་འཇགས་དཔེ་རྣམ་ལས་ཕྱིར་དོན་རྗེས་རྒྱུན་ལྡན་ལྟར་ཤར་ཐུབ། + + MenuWorker diff --git a/translations/dde-dock_ca.ts b/translations/dde-dock_ca.ts index f5d4c2770..ae5f3f589 100644 --- a/translations/dde-dock_ca.ts +++ b/translations/dde-dock_ca.ts @@ -151,6 +151,21 @@ Llançador + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_cs.ts b/translations/dde-dock_cs.ts index 83855082e..ca1603639 100644 --- a/translations/dde-dock_cs.ts +++ b/translations/dde-dock_cs.ts @@ -151,6 +151,21 @@ Spouštěč + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_da.ts b/translations/dde-dock_da.ts index 131edd9c4..e6595149b 100644 --- a/translations/dde-dock_da.ts +++ b/translations/dde-dock_da.ts @@ -151,6 +151,21 @@ Programstarter + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_de.ts b/translations/dde-dock_de.ts index 8eb7a2c0f..ee1693239 100644 --- a/translations/dde-dock_de.ts +++ b/translations/dde-dock_de.ts @@ -151,6 +151,21 @@ Starter + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_en_AU.ts b/translations/dde-dock_en_AU.ts index 1b1673d18..4e6d40f26 100644 --- a/translations/dde-dock_en_AU.ts +++ b/translations/dde-dock_en_AU.ts @@ -151,6 +151,21 @@ Launcher + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_es.ts b/translations/dde-dock_es.ts index f8f5fae66..50bd6f857 100644 --- a/translations/dde-dock_es.ts +++ b/translations/dde-dock_es.ts @@ -151,6 +151,21 @@ Lanzador + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_fa.ts b/translations/dde-dock_fa.ts index e03fce3ef..370da92e0 100644 --- a/translations/dde-dock_fa.ts +++ b/translations/dde-dock_fa.ts @@ -151,6 +151,21 @@ لانچر + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_fi.ts b/translations/dde-dock_fi.ts index 187c4e1e4..e3d342e08 100644 --- a/translations/dde-dock_fi.ts +++ b/translations/dde-dock_fi.ts @@ -151,6 +151,21 @@ Käynnistin + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_fr.ts b/translations/dde-dock_fr.ts index 531270a94..f73f10e1e 100644 --- a/translations/dde-dock_fr.ts +++ b/translations/dde-dock_fr.ts @@ -151,6 +151,21 @@ Lanceur + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_gl_ES.ts b/translations/dde-dock_gl_ES.ts index 5302f8f44..7ed122a24 100644 --- a/translations/dde-dock_gl_ES.ts +++ b/translations/dde-dock_gl_ES.ts @@ -151,6 +151,21 @@ Lanzador + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_hi_IN.ts b/translations/dde-dock_hi_IN.ts index 54080fabf..154d4270a 100644 --- a/translations/dde-dock_hi_IN.ts +++ b/translations/dde-dock_hi_IN.ts @@ -151,6 +151,21 @@ लॉन्चर + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_hr.ts b/translations/dde-dock_hr.ts index e891a4928..96a07bed1 100644 --- a/translations/dde-dock_hr.ts +++ b/translations/dde-dock_hr.ts @@ -151,6 +151,21 @@ Pokretač + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_hu.ts b/translations/dde-dock_hu.ts index bb0461ac9..58f5246b5 100644 --- a/translations/dde-dock_hu.ts +++ b/translations/dde-dock_hu.ts @@ -151,6 +151,21 @@ Indító + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_it.ts b/translations/dde-dock_it.ts index 6495d8838..12ce9e875 100644 --- a/translations/dde-dock_it.ts +++ b/translations/dde-dock_it.ts @@ -151,6 +151,21 @@ Launcher + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ja.ts b/translations/dde-dock_ja.ts index 30b2324e9..d66833e06 100644 --- a/translations/dde-dock_ja.ts +++ b/translations/dde-dock_ja.ts @@ -151,6 +151,21 @@ ランチャー + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ko.ts b/translations/dde-dock_ko.ts index 6a7e3f201..ca6c3589a 100644 --- a/translations/dde-dock_ko.ts +++ b/translations/dde-dock_ko.ts @@ -151,6 +151,21 @@ 실행도구 + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_lt.ts b/translations/dde-dock_lt.ts index 7dee3fb13..04384f9c4 100644 --- a/translations/dde-dock_lt.ts +++ b/translations/dde-dock_lt.ts @@ -151,6 +151,21 @@ Leistukas + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ms.ts b/translations/dde-dock_ms.ts index ef364edaf..cdf8321d1 100644 --- a/translations/dde-dock_ms.ts +++ b/translations/dde-dock_ms.ts @@ -151,6 +151,21 @@ Pelancar + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_nl.ts b/translations/dde-dock_nl.ts index aa3714247..ceb6ca158 100644 --- a/translations/dde-dock_nl.ts +++ b/translations/dde-dock_nl.ts @@ -151,6 +151,21 @@ Programmastarter + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_pl.ts b/translations/dde-dock_pl.ts index 32d496a64..364301f89 100644 --- a/translations/dde-dock_pl.ts +++ b/translations/dde-dock_pl.ts @@ -151,6 +151,21 @@ Launcher + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_pt.ts b/translations/dde-dock_pt.ts index bb5af1457..b8b610b92 100644 --- a/translations/dde-dock_pt.ts +++ b/translations/dde-dock_pt.ts @@ -151,6 +151,21 @@ Lançador + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_pt_BR.ts b/translations/dde-dock_pt_BR.ts index b7c5229e6..9ad387241 100644 --- a/translations/dde-dock_pt_BR.ts +++ b/translations/dde-dock_pt_BR.ts @@ -151,6 +151,21 @@ Lançador + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ro.ts b/translations/dde-dock_ro.ts index c62dc3bba..2642db4dd 100644 --- a/translations/dde-dock_ro.ts +++ b/translations/dde-dock_ro.ts @@ -151,6 +151,21 @@ Lansator + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ru.ts b/translations/dde-dock_ru.ts index e89add682..306ef5026 100644 --- a/translations/dde-dock_ru.ts +++ b/translations/dde-dock_ru.ts @@ -151,6 +151,21 @@ Выбор Программ + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_si.ts b/translations/dde-dock_si.ts index 38729ccb2..926765562 100644 --- a/translations/dde-dock_si.ts +++ b/translations/dde-dock_si.ts @@ -151,6 +151,21 @@ රදවනය + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_sk.ts b/translations/dde-dock_sk.ts index 527019707..86802cb0a 100644 --- a/translations/dde-dock_sk.ts +++ b/translations/dde-dock_sk.ts @@ -151,6 +151,21 @@ Spúšťač + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_sl.ts b/translations/dde-dock_sl.ts index 6031f36b7..67ed1a23b 100644 --- a/translations/dde-dock_sl.ts +++ b/translations/dde-dock_sl.ts @@ -151,6 +151,21 @@ Zaganjalnik + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_sq.ts b/translations/dde-dock_sq.ts index da091838d..b8bf62c3d 100644 --- a/translations/dde-dock_sq.ts +++ b/translations/dde-dock_sq.ts @@ -151,6 +151,21 @@ Nisës + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_sr.ts b/translations/dde-dock_sr.ts index 7fb75a3a9..6f9287b92 100644 --- a/translations/dde-dock_sr.ts +++ b/translations/dde-dock_sr.ts @@ -151,6 +151,21 @@ Покретач Програма + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_tr.ts b/translations/dde-dock_tr.ts index 8b3830c60..e363fad48 100644 --- a/translations/dde-dock_tr.ts +++ b/translations/dde-dock_tr.ts @@ -151,6 +151,21 @@ Başlatıcı + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_ug.ts b/translations/dde-dock_ug.ts index 7541f79af..e73d0be7c 100644 --- a/translations/dde-dock_ug.ts +++ b/translations/dde-dock_ug.ts @@ -151,6 +151,21 @@ ئۈستەليۈزى قوزغاتقۇچ + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_uk.ts b/translations/dde-dock_uk.ts index 92e40cd9e..b0a1cf63a 100644 --- a/translations/dde-dock_uk.ts +++ b/translations/dde-dock_uk.ts @@ -151,6 +151,21 @@ Запускач + + MainWindow + + Exit Safe Mode + Вийти з безпечного режиму + + + Dock - Safe Mode + Док-станція — безпечний режим + + + The Dock is in safe mode, please exit to show it properly + Док-станція перебуває у безпечному режимі — будь ласка, вийдіть з нього для належного показу + + MenuWorker diff --git a/translations/dde-dock_vi.ts b/translations/dde-dock_vi.ts index a34e34418..d398d39b4 100644 --- a/translations/dde-dock_vi.ts +++ b/translations/dde-dock_vi.ts @@ -151,6 +151,21 @@ Khởi chạy + + MainWindow + + Exit Safe Mode + + + + Dock - Safe Mode + + + + The Dock is in safe mode, please exit to show it properly + + + MenuWorker diff --git a/translations/dde-dock_zh_CN.ts b/translations/dde-dock_zh_CN.ts index d2ef5acb1..399b3eefe 100644 --- a/translations/dde-dock_zh_CN.ts +++ b/translations/dde-dock_zh_CN.ts @@ -151,6 +151,21 @@ 启动器 + + MainWindow + + Exit Safe Mode + 退出安全模式 + + + Dock - Safe Mode + 任务栏安全模式 + + + The Dock is in safe mode, please exit to show it properly + 任务栏已进入安全模式,退出安全模式后即可正常显示 + + MenuWorker diff --git a/translations/dde-dock_zh_HK.ts b/translations/dde-dock_zh_HK.ts index c67c98581..2d5b862fc 100644 --- a/translations/dde-dock_zh_HK.ts +++ b/translations/dde-dock_zh_HK.ts @@ -151,6 +151,21 @@ 啟動器 + + MainWindow + + Exit Safe Mode + 退出安全模式 + + + Dock - Safe Mode + 任務欄安全模式 + + + The Dock is in safe mode, please exit to show it properly + 任務欄已進入安全模式,退出安全模式後即可正常顯示 + + MenuWorker diff --git a/translations/dde-dock_zh_TW.ts b/translations/dde-dock_zh_TW.ts index 62002c67d..a42ff362d 100644 --- a/translations/dde-dock_zh_TW.ts +++ b/translations/dde-dock_zh_TW.ts @@ -151,6 +151,21 @@ 啟動器 + + MainWindow + + Exit Safe Mode + 退出安全模式 + + + Dock - Safe Mode + 任務欄安全模式 + + + The Dock is in safe mode, please exit to show it properly + 任務欄已進入安全模式,退出安全模式後即可正常顯示 + + MenuWorker