#include <KLocalizedString>
#include <KService>
+#include <QDesktopServices>
#include <QHBoxLayout>
#include <QMenu>
#include <QMouseEvent>
QWidget::hideEvent(event);
}
+QSize StatusBarSpaceInfo::minimumSizeHint() const
+{
+ return QSize();
+}
+
void StatusBarSpaceInfo::updateMenu()
{
m_buttonMenu->clear();
const KService::Ptr kdiskfree = KService::serviceByDesktopName(QStringLiteral("org.kde.kdf"));
if (!filelight && !kdiskfree) {
- // nothing to show
+ QAction *installFilelight =
+ m_buttonMenu->addAction(QIcon::fromTheme(QStringLiteral("filelight")), i18n("Install Filelight to View Disk Usage Statistics…"));
+
+ connect(installFilelight, &QAction::triggered, this, [] {
+#ifdef Q_OS_WIN
+ QDesktopServices::openUrl(QUrl("https://apps.kde.org/filelight"));
+#else
+ QDesktopServices::openUrl(QUrl("appstream://org.kde.filelight.desktop"));
+#endif
+ });
+
return;
}
m_textInfoButton->setText(i18nc("@info:status Free disk space", "%1 free", KIO::convertSize(available)));
setToolTip(i18nc("tooltip:status Free disk space", "%1 free out of %2 (%3% used)", KIO::convertSize(available), KIO::convertSize(size), percentUsed));
- m_textInfoButton->setToolTip(toolTip());
+ m_textInfoButton->setToolTip(i18nc("@info:tooltip for the free disk space button",
+ "%1 free out of %2 (%3% used)\nPress to manage disk space usage.",
+ KIO::convertSize(available),
+ KIO::convertSize(size),
+ percentUsed));
setUpdatesEnabled(false);
m_capacityBar->setValue(percentUsed);
setUpdatesEnabled(true);