From a04ab8664f65e9502403f87710254c2eb520f95a Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 25 Apr 2023 21:26:26 +0200 Subject: [PATCH] removed double saving of distant chat permissions (GUI + libretroshare) leading to inconsistencies --- retroshare-gui/src/gui/settings/ChatPage.cpp | 23 +++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 86cfaf816..1f35fe62c 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -125,9 +125,6 @@ void ChatPage::updateFontsAndEmotes() /** Saves the changes on this page */ void ChatPage::updateChatParams() { - // state of distant Chat combobox - Settings->setValue("DistantChat", ui.distantChatComboBox->currentIndex()); - Settings->setChatScreenFont(fontTempChat.toString()); NotifyQt::getInstance()->notifyChatFontChanged(); @@ -395,9 +392,23 @@ ChatPage::load() whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble()); Settings->endGroup(); - // state of distant Chat combobox - int index = Settings->value("DistantChat", 0).toInt(); - whileBlocking(ui.distantChatComboBox)->setCurrentIndex(index); + // state of distant Chat combobox + + switch(rsMsgs->getDistantChatPermissionFlags()) + { + default: + case RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NONE: + whileBlocking(ui.distantChatComboBox)->setCurrentIndex(0); + break ; + + case RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_NON_CONTACTS: + whileBlocking(ui.distantChatComboBox)->setCurrentIndex(1); + break ; + + case RS_DISTANT_CHAT_CONTACT_PERMISSION_FLAG_FILTER_EVERYBODY: + whileBlocking(ui.distantChatComboBox)->setCurrentIndex(2); + break ; + } fontTempChat.fromString(Settings->getChatScreenFont());