mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
bugfix: disable trash-plugin menu when trash is empty
Change-Id: Ib79f2357be06ba844dd73360f4651c13420e1ed8
This commit is contained in:
parent
4fcd036bee
commit
4c05f22e9b
Notes:
Deepin Code Review
2016-06-14 07:19:47 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: <mr.asianwang@gmail.com> Submitted-by: <mr.asianwang@gmail.com> Submitted-at: Mon, 14 Sep 2015 17:23:49 +0800 Reviewed-on: https://cr.deepin.io/6994 Project: dde/dde-dock Branch: refs/heads/master
@ -11,6 +11,10 @@ MainItem::MainItem(QWidget *parent) : QLabel(parent)
|
||||
setAcceptDrops(true);
|
||||
setFixedSize(Dock::APPLET_FASHION_ITEM_WIDTH, Dock::APPLET_FASHION_ITEM_HEIGHT);
|
||||
|
||||
m_dftm = new DBusFileTrashMonitor(this);
|
||||
connect(m_dftm, &DBusFileTrashMonitor::ItemCountChanged, [=]{
|
||||
updateIcon(false);
|
||||
});
|
||||
updateIcon(false);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ private:
|
||||
void updateIcon(bool isOpen);
|
||||
|
||||
DBusFileOperations * m_dfo = new DBusFileOperations(this);
|
||||
DBusFileTrashMonitor * m_dftm = new DBusFileTrashMonitor(this);
|
||||
DBusFileTrashMonitor * m_dftm = NULL;
|
||||
DBusLauncher * m_launcher = new DBusLauncher(this);
|
||||
};
|
||||
|
||||
|
@ -19,7 +19,7 @@ void TrashPlugin::init(DockPluginProxyInterface *proxy)
|
||||
|
||||
QString TrashPlugin::getPluginName()
|
||||
{
|
||||
return "Trash plugin";
|
||||
return tr("Trash");
|
||||
}
|
||||
|
||||
QStringList TrashPlugin::ids()
|
||||
@ -115,7 +115,7 @@ QJsonObject TrashPlugin::createMenuItem(QString itemId, QString itemName, bool c
|
||||
itemObj.insert("itemIconHover", "");
|
||||
itemObj.insert("itemIconInactive", "");
|
||||
itemObj.insert("itemExtra", "");
|
||||
itemObj.insert("isActive", true);
|
||||
itemObj.insert("isActive", m_trashMonitor->ItemCount() > 0);
|
||||
itemObj.insert("isCheckable", checkable);
|
||||
itemObj.insert("checked", checked);
|
||||
itemObj.insert("itemSubMenu", QJsonObject());
|
||||
|
@ -49,6 +49,7 @@ private:
|
||||
MainItem * m_item = NULL;
|
||||
QString m_id = "trash_plugin";
|
||||
DockPluginProxyInterface * m_proxy;
|
||||
DBusFileTrashMonitor * m_trashMonitor = new DBusFileTrashMonitor(this);
|
||||
|
||||
Dock::DockMode m_mode = Dock::EfficientMode;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user