* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include <QMessageBox>
+
#include "coreinfodlg.h"
#include "client.h"
coreInfoChanged(coreInfo->coreData());
+ // Warning icon
+ ui.coreUnsupportedIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16));
+
updateUptime();
startTimer(1000);
}
}
ui.coreSessionScrollArea->setVisible(coreSessionSupported);
+
+ // Hide the information bar when core sessions are supported
+ ui.coreUnsupportedWidget->setVisible(!coreSessionSupported);
}
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.")));
+}
void updateUptime();
void disconnectClicked(int peerId);
+ /**
+ * Event handler for core unspported Details button
+ */
+ void on_coreUnsupportedDetails_clicked();
+
private:
Ui::CoreInfoDlg ui;
QMap<int, CoreSessionWidget *> _widgets;
ui.disconnectButton->setEnabled(true);
ui.disconnectButton->setToolTip(tr("End the client's session, disconnecting it"));
} else {
+ // For any active sessions to be displayed, the core must support this feature. We can
+ // assume the client doesn't support being remotely disconnected.
+ //
+ // (During the development of 0.13, there was a period of time where active sessions existed
+ // but did not provide the disconnect option. We can overlook this.)
+
// Either core or client doesn't support it, disable the option
ui.disconnectButton->setEnabled(false);
- if (!Client::isCoreFeatureEnabled(Quassel::Feature::RemoteDisconnect)) {
- // Until RemoteDisconnect was implemented, the Quassel core didn't forward client
- // features. A client might support features and we'll never hear about it.
- // This check shouldn't be necessary for later features if the core supports at least
- // RemoteDisconnect.
-
- // Core doesn't support this feature (we don't know about the client)
- ui.disconnectButton->setToolTip(
- QString("<p>%1</p><p><b>%2</b><br/>%3</p>").arg(
- tr("End the client's session, disconnecting it"),
- tr("Your Quassel core does not support this feature"),
- tr("You need a Quassel core v0.13.0 or newer in order to end connected "
- "sessions.")));
- } else {
- // Client doesn't support this feature
- ui.disconnectButton->setToolTip(
- QString("<p>%1</p><p><b>%2</b></p>").arg(
- tr("End the client's session, disconnecting it"),
- tr("This client does not support being remotely disconnected")));
- }
+ // Assuming the client lacks support, set the tooltip accordingly
+ ui.disconnectButton->setToolTip(
+ QString("<p>%1</p><p><b>%2</b></p>").arg(
+ tr("End the client's session, disconnecting it"),
+ tr("This client does not support being remotely disconnected")));
}
bool success = false;
<property name="windowTitle">
<string>Core Information</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0,0">
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1,0,0">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
</item>
</layout>
</item>
+ <item>
+ <widget class="QFrame" name="coreUnsupportedWidget">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <layout class="QHBoxLayout">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="coreUnsupportedIcon">
+ <property name="text">
+ <string notr="true">[icon]</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="coreUnsupportedLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Your Quassel core is too old to show active sessions</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="coreUnsupportedDetails">
+ <property name="text">
+ <string>Details...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item>
<widget class="QScrollArea" name="coreSessionScrollArea">
<property name="sizePolicy">
<rect>
<x>0</x>
<y>0</y>
- <width>550</width>
- <height>187</height>
+ <width>546</width>
+ <height>161</height>
</rect>
</property>
<property name="sizePolicy">