improve test notification

This commit is contained in:
Patrick von Reth 2015-07-15 15:00:53 +02:00
parent 52bb577885
commit 1146340184
4 changed files with 29 additions and 28 deletions

View File

@ -4,7 +4,7 @@
<context>
<name>Default Alert</name>
<message>
<location filename="../src/libsnore/application.cpp" line="34"/>
<location filename="../src/libsnore/application_p.cpp" line="30"/>
<source>Default</source>
<translation>Standart</translation>
</message>
@ -183,24 +183,24 @@
<context>
<name>Snore::SnoreCore</name>
<message>
<location filename="../src/libsnore/snore.cpp" line="242"/>
<source>This is Snore</source>
<translation>Dies ist Snore</translation>
<location filename="../src/libsnore/snore.cpp" line="259"/>
<source>This is </source>
<translation>Dies ist </translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="243"/>
<source>Project Website</source>
<translation>Projekt Webseite</translation>
<location filename="../src/libsnore/snore.cpp" line="261"/>
<source>Everything is awesome!</source>
<translation>Alles ist super!</translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="247"/>
<source>Hello World</source>
<translation>Hallo Welt</translation>
<location filename="../src/libsnore/snore.cpp" line="265"/>
<source>Hello There!</source>
<translation>Hallo da!</translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="248"/>
<source>Test Action</source>
<translation>Test Aktion</translation>
<location filename="../src/libsnore/snore.cpp" line="266"/>
<source>Awesome Action!</source>
<translation>Grossartige Aktion!</translation>
</message>
</context>
<context>

View File

@ -4,7 +4,7 @@
<context>
<name>Default Alert</name>
<message>
<location filename="../src/libsnore/application.cpp" line="34"/>
<location filename="../src/libsnore/application_p.cpp" line="30"/>
<source>Default</source>
<translation type="unfinished"></translation>
</message>
@ -183,23 +183,23 @@
<context>
<name>Snore::SnoreCore</name>
<message>
<location filename="../src/libsnore/snore.cpp" line="242"/>
<source>This is Snore</source>
<location filename="../src/libsnore/snore.cpp" line="259"/>
<source>This is </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="243"/>
<source>Project Website</source>
<location filename="../src/libsnore/snore.cpp" line="261"/>
<source>Everything is awesome!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="247"/>
<source>Hello World</source>
<location filename="../src/libsnore/snore.cpp" line="265"/>
<source>Hello There!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/libsnore/snore.cpp" line="248"/>
<source>Test Action</source>
<location filename="../src/libsnore/snore.cpp" line="266"/>
<source>Awesome Action!</source>
<translation type="unfinished"></translation>
</message>
</context>

View File

@ -256,12 +256,13 @@ Notification SnoreCore::getActiveNotificationByID(uint id) const
void SnoreCore::displayExapleNotification()
{
Application app = SnoreCorePrivate::instance()->defaultApplication();
QString text = QLatin1String("<i>") + tr("This is Snore") + QLatin1String("</i><br>") +
QLatin1String("<a href=\"https://github.com/Snorenotify/Snorenotify\">") + tr("Project Website") + QLatin1String("</a><br>");
QString text = QLatin1String("<i>") + tr("This is ") + app.name() + QLatin1String("</i><br>"
"<b>") +
tr("Everything is awesome!") + QLatin1String("</b><br>");
if (!app.constHints().value("use-markup").toBool()) {
text = Utils::normalizeMarkup(text, Utils::NO_MARKUP);
}
Notification noti(app, app.defaultAlert(), tr("Hello World"), text, app.icon());
noti.addAction(Action(1, tr("Test Action")));
Notification noti(app, app.defaultAlert(), tr("Hello There!"), text, app.icon());
noti.addAction(Action(1, tr("Awesome Action!")));
broadcastNotification(noti);
}

View File

@ -33,9 +33,9 @@ public:
public Q_SLOTS:
void slotNotify(Snore::Notification notification) override;
private Q_SLOTS:
void load() override;
void load() override;
};
#endif // OSXNOTIFICATIONCENTER_H