common: Port remote nicks to NickHighlightMatcher
[quassel.git] / src / qtui / dockmanagernotificationbackend.cpp
index c9fdc0d..786593d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2013 by the Quassel Project                             *
+ *   Copyright (C) 2013-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -46,11 +46,11 @@ DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent)
         if (_dock->isValid()) {
             _bus.connect("org.freedesktop.DockManager", "/org/freedesktop/DockManager", "org.freedesktop.DockManager", "ItemAdded", this, SLOT(itemAdded(QDBusObjectPath)));
         } else {
-            qDebug() << "No DockManager available";
-            _enabled = false;
+            _available = _enabled = false;
             return;
         }
     }
+    _available = true;
 
     itemAdded(QDBusObjectPath());
 
@@ -171,18 +171,18 @@ void DockManagerNotificationBackend::enabledChanged(const QVariant &v)
 
 SettingsPage *DockManagerNotificationBackend::createConfigWidget() const
 {
-    return new ConfigWidget();
+    return new ConfigWidget(_available);
 }
 
 
 /***************************************************************************/
 
-DockManagerNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
+DockManagerNotificationBackend::ConfigWidget::ConfigWidget(bool enabled, QWidget *parent)
     : SettingsPage("Internal", "DockManagerNotification", parent)
 {
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(enabledBox = new QCheckBox(tr("Mark dockmanager entry"), this));
-    enabledBox->setEnabled(true);
+    enabledBox->setVisible(enabled);
 
     connect(enabledBox, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
 }