summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-04-27 14:58:37 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-04-27 14:58:37 (GMT)
commit9e57b31133edad6a543da05aca54ee94d589b090 (patch)
tree85b5fa4c4669677a5b4e6d263bbf153077bee357 /Swift/QtUI
parentc1944713513ae5262e9960a7ef391f4bb915e999 (diff)
downloadswift-9e57b31133edad6a543da05aca54ee94d589b090.zip
swift-9e57b31133edad6a543da05aca54ee94d589b090.tar.bz2
Reset state of collapsing presence when a chat window is cleared.
To stop new presence being lost because it's trying to append to old (deleted) data. Resolves: #925
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtChatView.cpp1
-rw-r--r--Swift/QtUI/QtChatView.h1
-rw-r--r--Swift/QtUI/QtChatWindow.cpp4
-rw-r--r--Swift/QtUI/QtChatWindow.h1
4 files changed, 7 insertions, 0 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index e1d718f..54bce09 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -76,6 +76,7 @@ void QtChatView::handleClearRequested() {
messageBox.setDefaultButton(QMessageBox::Yes);
int button = messageBox.exec();
if (button == QMessageBox::Yes) {
+ logCleared();
resetView();
}
}
diff --git a/Swift/QtUI/QtChatView.h b/Swift/QtUI/QtChatView.h
index 6b40c05..2e64593 100644
--- a/Swift/QtUI/QtChatView.h
+++ b/Swift/QtUI/QtChatView.h
@@ -47,6 +47,7 @@ namespace Swift {
signals:
void gotFocus();
void fontResized(int);
+ void logCleared();
public slots:
void copySelectionToClipboard();
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp
index ed134aa..1a82a66 100644
--- a/Swift/QtUI/QtChatWindow.cpp
+++ b/Swift/QtUI/QtChatWindow.cpp
@@ -164,6 +164,7 @@ QtChatWindow::QtChatWindow(const QString &contact, QtChatTheme* theme, UIEventSt
connect(messageLog_, SIGNAL(gotFocus()), input_, SLOT(setFocus()));
resize(400,300);
connect(messageLog_, SIGNAL(fontResized(int)), this, SIGNAL(fontResized(int)));
+ connect(messageLog_, SIGNAL(logCleared()), this, SLOT(handleLogCleared()));
treeWidget_->onSomethingSelectedChanged.connect(boost::bind(&QtChatWindow::handleOccupantSelectionChanged, this, _1));
treeWidget_->onOccupantActionSelected.connect(boost::bind(boost::ref(onOccupantActionSelected), _1, _2));
@@ -180,6 +181,9 @@ QtChatWindow::~QtChatWindow() {
}
}
+void QtChatWindow::handleLogCleared() {
+ onLogCleared();
+}
void QtChatWindow::handleOccupantSelectionChanged(RosterItem* item) {
onOccupantSelectionChanged(dynamic_cast<ContactRosterItem*>(item));
diff --git a/Swift/QtUI/QtChatWindow.h b/Swift/QtUI/QtChatWindow.h
index 1d1959d..4b888eb 100644
--- a/Swift/QtUI/QtChatWindow.h
+++ b/Swift/QtUI/QtChatWindow.h
@@ -118,6 +118,7 @@ namespace Swift {
void showEvent(QShowEvent* event);
private slots:
+ void handleLogCleared();
void returnPressed();
void handleInputChanged();
void handleCursorPositionChanged();