return tr("internal connection");
}
+QString InternalPeer::address() const
+{
+ return tr("internal connection");
+}
+
+quint16 InternalPeer::port() const
+{
+ return 0;
+}
bool InternalPeer::isOpen() const
{
Protocol::Type protocol() const { return Protocol::InternalProtocol; }
QString description() const;
+ virtual QString address() const;
+ virtual quint16 port() const;
+
SignalProxy *signalProxy() const;
void setSignalProxy(SignalProxy *proxy);
virtual int lag() const = 0;
+ virtual QString address() const = 0;
+ virtual quint16 port() const = 0;
+
int _id = -1;
+ QDateTime _connectedSince;
QString _buildDate;
QString _clientVersion;
return QString();
}
+QString RemotePeer::address() const
+{
+ if (socket())
+ return socket()->peerAddress().toString();
+
+ return QString();
+}
+
+quint16 RemotePeer::port() const
+{
+ if (socket())
+ return socket()->peerPort();
+
+ return 0;
+}
+
::SignalProxy *RemotePeer::signalProxy() const
{
virtual QString description() const;
virtual quint16 enabledFeatures() const { return 0; }
+ virtual QString address() const;
+ virtual quint16 port() const;
+
bool isOpen() const;
bool isSecure() const;
bool isLocal() const;
if (peer->_id < 0) {
peer->_id = nextPeerId();
+ peer->_connectedSince = QDateTime::currentDateTimeUtc();
}
_peers.insert(peer);
for (auto peer : _peers) {
QVariantMap data;
data["id"] = peer->_id;
- data["buildData"] = peer->_buildDate;
data["clientVersion"] = peer->_clientVersion;
- data["description"] = peer->description();
+ data["clientVersionDate"] = peer->_buildDate;
+ data["remoteAddress"] = peer->address();
+ data["connectedSince"] = peer->_connectedSince;
data["secure"] = peer->isSecure();
result << data;
}
coreconnectdlg.cpp
coreconnectionstatuswidget.cpp
coreinfodlg.cpp
+ coresessionwidget.cpp
debugbufferviewoverlay.cpp
debugconsole.cpp
debuglogwidget.cpp
coreconfigwizardsyncpage.ui
coreconnectauthdlg.ui
coreconnectionstatuswidget.ui
+ coresessionwidget.ui
coreinfodlg.ui
debugbufferviewoverlay.ui
debugconsole.ui
#include "client.h"
#include "signalproxy.h"
+#include "bufferwidget.h"
+#include "coresessionwidget.h"
CoreInfoDlg::CoreInfoDlg(QWidget *parent)
: QDialog(parent),
ui.labelCoreVersionDate->setText(_coreInfo["quasselBuildDate"].toString()); // "BuildDate" for compatibility
ui.labelClientCount->setNum(_coreInfo["sessionConnectedClients"].toInt());
- /*
qWarning() << _coreInfo["sessionConnectedClientData"];
- int lastPeerId = -1;
- QMap<QString, QVariant> lastPeerData;
for (const auto &peerData : _coreInfo["sessionConnectedClientData"].toList()) {
- lastPeerData = peerData.toMap();
- lastPeerId = lastPeerData["id"].toInt();
+ auto coreSessionWidget = new CoreSessionWidget(ui.coreSessionScrollContainer);
+ coreSessionWidget->setData(peerData.toMap());
+ ui.coreSessionContainer->addWidget(coreSessionWidget);
}
- if (lastPeerId != -1) {
- qWarning() << "Kicking client " << lastPeerId;
- Client::kickClient(lastPeerId);
- }
- */
+ ui.coreSessionContainer->addStretch(1);
updateUptime();
startTimer(1000);
--- /dev/null
+#include "coresessionwidget.h"
+#include <QLayout>
+#include <QVariant>
+#include <QtCore/QMap>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QPushButton>
+#include <QtCore/QDateTime>
+
+
+CoreSessionWidget::CoreSessionWidget(QWidget *parent)
+ : QWidget(parent)
+{
+ ui.setupUi(this);
+ layout()->setContentsMargins(0, 0, 0, 0);
+ layout()->setSpacing(0);
+}
+
+void CoreSessionWidget::setData(QMap<QString, QVariant> map)
+{
+ QLabel *iconSecure = ui.iconSecure;
+ QPushButton *disconnectButton = ui.disconnectButton;
+
+ ui.labelRemoteAddress->setText(map["remoteAddress"].toString());
+ ui.labelLocation->setText(map["location"].toString());
+ ui.labelClient->setText(map["clientVersion"].toString());
+ ui.labelVersionDate->setText(map["clientVersionDate"].toString());
+ ui.labelUptime
+ ->setText(map["connectedSince"].toDateTime().toLocalTime().toString(Qt::DateFormat::SystemLocaleShortDate));
+ if (map["location"].toString().isEmpty()) {
+ ui.labelLocation->hide();
+ ui.labelLocationTitle->hide();
+ }
+}
--- /dev/null
+//
+// Created by kuschku on 27.08.17.
+//
+
+#ifndef CORESESSIONWIDGET_H
+#define CORESESSIONWIDGET_H
+
+#include <QtWidgets/QWidget>
+#include <ui_coresessionwidget.h>
+#include <QtCore/QMap>
+
+class CoreSessionWidget: public QWidget
+{
+Q_OBJECT
+
+public:
+ explicit CoreSessionWidget(QWidget *);
+
+ void setData(QMap<QString, QVariant>);
+
+private:
+ Ui::CoreSessionWidget ui;
+};
+
+#endif //CORESESSIONWIDGET_H
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>CoreInfoDlg</class>
- <widget class="QDialog" name="CoreInfoDlg" >
- <property name="geometry" >
+ <widget class="QDialog" name="CoreInfoDlg">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>282</width>
- <height>126</height>
+ <width>566</width>
+ <height>349</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Core Information</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Version:</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLabel" name="labelCoreVersion" >
- <property name="text" >
- <string><core version></string>
+ <item row="0" column="1">
+ <widget class="QLabel" name="labelCoreVersion">
+ <property name="text">
+ <string><core version></string>
</property>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_4" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
<string>Uptime:</string>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
<string>Connected Clients:</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QLabel" name="labelClientCount" >
- <property name="text" >
- <string><connected clients></string>
+ <item row="3" column="1">
+ <widget class="QLabel" name="labelClientCount">
+ <property name="text">
+ <string><connected clients></string>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QLabel" name="labelUptime" >
- <property name="text" >
- <string><core uptime></string>
+ <item row="2" column="1">
+ <widget class="QLabel" name="labelUptime">
+ <property name="text">
+ <string><core uptime></string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Version date:</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QLabel" name="labelCoreVersionDate" >
- <property name="text" >
- <string><version date></string>
+ <item row="1" column="1">
+ <widget class="QLabel" name="labelCoreVersionDate">
+ <property name="text">
+ <string><version date></string>
</property>
</widget>
</item>
</layout>
</item>
<item>
- <layout class="QGridLayout" name="gridLayout_2" >
- <item row="0" column="1" >
- <widget class="QPushButton" name="closeButton" >
- <property name="text" >
+ <widget class="QScrollArea" name="coreSessionScrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <widget class="QWidget" name="coreSessionScrollContainer">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>550</width>
+ <height>193</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QVBoxLayout" name="coreSessionContainer">
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="1" column="1">
+ <widget class="QPushButton" name="closeButton">
+ <property name="text">
<string>Close</string>
</property>
</widget>
</item>
- <item row="0" column="0" >
- <spacer name="horizontalSpacer" >
- <property name="orientation" >
+ <item row="1" column="0">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</property>
</spacer>
</item>
- <item row="0" column="2" >
- <spacer name="horizontalSpacer_2" >
- <property name="orientation" >
+ <item row="1" column="2">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</item>
</layout>
</item>
- <item>
- <spacer name="verticalSpacer" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CoreSessionWidget</class>
+ <widget class="QWidget" name="CoreSessionWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>509</width>
+ <height>204</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>480</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <layout class="QGridLayout" name="mainLayout" rowstretch="0,0,0">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="titleLayout">
+ <item>
+ <widget class="QLabel" name="labelRemoteAddress">
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>86.103.223.212</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="iconSecure">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="textInteractionFlags">
+ <set>Qt::NoTextInteraction</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QGridLayout" name="contentLayout" columnstretch="1,3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelClientTitle">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(119, 119, 119);</string>
+ </property>
+ <property name="text">
+ <string>Client:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="labelClient">
+ <property name="text">
+ <string>v0.13-pre (0.12.0+372 git-12df418)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="labelLocationTitle">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(119, 119, 119);</string>
+ </property>
+ <property name="text">
+ <string>Location:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="labelLocation">
+ <property name="text">
+ <string>Kiel, Germany</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="labelVersionDate">
+ <property name="text">
+ <string>Sun Aug 27 04:29:53 2017</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="labelVersionDateTitle">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(119, 119, 119);</string>
+ </property>
+ <property name="text">
+ <string>Version Date:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="labelUptime">
+ <property name="text">
+ <string>Sun Aug 27 15:03:10 2017</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="labelUptimeTitle">
+ <property name="styleSheet">
+ <string notr="true">color: rgb(119, 119, 119);</string>
+ </property>
+ <property name="text">
+ <string>Connected Since:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <layout class="QHBoxLayout" name="actionsLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="disconnectButton">
+ <property name="text">
+ <string>End Session</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>