Switch to correct buffer when indicator is activated.
[quassel.git] / src / qtui / indicatornotificationbackend.cpp
index f4bc3ae..3b808dd 100644 (file)
@@ -68,6 +68,8 @@ void IndicatorNotificationBackend::notify(const Notification &notification) {
   if(!indicator) {
     indicator = new Indicator;
     _indicatorHash.insert(bufferId, indicator);
+    connect(indicator, SIGNAL(display()),
+      SLOT(indicatorDisplayed()));
   }
   indicator->lastNotificationId = notification.notificationId;
 
@@ -126,6 +128,11 @@ void IndicatorNotificationBackend::enabledChanged(const QVariant &v) {
   }
 }
 
+void IndicatorNotificationBackend::indicatorDisplayed() {
+  Indicator *indicator = static_cast<Indicator*>(sender());
+  emit activated(indicator->lastNotificationId);
+}
+
 SettingsPage *IndicatorNotificationBackend::createConfigWidget() const {
   return new ConfigWidget();
 }