diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtMainWindow.cpp | 10 | ||||
-rw-r--r-- | Swift/QtUI/QtMainWindow.h | 1 |
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_; }; |