--- /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 "debugbufferviewoverlay.h"
+
+#include <QFormLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QTextEdit>
+
+#include "buffermodel.h"
+#include "bufferviewoverlay.h"
+#include "bufferviewoverlayfilter.h"
+#include "client.h"
+
+DebugBufferViewOverlay::DebugBufferViewOverlay(QWidget *parent)
+ : QWidget(parent)
+{
+ ui.setupUi(this);
+
+ BufferViewOverlayFilter *filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay());
+
+ filter->setParent(ui.bufferView);
+
+ ui.bufferView->setModel(filter);
+ ui.bufferView->setColumnWidth(0, 250);
+ ui.bufferView->setColumnWidth(1, 250);
+ ui.bufferView->setColumnWidth(2, 80);
+ ui.bufferView->resize(610, 300);
+ ui.bufferView->show();
+
+ QFormLayout *layout = new QFormLayout(ui.overlayProperties);
+ layout->addRow(tr("BufferViews:"), _bufferViews = new QLineEdit(this));
+ layout->addRow(tr("All Networks:"), _allNetworks = new QLabel(this));
+ layout->addRow(tr("Networks:"), _networks = new QLineEdit(this));
+ layout->addRow(tr("Buffers:"), _bufferIds = new QTextEdit(this));
+ layout->addRow(tr("Removed buffers:"), _removedBufferIds = new QTextEdit(this));
+ layout->addRow(tr("Temp. removed buffers:"), _tempRemovedBufferIds = new QTextEdit(this));
+
+ layout->addRow(tr("Add Bufers Automatically:"), _addBuffersAutomatically = new QLabel(this));
+ layout->addRow(tr("Hide inactive buffers:"), _hideInactiveBuffers = new QLabel(this));
+ layout->addRow(tr("Allowed buffer types:"), _allowedBufferTypes = new QLabel(this));
+ layout->addRow(tr("Minimum activity:"), _minimumActivity = new QLabel(this));
+
+ layout->addRow(tr("Is initialized:"), _isInitialized = new QLabel(this));
+
+ update();
+ connect(Client::bufferViewOverlay(), SIGNAL(hasChanged()), this, SLOT(update()));
+}
+
+void DebugBufferViewOverlay::update() {
+ BufferViewOverlay *overlay = Client::bufferViewOverlay();
+
+ _allNetworks->setText(overlay->allNetworks() ? "yes" : "no");
+
+ QStringList ids;
+ foreach(int bufferViewId, overlay->bufferViewIds()) {
+ ids << QString::number(bufferViewId);
+ }
+ _bufferViews->setText(ids.join(", "));
+
+ ids.clear();
+ foreach(NetworkId networkId, overlay->networkIds()) {
+ ids << QString::number(networkId.toInt());
+ }
+ _networks->setText(ids.join(", "));
+
+ ids.clear();
+ foreach(BufferId bufferId, overlay->bufferIds()) {
+ ids << QString::number(bufferId.toInt());
+ }
+ _bufferIds->setText(ids.join(", "));
+
+ ids.clear();
+ foreach(BufferId bufferId, overlay->removedBufferIds()) {
+ ids << QString::number(bufferId.toInt());
+ }
+ _removedBufferIds->setText(ids.join(", "));
+
+ ids.clear();
+ foreach(BufferId bufferId, overlay->tempRemovedBufferIds()) {
+ ids << QString::number(bufferId.toInt());
+ }
+ _tempRemovedBufferIds->setText(ids.join(", "));
+
+ _addBuffersAutomatically->setText(overlay->addBuffersAutomatically() ? "yes" : "no");
+ _hideInactiveBuffers->setText(overlay->hideInactiveBuffers() ? "yes" : "no");
+ _allowedBufferTypes->setText(QString::number(overlay->allowedBufferTypes()));
+ _minimumActivity->setText(QString::number(overlay->minimumActivity()));
+
+ _isInitialized->setText(overlay->isInitialized() ? "yes" : "no");
+}
--- /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 DEBUGBUFFERVIEWOVERLAY_H
+#define DEBUGBUFFERVIEWOVERLAY_H
+
+#include "ui_debugbufferviewoverlay.h"
+
+class QLabel;
+class QLineEdit;
+class QTextEdit;
+
+class DebugBufferViewOverlay : public QWidget {
+ Q_OBJECT
+
+public:
+ DebugBufferViewOverlay(QWidget *parent = 0);
+
+private slots:
+ void update();
+
+private:
+ Ui::DebugBufferViewOverlay ui;
+ QLineEdit *_bufferViews;
+ QLabel *_allNetworks;
+ QLineEdit *_networks;
+ QTextEdit *_bufferIds;
+ QTextEdit *_removedBufferIds;
+ QTextEdit *_tempRemovedBufferIds;
+ QLabel *_addBuffersAutomatically;
+ QLabel *_hideInactiveBuffers;
+ QLabel *_allowedBufferTypes;
+ QLabel *_minimumActivity;
+ QLabel *_isInitialized;
+};
+
+#endif //DEBUGBUFFERVIEWOVERLAY_H
#include "coreinfodlg.h"
#include "coreconnectdlg.h"
#include "contextmenuactionprovider.h"
+#include "debugbufferviewoverlay.h"
#include "debuglogwidget.h"
#include "debugmessagemodelfilter.h"
#include "iconloader.h"
}
void MainWin::on_actionDebugBufferViewOverlay_triggered() {
- QTreeView *view = new QTreeView;
- view->setAttribute(Qt::WA_DeleteOnClose);
- view->setWindowTitle("Debug BufferViewOverlay View");
- BufferViewOverlayFilter *filter = new BufferViewOverlayFilter(Client::bufferModel(), Client::bufferViewOverlay());
- filter->setParent(view);
- view->setModel(filter);
- view->setColumnWidth(0, 250);
- view->setColumnWidth(1, 250);
- view->setColumnWidth(2, 80);
- view->resize(610, 300);
- view->show();
+ DebugBufferViewOverlay *overlay = new DebugBufferViewOverlay(0);
+ overlay->setAttribute(Qt::WA_DeleteOnClose);
+ overlay->show();
}
void MainWin::on_actionDebugMessageModel_triggered() {
--- /dev/null
+<ui version="4.0" >
+ <class>DebugBufferViewOverlay</class>
+ <widget class="QWidget" name="DebugBufferViewOverlay" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>580</width>
+ <height>545</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Debug BufferView Overlay</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="overlayView" >
+ <attribute name="title" >
+ <string>Overlay View</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTreeView" name="bufferView" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="overlayProperties" >
+ <attribute name="title" >
+ <string>Overlay Properties</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>