summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-12-21 19:21:05 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-12-21 19:21:05 (GMT)
commiteb0caf8201ed2b5507401a7127624b64ca2f51fc (patch)
treeca37edf93dc16bc209e3978fe05c509b81918d5b /SwifTools
parent78b972a775dc981c087fc6a72ee043102c5fd283 (diff)
downloadswift-contrib-eb0caf8201ed2b5507401a7127624b64ca2f51fc.zip
swift-contrib-eb0caf8201ed2b5507401a7127624b64ca2f51fc.tar.bz2
Make dock get the number of pending messages (instead of a generic message).
Diffstat (limited to 'SwifTools')
-rw-r--r--SwifTools/Dock/Dock.h2
-rw-r--r--SwifTools/Dock/MacOSXDock.h2
-rw-r--r--SwifTools/Dock/MacOSXDock.mm4
-rw-r--r--SwifTools/Dock/NullDock.h2
4 files changed, 6 insertions, 4 deletions
diff --git a/SwifTools/Dock/Dock.h b/SwifTools/Dock/Dock.h
index a1c652d..2dd312c 100644
--- a/SwifTools/Dock/Dock.h
+++ b/SwifTools/Dock/Dock.h
@@ -13,6 +13,6 @@ namespace Swift {
public:
virtual ~Dock();
- virtual void setMessage(const String& message) = 0;
+ virtual void setNumberOfPendingMessages(int i) = 0;
};
}
diff --git a/SwifTools/Dock/MacOSXDock.h b/SwifTools/Dock/MacOSXDock.h
index e9667a6..511a652 100644
--- a/SwifTools/Dock/MacOSXDock.h
+++ b/SwifTools/Dock/MacOSXDock.h
@@ -16,6 +16,6 @@ namespace Swift {
public:
MacOSXDock(CocoaApplication* application);
- void setMessage(const String& label);
+ virtual void setNumberOfPendingMessages(int i);
};
}
diff --git a/SwifTools/Dock/MacOSXDock.mm b/SwifTools/Dock/MacOSXDock.mm
index d2a06b3..0438353 100644
--- a/SwifTools/Dock/MacOSXDock.mm
+++ b/SwifTools/Dock/MacOSXDock.mm
@@ -2,6 +2,7 @@
#include <AppKit/AppKit.h>
#include <Cocoa/Cocoa.h>
+#include <boost/lexical_cast.hpp>
#include "Swiften/Base/String.h"
@@ -10,7 +11,8 @@ namespace Swift {
MacOSXDock::MacOSXDock(CocoaApplication*) {
}
-void MacOSXDock::setMessage(const String& label) {
+void MacOSXDock::setNumberOfPendingMessages(int i) {
+ String label(i > 0 ? boost::lexical_cast<std::string>(i) : "");
NSString *labelString = [[NSString alloc] initWithUTF8String: label.getUTF8Data()];
[[NSApp dockTile] setBadgeLabel: labelString];
[labelString release];
diff --git a/SwifTools/Dock/NullDock.h b/SwifTools/Dock/NullDock.h
index f2d27b7..1dbb892 100644
--- a/SwifTools/Dock/NullDock.h
+++ b/SwifTools/Dock/NullDock.h
@@ -13,7 +13,7 @@ namespace Swift {
public:
NullDock() {}
- virtual void setMessage(const String&) {
+ virtual void setNumberOfPendingMessages(int i) {
}
};
}