Merge pull request #2723 from csoler/v0.6-BugFixing_29

removed double saving of distant chat permissions (GUI + libretroshar…
This commit is contained in:
csoler 2023-04-26 10:20:25 +02:00 committed by GitHub
commit e69f788f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,9 +125,6 @@ void ChatPage::updateFontsAndEmotes()
/** Saves the changes on this page */ /** Saves the changes on this page */
void ChatPage::updateChatParams() void ChatPage::updateChatParams()
{ {
// state of distant Chat combobox
Settings->setValue("DistantChat", ui.distantChatComboBox->currentIndex());
Settings->setChatScreenFont(fontTempChat.toString()); Settings->setChatScreenFont(fontTempChat.toString());
NotifyQt::getInstance()->notifyChatFontChanged(); NotifyQt::getInstance()->notifyChatFontChanged();
@ -395,9 +392,23 @@ ChatPage::load()
whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble()); whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble());
Settings->endGroup(); Settings->endGroup();
// state of distant Chat combobox // state of distant Chat combobox
int index = Settings->value("DistantChat", 0).toInt();
whileBlocking(ui.distantChatComboBox)->setCurrentIndex(index); 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()); fontTempChat.fromString(Settings->getChatScreenFont());