diff options
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r-- | SwifTools/Notifier/Notifier.cpp | 3 | ||||
-rw-r--r-- | SwifTools/Notifier/Notifier.h | 3 | ||||
-rw-r--r-- | SwifTools/Notifier/SnarlNotifier.cpp | 2 | ||||
-rw-r--r-- | SwifTools/Notifier/SnarlNotifier.h | 2 |
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; |