From 088b5160576c8ed317619855a4c9dc19a69d025b Mon Sep 17 00:00:00 2001 From: Gregor Mi Date: Mon, 12 Jan 2015 16:18:50 +0100 Subject: Add disk usage statistics menu to SpaceInfo widget in the status bar: the menu has the following entries: 1. Filelight location 2. Filelight device 3. Filelight 4. KDiskFree KService is used to find the applications and display proper translations. KRun is used to run the applications. REVIEW: 121478 CHANGELOG: Add a menu on left-click on the SpaceInfo widget in the status bar to show Disk Usage statistics. --- src/statusbar/statusbarspaceinfo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/statusbar/statusbarspaceinfo.cpp') diff --git a/src/statusbar/statusbarspaceinfo.cpp b/src/statusbar/statusbarspaceinfo.cpp index 046cbbb23..127641e60 100644 --- a/src/statusbar/statusbarspaceinfo.cpp +++ b/src/statusbar/statusbarspaceinfo.cpp @@ -21,6 +21,9 @@ #include "statusbarspaceinfo.h" #include "spaceinfoobserver.h" +#include "spaceinfotoolsmenu.h" + +#include #include #include @@ -65,6 +68,14 @@ void StatusBarSpaceInfo::hideEvent(QHideEvent* event) KCapacityBar::hideEvent(event); } +void StatusBarSpaceInfo::mousePressEvent(QMouseEvent* event) +{ + if (event->button() == Qt::LeftButton) { + SpaceInfoToolsMenu spaceInfoToolsMenu(this, m_url); + spaceInfoToolsMenu.exec(QCursor::pos()); + } +} + void StatusBarSpaceInfo::slotValuesChanged() { Q_ASSERT(m_observer); -- cgit v1.3