summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-10-16 07:08:59 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-10-16 07:08:59 (GMT)
commita8705f484480854816bc6807f1c56b0cf987faff (patch)
tree759fc843b78c16915562d2db0726c018cbaeb42d /Swift
parent87775c50a1c9a223f554c37e549ea8a2b03c9a89 (diff)
downloadswift-a8705f484480854816bc6807f1c56b0cf987faff.zip
swift-a8705f484480854816bc6807f1c56b0cf987faff.tar.bz2
Mark as offline in the roster after an error.
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp2
-rw-r--r--Swift/Controllers/MainWindow.h1
-rw-r--r--Swift/QtUI/QtMainWindow.cpp4
-rw-r--r--Swift/QtUI/QtMainWindow.h1
-rw-r--r--Swift/QtUI/QtRosterHeader.cpp4
-rw-r--r--Swift/QtUI/QtRosterHeader.h1
-rw-r--r--Swift/QtUI/QtStatusWidget.cpp9
-rw-r--r--Swift/QtUI/QtStatusWidget.h1
8 files changed, 23 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 8bd9435..6c862ec 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -291,6 +291,8 @@ void MainController::logout() {
if (client_ && client_->isAvailable()) {
client_->disconnect();
}
+ rosterController_->getWindow()->setMyStatusType(StatusShow::None);
+ rosterController_->getWindow()->setMyStatusText("");
setManagersEnabled(false);
}
diff --git a/Swift/Controllers/MainWindow.h b/Swift/Controllers/MainWindow.h
index 93345ff..b15cbb5 100644
--- a/Swift/Controllers/MainWindow.h
+++ b/Swift/Controllers/MainWindow.h
@@ -18,6 +18,7 @@ namespace Swift {
virtual void setMyName(const String& name) = 0;
virtual void setMyAvatarPath(const String& path) = 0;
virtual void setMyStatusText(const String& status) = 0;
+ virtual void setMyStatusType(StatusShow::Type type) = 0;
boost::signal<void (const JID&)> onStartChatRequest;
boost::signal<void (const JID&, const String&)> onAddContactRequest;
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index ed7e67b..2643a1b 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -124,5 +124,9 @@ void QtMainWindow::setMyStatusText(const String& status) {
meView_->setStatusText(P2QSTRING(status));
}
+void QtMainWindow::setMyStatusType(StatusShow::Type type) {
+ meView_->setStatusType(type);
+}
+
}
diff --git a/Swift/QtUI/QtMainWindow.h b/Swift/QtUI/QtMainWindow.h
index afe6ccd..e0b4305 100644
--- a/Swift/QtUI/QtMainWindow.h
+++ b/Swift/QtUI/QtMainWindow.h
@@ -31,6 +31,7 @@ namespace Swift {
void setMyName(const String& name);
void setMyAvatarPath(const String& path);
void setMyStatusText(const String& status);
+ void setMyStatusType(const StatusShow::Type type);
private slots:
void handleStatusChanged(StatusShow::Type showType, const QString &statusMessage);
void handleShowOfflineToggled(bool);
diff --git a/Swift/QtUI/QtRosterHeader.cpp b/Swift/QtUI/QtRosterHeader.cpp
index b8463b7..32ad9c6 100644
--- a/Swift/QtUI/QtRosterHeader.cpp
+++ b/Swift/QtUI/QtRosterHeader.cpp
@@ -90,6 +90,10 @@ void QtRosterHeader::setStatusText(const QString& statusMessage) {
statusEdit_->setText(statusMessage);
}
+void QtRosterHeader::setStatusType(StatusShow::Type type) {
+ statusWidget_->setStatusType(type);
+}
+
void QtRosterHeader::setName(const QString& name) {
name_ = name;
resizeNameLabel();
diff --git a/Swift/QtUI/QtRosterHeader.h b/Swift/QtUI/QtRosterHeader.h
index 66c9333..0c11c02 100644
--- a/Swift/QtUI/QtRosterHeader.h
+++ b/Swift/QtUI/QtRosterHeader.h
@@ -22,6 +22,7 @@ namespace Swift {
void setAvatar(const QString& path);
void setName(const QString& name);
void setStatusText(const QString& statusMessage);
+ void setStatusType(StatusShow::Type type);
QSize sizeHint() const;
void emitStatus();
signals:
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index b89d5bb..7002d90 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -30,6 +30,15 @@ StatusShow::Type QtStatusWidget::getSelectedStatusShow() {
return (StatusShow::Type)types_->itemData(types_->currentIndex()).toInt();
}
+void QtStatusWidget::setStatusType(StatusShow::Type type) {
+ for (int i = 0; i < types_->count(); i++) {
+ if (types_->itemData(i).toInt() == type) {
+ types_->setCurrentIndex(i);
+ break;
+ }
+ }
+}
+
}
diff --git a/Swift/QtUI/QtStatusWidget.h b/Swift/QtUI/QtStatusWidget.h
index a1c345d..d6372cb 100644
--- a/Swift/QtUI/QtStatusWidget.h
+++ b/Swift/QtUI/QtStatusWidget.h
@@ -14,6 +14,7 @@ namespace Swift {
public:
QtStatusWidget(QWidget *parent);
StatusShow::Type getSelectedStatusShow();
+ void setStatusType(StatusShow::Type type);
signals:
void onChangeStatusRequest(StatusShow::Type showType);
private slots: