summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/Dock')
-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) {
}
};
}