Requests are now more verbose (status bar) so one know, that the request really did trigger.
#include <QObject>
+#include "backlogsettings.h"
#include "clientbacklogmanager.h"
BacklogRequester::BacklogRequester(bool buffering, ClientBacklogManager *backlogManager)
// FIXED BACKLOG REQUESTER
// ========================================
FixedBacklogRequester::FixedBacklogRequester(ClientBacklogManager *backlogManager)
- : BacklogRequester(true, backlogManager),
- _backlogCount(500)
+ : BacklogRequester(true, backlogManager)
{
+ BacklogSettings backlogSettings;
+ _backlogCount = backlogSettings.fixedBacklogAmount();
}
void FixedBacklogRequester::requestBacklog() {
#include <QEvent>
+#include "backlogsettings.h"
#include "clientbacklogmanager.h"
#include "client.h"
#include "message.h"
if(_messagesWaiting.contains(bufferId))
return;
- static const int REQUEST_COUNT = 500;
+ BacklogSettings backlogSettings;
+ int requestCount = backlogSettings.dynamicBacklogAmount();
for(int i = 0; i < _messageList.count(); i++) {
if(_messageList.at(i)->bufferId() == bufferId) {
- _messagesWaiting[bufferId] = REQUEST_COUNT;
+ _messagesWaiting[bufferId] = requestCount;
Client::backlogManager()->emitMessagesRequested(tr("Requesting %1 messages from backlog for buffer %2:%3")
- .arg(REQUEST_COUNT)
+ .arg(requestCount)
.arg(Client::networkModel()->networkName(bufferId))
.arg(Client::networkModel()->bufferName(bufferId)));
- Client::backlogManager()->requestBacklog(bufferId, REQUEST_COUNT, _messageList.at(i)->msgId().toInt());
+ Client::backlogManager()->requestBacklog(bufferId, requestCount, _messageList.at(i)->msgId().toInt());
return;
}
}
#include "qtui.h"
#include "qtuisettings.h"
+#include "backlogsettings.h"
#include "buffersettings.h"
GeneralSettingsPage::GeneralSettingsPage(QWidget *parent)
connect(ui.displayTopicInTooltip, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.mouseWheelChangesBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.completionSuffix, SIGNAL(textEdited(const QString&)), this, SLOT(widgetHasChanged()));
+ connect(ui.fixedBacklogAmount, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
+ connect(ui.dynamicBacklogAmount, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
}
bool GeneralSettingsPage::hasDefaults() const {
settings["CompletionSuffix"] = uiSettings.value("CompletionSuffix", QString(": "));
ui.completionSuffix->setText(settings["CompletionSuffix"].toString());
+ // backlogSettings:
+ BacklogSettings backlogSettings;
+ settings["FixedBacklogAmount"] = backlogSettings.fixedBacklogAmount();
+ ui.fixedBacklogAmount->setValue(backlogSettings.fixedBacklogAmount());
+
+ settings["DynamicBacklogAmount"] = backlogSettings.dynamicBacklogAmount();
+ ui.dynamicBacklogAmount->setValue(backlogSettings.dynamicBacklogAmount());
+
setChangedState(false);
}
uiSettings.setValue("CompletionSuffix", ui.completionSuffix->text());
+
+ BacklogSettings backlogSettings;
+ backlogSettings.setFixedBacklogAmount(ui.fixedBacklogAmount->value());
+ backlogSettings.setDynamicBacklogAmount(ui.dynamicBacklogAmount->value());
+
load();
setChangedState(false);
}
if(settings["CompletionSuffix"].toString() != ui.completionSuffix->text()) return true;
+ if(settings["FixedBacklogAmount"].toInt() != ui.fixedBacklogAmount->value()) return true;
+ if(settings["DynamicBacklogAmount"].toInt() != ui.dynamicBacklogAmount->value()) return true;
+
return false;
}
<rect>
<x>0</x>
<y>0</y>
- <width>453</width>
- <height>467</height>
+ <width>542</width>
+ <height>599</height>
</rect>
</property>
<property name="windowTitle" >
</widget>
</item>
<item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>20</width>
- <height>40</height>
- </size>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="title" >
+ <string>Backlog</string>
</property>
- </spacer>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="toolTip" >
+ <string>amount of messages per buffer that are requested after the core connection has been established.</string>
+ </property>
+ <property name="text" >
+ <string>Initial backlog amount:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QSpinBox" name="fixedBacklogAmount" >
+ <property name="maximum" >
+ <number>1000</number>
+ </property>
+ <property name="singleStep" >
+ <number>10</number>
+ </property>
+ <property name="value" >
+ <number>500</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="toolTip" >
+ <string>Number of messages to be requested from the core when using scrolling up in the buffer view.</string>
+ </property>
+ <property name="text" >
+ <string>Dynamic backlog amount:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QSpinBox" name="dynamicBacklogAmount" >
+ <property name="maximum" >
+ <number>1000</number>
+ </property>
+ <property name="singleStep" >
+ <number>10</number>
+ </property>
+ <property name="value" >
+ <number>200</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</item>
</layout>
</widget>