diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-09-15 21:13:56 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-09-15 21:17:47 (GMT) |
commit | eb86232aee2cd49d8c8031abe95bf61d29f25096 (patch) | |
tree | 9674293bc0408c878a0cdfb64b632a235320b8dd /SwifTools/Notifier | |
parent | 69a3de2471323bf7265ef2a08b160bed4b276efa (diff) | |
download | swift-contrib-eb86232aee2cd49d8c8031abe95bf61d29f25096.zip swift-contrib-eb86232aee2cd49d8c8031abe95bf61d29f25096.tar.bz2 |
Make Snarl timeouts for messages longer.
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r-- | SwifTools/Notifier/SnarlNotifier.cpp | 1 | ||||
-rw-r--r-- | SwifTools/Notifier/SnarlNotifier.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/SwifTools/Notifier/SnarlNotifier.cpp b/SwifTools/Notifier/SnarlNotifier.cpp index ccdf26c..7312edb 100644 --- a/SwifTools/Notifier/SnarlNotifier.cpp +++ b/SwifTools/Notifier/SnarlNotifier.cpp @@ -35,6 +35,7 @@ SnarlNotifier::~SnarlNotifier() { } void SnarlNotifier::showMessage(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 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 d744023..2f64166 100644 --- a/SwifTools/Notifier/SnarlNotifier.h +++ b/SwifTools/Notifier/SnarlNotifier.h @@ -25,7 +25,8 @@ namespace Swift { void handleMessageReceived(MSG* message); private: - static const int timeout = 3; + 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; |