identd: Remove unneeded strict attribute
[quassel.git] / src / qtui / coreinfodlg.cpp
index 2f8736c..e80450f 100644 (file)
 
 #include "coreinfodlg.h"
 
-#include "client.h"
+#include <QMessageBox>
+
 #include "bufferwidget.h"
+#include "client.h"
+#include "icon.h"
 
 CoreInfoDlg::CoreInfoDlg(QWidget *parent) : QDialog(parent) {
     ui.setupUi(this);
@@ -30,6 +33,9 @@ CoreInfoDlg::CoreInfoDlg(QWidget *parent) : QDialog(parent) {
 
     coreInfoChanged(coreInfo->coreData());
 
+    // Warning icon
+    ui.coreUnsupportedIcon->setPixmap(icon::get("dialog-warning").pixmap(16));
+
     updateUptime();
     startTimer(1000);
 }
@@ -73,6 +79,9 @@ void CoreInfoDlg::coreInfoChanged(const QVariantMap &coreInfo) {
     }
 
     ui.coreSessionScrollArea->setVisible(coreSessionSupported);
+
+    // Hide the information bar when core sessions are supported
+    ui.coreUnsupportedWidget->setVisible(!coreSessionSupported);
 }
 
 
@@ -102,3 +111,13 @@ void CoreInfoDlg::updateUptime() {
 void CoreInfoDlg::disconnectClicked(int peerId) {
     Client::kickClient(peerId);
 }
+
+void CoreInfoDlg::on_coreUnsupportedDetails_clicked()
+{
+    QMessageBox::warning(this,
+                         tr("Active sessions unsupported"),
+                         QString("<p><b>%1</b></p></br><p>%2</p>"
+                                 ).arg(tr("Your Quassel core is too old to show active sessions"),
+                                       tr("You need a Quassel core v0.13.0 or newer to view and "
+                                          "disconnect other connected clients.")));
+}