buffermodel.h
client.h
clientbacklogmanager.h
+ clientcoreinfo.h
clientirclisthelper.h
clientsyncer.h
irclistmodel.h
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef CLIENTCOREINFO_H
+#define CLIENTCOREINFO_H
+
+#include "coreinfo.h"
+
+/*
+ * Yes this name is somewhat stupid... but it fits the general naming scheme
+ * which is prefixing client specific sync objects with "Client"... ;)
+ */
+class ClientCoreInfo : public CoreInfo {
+ Q_OBJECT
+
+public:
+ ClientCoreInfo(QObject *parent = 0) : CoreInfo(parent) {}
+
+ inline virtual const QMetaObject *syncMetaObject() const { return &CoreInfo::staticMetaObject; }
+
+ inline QVariant &operator[](const QString &key) { return _coreData[key]; }
+
+public slots:
+ inline virtual void setCoreData(const QVariantMap &data) { _coreData = data; }
+
+private:
+ QVariantMap _coreData;
+};
+
+#endif //CLIENTCOREINFO_H
buffersyncer.h
bufferviewconfig.h
bufferviewmanager.h
+ coreinfo.h
identity.h
ircchannel.h
irclisthelper.h
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef COREINFO_H
+#define COREINFO_H
+
+#include "syncableobject.h"
+
+/*
+ * gather various informations about the core.
+ */
+
+class CoreInfo : public SyncableObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QVariantMap coreData READ coreData WRITE setCoreData STORED false)
+
+public:
+ CoreInfo(QObject *parent = 0) : SyncableObject(parent) {}
+
+public slots:
+ virtual inline QVariantMap coreData() const { return QVariantMap(); }
+ virtual inline void setCoreData(const QVariantMap &) {}
+};
+
+#endif //COREINFO_H
public:
void dumpSyncMap(SyncableObject *object);
+ inline int peerCount() const { return _peers.size(); }
private:
// Hash of used QIODevices
corebacklogmanager.cpp
corebufferviewconfig.cpp
corebufferviewmanager.cpp
+ corecoreinfo.cpp
coreirclisthelper.cpp
corenetwork.cpp
coresession.cpp
corebacklogmanager.h
corebufferviewconfig.h
corebufferviewmanager.h
+ corecoreinfo.h
coreirclisthelper.h
corenetwork.h
coresession.h
}
Core::Core() : storage(0) {
- startTime = QDateTime::currentDateTime(); // for uptime :)
+ _startTime = QDateTime::currentDateTime(); // for uptime :)
// Register storage backends here!
registerStorageBackend(new SqliteStorage(this));
reply["CoreBuild"] = 860; // FIXME legacy
reply["ProtocolVersion"] = Global::protocolVersion;
// TODO: Make the core info configurable
- int uptime = startTime.secsTo(QDateTime::currentDateTime());
+ int uptime = startTime().secsTo(QDateTime::currentDateTime());
int updays = uptime / 86400; uptime %= 86400;
int uphours = uptime / 3600; uptime %= 3600;
int upmins = uptime / 60;
reply["CoreInfo"] = tr("<b>Quassel Core Version %1</b><br>"
- "Built: %2<br>"
- "Up %3d%4h%5m (since %6)").arg(Global::quasselVersion).arg(Global::quasselBuildDate)
- .arg(updays).arg(uphours,2,10,QChar('0')).arg(upmins,2,10,QChar('0')).arg(startTime.toString(Qt::TextDate));
+ "Built: %2<br>"
+ "Up %3d%4h%5m (since %6)").arg(Global::quasselVersion).arg(Global::quasselBuildDate)
+ .arg(updays).arg(uphours,2,10,QChar('0')).arg(upmins,2,10,QChar('0')).arg(startTime().toString(Qt::TextDate));
#ifndef QT_NO_OPENSSL
SslServer *sslServer = qobject_cast<SslServer *>(&server);
*/
static QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user);
+ const QDateTime &startTime() const { return _startTime; }
+
public slots:
//! Make storage data persistent
/** \note This method is threadsafe.
QHash<QString, Storage *> _storageBackends;
- QDateTime startTime;
+ QDateTime _startTime;
bool configured;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "corecoreinfo.h"
+
+#include "core.h"
+#include "coresession.h"
+#include "global.h"
+#include "signalproxy.h"
+
+CoreCoreInfo::CoreCoreInfo(CoreSession *parent)
+ : CoreInfo(parent),
+ _coreSession(parent)
+{
+}
+
+QVariantMap CoreCoreInfo::coreData() const {
+ QVariantMap data;
+ data["quasselVersion"] = Global::quasselVersion;
+ data["quasselBuildDate"] = Global::quasselBuildDate;
+ data["startTime"] = Core::instance()->startTime();
+ data["sessionConnectedClients"] = _coreSession->signalProxy()->peerCount();
+ return data;
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef CORECOREINFO_H
+#define CORECOREINFO_H
+
+#include "coreinfo.h"
+
+class CoreSession;
+
+/*
+ * Yes this name is somewhat stupid... but it fits the general naming scheme
+ * which is prefixing core specific sync objects with "Core"... ;)
+ */
+class CoreCoreInfo : public CoreInfo {
+ Q_OBJECT
+
+public:
+ CoreCoreInfo(CoreSession *parent);
+
+ inline virtual const QMetaObject *syncMetaObject() const { return &CoreInfo::staticMetaObject; }
+
+public slots:
+ virtual QVariantMap coreData() const;
+
+private:
+ CoreSession *_coreSession;
+};
+
+#endif //CORECOREINFO_H
_backlogManager(new CoreBacklogManager(this)),
_bufferViewManager(new CoreBufferViewManager(_signalProxy, this)),
_ircListHelper(new CoreIrcListHelper(this)),
+ _coreInfo(this),
scriptEngine(new QScriptEngine(this))
{
// init IrcListHelper;
p->synchronize(ircListHelper());
+ // init CoreInfo;
+ p->synchronize(&_coreInfo);
+
// Restore session state
if(restoreState) restoreSessionState();
#include <QString>
#include <QVariant>
+#include "corecoreinfo.h"
#include "message.h"
class BufferSyncer;
CoreBacklogManager *_backlogManager;
CoreBufferViewManager *_bufferViewManager;
CoreIrcListHelper *_ircListHelper;
+ CoreCoreInfo _coreInfo;
QScriptEngine *scriptEngine;
channellistdlg.cpp
coreconfigwizard.cpp
coreconnectdlg.cpp
+ coreinfodlg.cpp
debugconsole.cpp
inputwidget.cpp
jumpkeyhandler.cpp
channellistdlg.h
coreconfigwizard.h
coreconnectdlg.h
+ coreinfodlg.h
debugconsole.h
inputwidget.h
jumpkeyhandler.h
coreconfigwizardstorageselectionpage.ui
coreconfigwizardsyncpage.ui
coreconnectdlg.ui
+ coreinfodlg.ui
debugconsole.ui
inputwidget.ui
mainwin.ui
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "coreinfodlg.h"
+
+#include "client.h"
+#include "signalproxy.h"
+
+CoreInfoDlg::CoreInfoDlg(QWidget *parent)
+ : QDialog(parent),
+ _coreInfo(this)
+{
+ ui.setupUi(this);
+ connect(&_coreInfo, SIGNAL(initDone()), this, SLOT(coreInfoAvailable()));
+ Client::signalProxy()->synchronize(&_coreInfo);
+}
+
+void CoreInfoDlg::coreInfoAvailable() {
+ ui.labelCoreVersion->setText(_coreInfo["quasselVersion"].toString());
+ ui.labelUptime->setText(_coreInfo["startTime"].toString());
+ ui.labelClientCount->setNum(_coreInfo["sessionConnectedClients"].toInt());
+ // data["quasselBuildDate"] = Global::quasselBuildDate;
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef COREINFODLG_H
+#define COREINFODLG_H
+
+#include "ui_coreinfodlg.h"
+#include <QDialog>
+
+#include "clientcoreinfo.h";
+
+class CoreInfoDlg : public QDialog {
+ Q_OBJECT
+
+public:
+ CoreInfoDlg(QWidget *parent = 0);
+
+public slots:
+ void coreInfoAvailable();
+
+private:
+ Ui::CoreInfoDlg ui;
+ ClientCoreInfo _coreInfo;
+};
+
+#endif //COREINFODLG_H
#include "channellistdlg.h"
#include "client.h"
#include "clientbacklogmanager.h"
+#include "coreinfodlg.h"
#include "coreconnectdlg.h"
#include "networkmodel.h"
#include "buffermodel.h"
void MainWin::setupMenus() {
connect(ui.actionConnectCore, SIGNAL(triggered()), this, SLOT(showCoreConnectionDlg()));
connect(ui.actionDisconnectCore, SIGNAL(triggered()), Client::instance(), SLOT(disconnectFromCore()));
+ connect(ui.actionCoreInfo, SIGNAL(triggered()), this, SLOT(showCoreInfoDlg()));
connect(ui.actionQuit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()));
connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg()));
// connect(ui.actionDebug_Console, SIGNAL(triggered()), this, SLOT(showDebugConsole()));
channelListDlg->show();
}
+void MainWin::showCoreInfoDlg() {
+ CoreInfoDlg dlg(this);
+ dlg.exec();
+}
+
void MainWin::showSettingsDlg() {
settingsDlg->show();
}
void removeBufferView(int bufferViewConfigId);
void receiveMessage(const Message &msg);
void showChannelList(NetworkId netId = NetworkId());
+ void showCoreInfoDlg();
void showSettingsDlg();
void on_actionEditNetworks_triggered();
void on_actionManageViews_triggered();
--- /dev/null
+<ui version="4.0" >
+ <class>CoreInfoDlg</class>
+ <widget class="QDialog" name="CoreInfoDlg" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>284</width>
+ <height>137</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Core Information</string>
+ </property>
+ <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" >
+ <string>Version:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="labelCoreVersion" >
+ <property name="text" >
+ <string><core version></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Uptime:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Connected Clients:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="labelClientCount" >
+ <property name="text" >
+ <string><connected clients></string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="labelUptime" >
+ <property name="text" >
+ <string><core uptime></string>
+ </property>
+ </widget>
+ </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>28</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
</widget>
<addaction name="actionConnectCore" />
<addaction name="actionDisconnectCore" />
+ <addaction name="actionCoreInfo" />
<addaction name="separator" />
<addaction name="menuNetworks" />
<addaction name="actionJoinChannel" />
<string>Edit &Networks...</string>
</property>
</action>
+ <action name="actionCoreInfo" >
+ <property name="icon" >
+ <iconset resource="../../icons/icons.qrc" >
+ <normaloff>:/16x16/actions/oxygen/16x16/actions/help-about.png</normaloff>:/16x16/actions/oxygen/16x16/actions/help-about.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Core Info</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>