summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-05 15:14:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-05 15:24:54 (GMT)
commit6cdd48b30526761f5c6365496e30580ed3bd8a82 (patch)
tree790a96ee6a70054165264171a31ead5e8e598baf /SwifTools/Notifier
parentcd3017c8730ce66539d539890d72434cf644ab80 (diff)
downloadswift-contrib-6cdd48b30526761f5c6365496e30580ed3bd8a82.zip
swift-contrib-6cdd48b30526761f5c6365496e30580ed3bd8a82.tar.bz2
Added FreeDesktopNotifier.
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r--SwifTools/Notifier/Notifier.cpp3
-rw-r--r--SwifTools/Notifier/Notifier.h3
-rw-r--r--SwifTools/Notifier/SnarlNotifier.cpp2
-rw-r--r--SwifTools/Notifier/SnarlNotifier.h2
4 files changed, 7 insertions, 3 deletions
diff --git a/SwifTools/Notifier/Notifier.cpp b/SwifTools/Notifier/Notifier.cpp
index ec6a12f..44fe2a8 100644
--- a/SwifTools/Notifier/Notifier.cpp
+++ b/SwifTools/Notifier/Notifier.cpp
@@ -8,6 +8,9 @@
namespace Swift {
+const int Notifier::DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS;
+const int Notifier::DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS;
+
Notifier::Notifier() : enabled(true) {
}
diff --git a/SwifTools/Notifier/Notifier.h b/SwifTools/Notifier/Notifier.h
index dab6e90..ad9b324 100644
--- a/SwifTools/Notifier/Notifier.h
+++ b/SwifTools/Notifier/Notifier.h
@@ -46,6 +46,9 @@ namespace Swift {
static std::vector<Type> getAllTypes();
static std::vector<Type> getDefaultTypes();
+ static const int DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS = 3;
+ static const int DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS = 5;
+
private:
bool enabled;
};
diff --git a/SwifTools/Notifier/SnarlNotifier.cpp b/SwifTools/Notifier/SnarlNotifier.cpp
index 9162ff7..1822b49 100644
--- a/SwifTools/Notifier/SnarlNotifier.cpp
+++ b/SwifTools/Notifier/SnarlNotifier.cpp
@@ -34,7 +34,7 @@ SnarlNotifier::~SnarlNotifier() {
}
void SnarlNotifier::doShowMessage(Type type, const String& subject, const String& description, const boost::filesystem::path& picture, boost::function<void()> callback) {
- int timeout = (type == Type::IncomingMessage || type == Type::SystemMessage) ? MESSAGE_NOTIFICATION_TIMEOUT : STATUS_NOTIFICATION_TIMEOUT;
+ int timeout = (type == Type::IncomingMessage || type == Type::SystemMessage) ? DEFAULT_MESSAGE_NOTIFICATION_TIMEOUT_SECONDS : DEFAULT_STATUS_NOTIFICATION_TIMEOUT_SECONDS;
int notificationID = snarl.ShowMessageEx(typeToString(type).getUTF8Data(), subject.getUTF8Data(), description.getUTF8Data(), timeout, picture.string().c_str(), window->getID(), SWIFT_SNARLNOTIFIER_MESSAGE_ID);
if (notificationID > 0) {
notifications.insert(std::make_pair(notificationID, callback));
diff --git a/SwifTools/Notifier/SnarlNotifier.h b/SwifTools/Notifier/SnarlNotifier.h
index 0fad5c7..83d4715 100644
--- a/SwifTools/Notifier/SnarlNotifier.h
+++ b/SwifTools/Notifier/SnarlNotifier.h
@@ -25,8 +25,6 @@ namespace Swift {
void handleMessageReceived(MSG* message);
private:
- static const int STATUS_NOTIFICATION_TIMEOUT = 3;
- static const int MESSAGE_NOTIFICATION_TIMEOUT = 5;
Snarl::SnarlInterface snarl;
Win32NotifierWindow* window;
typedef std::map<int, boost::function<void()> > NotificationsMap;