Commit 5da6cbe4 authored by Samoilenko Yuri's avatar Samoilenko Yuri

FS mount/unmount notify with default action None

You can enable nototfication popups(or any other action) in systemsettings->notifications dialog.
parent fe429d05
......@@ -295,3 +295,16 @@ Comment[tr]=Bilinmeyen bir durum oluştu
Comment[uk]=Сталося щось невідоме програмі
Comment[x-test]=xxSomething unknown happenedxx
Action=Popup
[Event/mounted]
Name=Mounted
Name[x-test]=xxMountedxx
Comment=Filesystem mounted
Action=None
[Event/unmounted]
Name=Unmounted
Name[x-test]=xxUnmountedxx
Comment=Filesystem unmounted
Action=None
......@@ -163,7 +163,14 @@ QString SftpPlugin::mountPoint()
void SftpPlugin::onMounted()
{
kDebug(kdeconnect_kded()) << device()->name() << QString("Remote filesystem mounted at %1").arg(mountPoint());
KNotification* notification = new KNotification("mounted", KNotification::CloseOnTimeout, this);
notification->setPixmap(KIconLoader::global()->loadIcon("drive-removable-media", KIconLoader::Desktop));
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
notification->setTitle(i18n("Device %1").arg(device()->name()));
notification->setText(i18n("Filesystem mounted at %1").arg(mountPoint()));
notification->sendEvent();
Q_EMIT mounted();
}
......@@ -177,6 +184,13 @@ void SftpPlugin::onUnmounted(bool idleTimeout)
{
kDebug(kdeconnect_kded()) << device()->name() << "Remote filesystem unmounted";
}
KNotification* notification = new KNotification("unmounted", KNotification::CloseOnTimeout, this);
notification->setPixmap(KIconLoader::global()->loadIcon("dialog-ok", KIconLoader::Desktop));
notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
notification->setTitle(i18n("Device %1").arg(device()->name()));
notification->setText(i18n("Filesystem unmounted"));
notification->sendEvent();
m_d->mounter->deleteLater();
m_d->mounter = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment