fixed font handling for chat config page (Patch from HM)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7826 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-01-08 19:12:47 +00:00
parent 64c8048981
commit bef921f70c
5 changed files with 45 additions and 10 deletions

View file

@ -127,6 +127,7 @@ ChatPage::save(QString &/*errmsg*/)
Settings->endGroup();
Settings->setChatScreenFont(fontTempChat.toString());
NotifyQt::getInstance()->notifyChatFontChanged();
Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
@ -245,8 +246,11 @@ ChatPage::load()
ui.publicChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PUBLIC));
ui.privateChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_PRIVATE));
ui.lobbyChatSaveCount->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY));
ui.labelChatFontPreview->setText(fontTempChat.rawName());
// using fontTempChat.rawname() does not always work!
// see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName
QStringList fontname = fontTempChat.toString().split(",");
ui.labelChatFontPreview->setText(fontname[0]);
ui.labelChatFontPreview->setFont(fontTempChat);
ui.max_storage_period->setValue(rsHistory->getMaxStorageDuration()/86400) ;
@ -298,7 +302,10 @@ void ChatPage::on_pushButtonChangeChatFont_clicked()
QFont font = QFontDialog::getFont(&ok, fontTempChat, this);
if (ok) {
fontTempChat = font;
ui.labelChatFontPreview->setText(fontTempChat.rawName());
// using fontTempChat.rawname() does not always work!
// see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName
QStringList fontname = fontTempChat.toString().split(",");
ui.labelChatFontPreview->setText(fontname[0]);
ui.labelChatFontPreview->setFont(fontTempChat);
}
}