aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient/mainDialog.cpp
diff options
context:
space:
mode:
authorManjeet Dahiya <manjeetdahiya@gmail.com>2010-10-16 18:02:04 +0000
committerManjeet Dahiya <manjeetdahiya@gmail.com>2010-10-16 18:02:04 +0000
commit15465e82a3929d5e3ef1f01a78eecf9533137a37 (patch)
treea26eef3baceb0a7199ecb6f4d489dc7e0e397eee /examples/GuiClient/mainDialog.cpp
parent6fc68b21ccbf39b3eb964a606ebfd4d75cbb9ff6 (diff)
downloadqxmpp-15465e82a3929d5e3ef1f01a78eecf9533137a37.tar.gz
add action for showing/hiding offline contacts
Diffstat (limited to 'examples/GuiClient/mainDialog.cpp')
-rw-r--r--examples/GuiClient/mainDialog.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp
index 5965c575..d71c269b 100644
--- a/examples/GuiClient/mainDialog.cpp
+++ b/examples/GuiClient/mainDialog.cpp
@@ -222,6 +222,7 @@ void mainDialog::presenceChanged(const QString& bareJid, const QString& resource
QMap<QString, QXmppPresence> presences = m_xmppClient.rosterManager().
getAllPresencesForBareJid(bareJid);
m_rosterItemModel.updatePresence(bareJid, presences);
+// m_rosterItemSortFilterModel.invalidate();
QXmppPresence& pre = presences[resource];
@@ -675,6 +676,13 @@ void mainDialog::createSettingsMenu()
QAction* showXml = new QAction("Show XML Console...", ui->pushButton_settings);
connect(showXml, SIGNAL(triggered()), SLOT(action_showXml()));
settingsMenu->addAction(showXml);
+
+ QAction* showOfflineContacts = new QAction("Show offline contacts", ui->pushButton_settings);
+ showOfflineContacts->setCheckable(true);
+ showOfflineContacts->setChecked(true);
+ connect(showOfflineContacts, SIGNAL(triggered(bool)),
+ &m_rosterItemSortFilterModel, SLOT(setShowOfflineContacts(bool)));
+ settingsMenu->addAction(showOfflineContacts);
}
void mainDialog::closeEvent(QCloseEvent *event)