SpaceInfoToolsMenu::SpaceInfoToolsMenu(QWidget* parent, QUrl url)
: QMenu(parent)
{
- const QString notInstalled = " [" + i18nc("@action:inmenu", "not installed") + "]";
-
// find service
//
const auto filelightService = KService::serviceByDesktopName("org.kde.filelight");
if (url.isLocalFile()) { // 2015-01-12: Filelight can handle FTP connections but KIO/kioexec cannot (bug or feature?), so we don't offer it in this case
// add action and connect signals
//
- const auto startFilelightDirectoryAction = addAction(filelightService->genericName() + " - "
- + i18nc("@action:inmenu", "current folder"));
+ const auto startFilelightDirectoryAction = addAction(i18nc("@action:inmenu %1 service name", "%1 - current folder", filelightService->genericName()));
startFilelightDirectoryAction->setIcon(filelightIcon);
connect(startFilelightDirectoryAction, &QAction::triggered, this, [filelightService, url](bool) {
if (url.isLocalFile()) { // makes no sense for non-local URLs (e.g. FTP server), so we don't offer it in this case
// add action and connect signals
//
- const auto startFilelightDeviceAction = addAction(filelightService->genericName() + " - "
- + i18nc("@action:inmenu", "current device"));
+ const auto startFilelightDeviceAction = addAction(i18nc("@action:inmenu %1 service name", "%1 - current device", filelightService->genericName()));
startFilelightDeviceAction->setIcon(filelightIcon);
connect(startFilelightDeviceAction, &QAction::triggered, this, [filelightService, url](bool) {
// add action and connect signals
//
- const auto startFilelightAllDevicesAction = addAction(filelightService->genericName() + " - "
- + i18nc("@action:inmenu", "all devices"));
+ const auto startFilelightAllDevicesAction = addAction(i18nc("@action:inmenu %1 service name", "%1 - all devices", filelightService->genericName()));
startFilelightAllDevicesAction->setIcon(filelightIcon);
connect(startFilelightAllDevicesAction, &QAction::triggered, this, [filelightService](bool) {
KRun::runService(*filelightService, { }, nullptr);
});
} else {
- const auto startFilelightDirectoryAction = addAction("Filelight" + notInstalled);
+ const auto startFilelightDirectoryAction = addAction(i18nc("@action:inmenu", "Filelight [not installed]"));
startFilelightDirectoryAction->setEnabled(false);
}
KRun::runService(*kdiskfreeService, { }, nullptr);
});
} else {
- const auto startKDiskFreeAction = addAction("KDiskFree" + notInstalled);
+ const auto startKDiskFreeAction = addAction(i18nc("@action:inmenu", "KDiskFree [not installed]"));
startKDiskFreeAction->setEnabled(false);
}
}