diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 84cb77cbd..15c346b24 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -253,7 +253,7 @@ public: ActiveStatus = 2, /**< The Item is active **/ NeedsAttentionStatus = 3, /**< The Item needs attention **/ RequiresAttentionStatus = 4, /**< The Item needs persistent attention **/ - AcceptingInputStatus = 5, /**< The Item is accepting input **/ + AcceptingInputStatus = 5 /**< The Item is accepting input **/ }; Q_ENUMS(ItemStatus) diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index 5243c7384..2a3cc7a95 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -238,7 +238,17 @@ void AppletPrivate::askDestroy() deleteNotification = new KNotification("plasmoidDeleted", KNotification::Persistent, 0); QStringList actions; deleteNotification->setIconName(q->icon()); - deleteNotification->setText(i18n("The widget \"%1\" has been removed.", q->title())); + Plasma::Containment *asContainment = qobject_cast(q); + + if (!q->isContainment()) { + deleteNotification->setText(i18n("The widget \"%1\" has been removed.", q->title())); + } else if (asContainment && (asContainment->containmentType() == Types::PanelContainment || asContainment->containmentType() == Types::CustomPanelContainment)) { + deleteNotification->setText(i18n("A Panel has been removed.")); + //This will never happen with our current shell, but could with a custom one + } else { + deleteNotification->setText(i18n("A Desktop has been removed.")); + } + actions.append(i18n("Undo")); deleteNotification->setActions(actions); QObject::connect(deleteNotification.data(), &KNotification::action1Activated, @@ -263,7 +273,7 @@ void AppletPrivate::askDestroy() }); QObject::connect(deleteNotification.data(), &KNotification::closed, [=]() { - //If the timer still exists, it meand the undo action was NOT triggered + //If the timer still exists, it means the undo action was NOT triggered if (deleteNotificationTimer) { transient = true; emit q->destroyedChanged(true); diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index a7cffbeec..8e9cfa249 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -59,7 +59,8 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant m_appletScriptEngine(script), m_backgroundHints(Plasma::Types::StandardBackground), m_busy(false), - m_hideOnDeactivate(true) + m_hideOnDeactivate(true), + m_positionBeforeRemoval(QPointF(-1, -1)) { qmlRegisterType(); @@ -74,7 +75,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant this, &AppletInterface::statusChanged); connect(applet(), &Plasma::Applet::destroyedChanged, - [=] () { + this, [=] () { setVisible(!applet()->destroyed()); });