summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-06 15:37:53 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-06 16:48:25 (GMT)
commit3f5f23dcf7a07638c04accd86c06a70c22dd9e8d (patch)
tree3994c36ffe906e71499131c97356d2c6ae4cd5f7 /Swift/QtUI
parent6e219bf4a63459461a0a6009b1e3dafedda9e033 (diff)
downloadswift-contrib-3f5f23dcf7a07638c04accd86c06a70c22dd9e8d.zip
swift-contrib-3f5f23dcf7a07638c04accd86c06a70c22dd9e8d.tar.bz2
Load 'show offline' for new sessions
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtMainWindow.cpp10
-rw-r--r--Swift/QtUI/QtMainWindow.h1
2 files changed, 3 insertions, 8 deletions
diff --git a/Swift/QtUI/QtMainWindow.cpp b/Swift/QtUI/QtMainWindow.cpp
index 18fb43c..ea888d5 100644
--- a/Swift/QtUI/QtMainWindow.cpp
+++ b/Swift/QtUI/QtMainWindow.cpp
@@ -89,6 +89,7 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
showOfflineAction_->setChecked(false);
connect(showOfflineAction_, SIGNAL(toggled(bool)), SLOT(handleShowOfflineToggled(bool)));
viewMenu->addAction(showOfflineAction_);
+ handleShowOfflineToggled(settings_->getSetting(SettingConstants::SHOW_OFFLINE));
//QAction* compactRosterAction_ = new QAction(tr("&Compact Roster"), this);
//compactRosterAction_->setCheckable(true);
@@ -135,8 +136,6 @@ QtMainWindow::QtMainWindow(SettingsProvider* settings, UIEventStream* uiEventStr
serverAdHocMenu_->addAction(adHocAction);
serverAdHocCommandActions_.append(adHocAction);
- lastOfflineState_ = false;
-
settings_->onSettingChanged.connect(boost::bind(&QtMainWindow::handleSettingChanged, this, _1));
}
@@ -227,11 +226,8 @@ void QtMainWindow::handleSettingChanged(const std::string& settingPath) {
}
void QtMainWindow::handleShowOfflineToggled(bool state) {
- if (state != lastOfflineState_) {
- lastOfflineState_ = state;
- showOfflineAction_->setChecked(state);
- settings_->storeSetting(SettingConstants::SHOW_OFFLINE, state);
- }
+ settings_->storeSetting(SettingConstants::SHOW_OFFLINE, state);
+ showOfflineAction_->setChecked(settings_->getSetting(SettingConstants::SHOW_OFFLINE));
}
void QtMainWindow::setMyNick(const std::string& nick) {
diff --git a/Swift/QtUI/QtMainWindow.h b/Swift/QtUI/QtMainWindow.h
index 44f8a25..bef483d 100644
--- a/Swift/QtUI/QtMainWindow.h
+++ b/Swift/QtUI/QtMainWindow.h
@@ -83,7 +83,6 @@ namespace Swift {
QtEventWindow* eventWindow_;
QtChatListWindow* chatListWindow_;
UIEventStream* uiEventStream_;
- bool lastOfflineState_;
std::vector<DiscoItems::Item> serverAdHocCommands_;
QList<QAction*> serverAdHocCommandActions_;
};