minor message fixes

Change-Id: I050b2e70ad1d9a57eb99c0f8fd34a80b76b66736
This commit is contained in:
Marco Martin 2014-10-31 17:29:33 +01:00
parent cef6b23e74
commit ad06e7c8a2
3 changed files with 16 additions and 5 deletions

View File

@ -253,7 +253,7 @@ public:
ActiveStatus = 2, /**< The Item is active **/ ActiveStatus = 2, /**< The Item is active **/
NeedsAttentionStatus = 3, /**< The Item needs attention **/ NeedsAttentionStatus = 3, /**< The Item needs attention **/
RequiresAttentionStatus = 4, /**< The Item needs persistent 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) Q_ENUMS(ItemStatus)

View File

@ -238,7 +238,17 @@ void AppletPrivate::askDestroy()
deleteNotification = new KNotification("plasmoidDeleted", KNotification::Persistent, 0); deleteNotification = new KNotification("plasmoidDeleted", KNotification::Persistent, 0);
QStringList actions; QStringList actions;
deleteNotification->setIconName(q->icon()); deleteNotification->setIconName(q->icon());
deleteNotification->setText(i18n("The widget \"%1\" has been removed.", q->title())); Plasma::Containment *asContainment = qobject_cast<Plasma::Containment *>(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")); actions.append(i18n("Undo"));
deleteNotification->setActions(actions); deleteNotification->setActions(actions);
QObject::connect(deleteNotification.data(), &KNotification::action1Activated, QObject::connect(deleteNotification.data(), &KNotification::action1Activated,
@ -263,7 +273,7 @@ void AppletPrivate::askDestroy()
}); });
QObject::connect(deleteNotification.data(), &KNotification::closed, 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) { if (deleteNotificationTimer) {
transient = true; transient = true;
emit q->destroyedChanged(true); emit q->destroyedChanged(true);

View File

@ -59,7 +59,8 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant
m_appletScriptEngine(script), m_appletScriptEngine(script),
m_backgroundHints(Plasma::Types::StandardBackground), m_backgroundHints(Plasma::Types::StandardBackground),
m_busy(false), m_busy(false),
m_hideOnDeactivate(true) m_hideOnDeactivate(true),
m_positionBeforeRemoval(QPointF(-1, -1))
{ {
qmlRegisterType<QAction>(); qmlRegisterType<QAction>();
@ -74,7 +75,7 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant
this, &AppletInterface::statusChanged); this, &AppletInterface::statusChanged);
connect(applet(), &Plasma::Applet::destroyedChanged, connect(applet(), &Plasma::Applet::destroyedChanged,
[=] () { this, [=] () {
setVisible(!applet()->destroyed()); setVisible(!applet()->destroyed());
}); });