connect(bufferSyncer(), SIGNAL(bufferRenamed(BufferId, QString)), this, SLOT(bufferRenamed(BufferId, QString)));
connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), this, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), _messageModel, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
- connect(networkModel(), SIGNAL(setLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
+ connect(bufferSyncer(), SIGNAL(bufferMarkedAsRead(BufferId)), SIGNAL(bufferMarkedAsRead(BufferId)));
+ connect(networkModel(), SIGNAL(requestSetLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
signalProxy()->synchronize(bufferSyncer());
// create a new BufferViewManager
Q_ASSERT(!_bufferViewManager);
_bufferViewManager = new ClientBufferViewManager(signalProxy(), this);
- connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(createDefaultBufferView()));
+ connect(_bufferViewManager, SIGNAL(initDone()), _bufferViewOverlay, SLOT(restore()));
// create AliasManager
Q_ASSERT(!_aliasManager);
// triggers this slot. But we have to make sure that we know all buffers yet.
// so we check the BufferSyncer and in case it wasn't initialized we wait for that instead
if(!bufferSyncer()->isInitialized()) {
- connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+ disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
return;
}
- _backlogManager->requestInitialBacklog();
-}
+ disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+ disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
-void Client::createDefaultBufferView() {
- if(bufferViewManager()->bufferViewConfigs().isEmpty()) {
- BufferViewConfig config(-1);
- config.setBufferViewName(tr("All Chats"));
- config.initSetBufferList(networkModel()->allBufferIdsSorted());
- bufferViewManager()->requestCreateBufferView(config.toVariantMap());
- }
+ _backlogManager->requestInitialBacklog();
}
void Client::disconnectFromCore() {
_bufferViewManager = 0;
}
+ _bufferViewOverlay->reset();
+
if(_aliasManager) {
_aliasManager->deleteLater();
_aliasManager = 0;
bufferSyncer()->requestSetLastSeenMsg(id, msgId);
}
-void Client::setBufferMarkerLine(BufferId id, const MsgId &msgId) {
+void Client::setMarkerLine(BufferId id, const MsgId &msgId) {
if(bufferSyncer())
bufferSyncer()->requestSetMarkerLine(id, msgId);
}
+MsgId Client::markerLine(BufferId id) {
+ if(id.isValid() && networkModel())
+ return networkModel()->markerLineMsgId(id);
+ return MsgId();
+}
+
void Client::removeBuffer(BufferId id) {
if(!bufferSyncer()) return;
bufferSyncer()->requestRemoveBuffer(id);
networkModel()->removeBuffer(bufferId2);
}
+void Client::markBufferAsRead(BufferId id) {
+ if(bufferSyncer() && id.isValid())
+ bufferSyncer()->requestMarkBufferAsRead(id);
+}
+
void Client::logMessage(QtMsgType type, const char *msg) {
fprintf(stderr, "%s\n", msg);
fflush(stderr);