Changeset View
Changeset View
Standalone View
Standalone View
src/notificationmanager.cpp
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "notificationmanager.h" | 20 | #include "notificationmanager.h" | ||
21 | #include <klocalizedstring.h> | ||||
21 | 22 | | |||
22 | NotificationManager::NotificationManager(QObject* parent) | 23 | NotificationManager::NotificationManager(QObject* parent) | ||
23 | { | 24 | { | ||
24 | Q_UNUSED(parent) | 25 | Q_UNUSED(parent) | ||
25 | m_sharingSuccess = new KNotification( "sharingSuccess", KNotification::Persistent); | 26 | m_sharingSuccess = new KNotification( "sharingSuccess", KNotification::Persistent); | ||
26 | 27 | | |||
27 | m_sharingFailed = new KNotification( "sharingFailed", KNotification::CloseOnTimeout); | 28 | m_sharingFailed = new KNotification( "sharingFailed", KNotification::CloseOnTimeout); | ||
28 | m_sharingFailed->setText("Sharing failed"); | 29 | m_sharingFailed->setText("Sharing failed"); | ||
29 | } | 30 | } | ||
30 | 31 | | |||
31 | NotificationManager::~NotificationManager() | 32 | NotificationManager::~NotificationManager() | ||
32 | { | 33 | { | ||
33 | delete m_sharingFailed; | 34 | delete m_sharingFailed; | ||
34 | delete m_sharingSuccess; | 35 | delete m_sharingSuccess; | ||
35 | } | 36 | } | ||
36 | 37 | | |||
37 | void NotificationManager::showNotification(bool valid, QVariant url) | 38 | void NotificationManager::showNotification(bool valid, QVariant url) | ||
38 | { | 39 | { | ||
39 | if (valid) { | 40 | if (valid) { | ||
40 | m_sharingSuccess->setText("Shared url for image is " + url.toString()); | 41 | m_sharingSuccess->setText( i18n("Shared url for image is <a href='%1'>%1</a>", url.toString())); | ||
41 | m_sharingSuccess->sendEvent(); | 42 | m_sharingSuccess->sendEvent(); | ||
42 | } else { | 43 | } else { | ||
43 | m_sharingFailed->sendEvent(); | 44 | m_sharingFailed->sendEvent(); | ||
44 | } | 45 | } | ||
45 | } | 46 | } | ||
46 | 47 | | |||
47 | #include "moc_notificationmanager.cpp" | 48 | #include "moc_notificationmanager.cpp" |