More work on fonts - loading/saving.

This commit is contained in:
Martin Rotter 2015-07-12 19:38:14 +02:00
parent 8dfaf913e1
commit 24b0b34a50
3 changed files with 15 additions and 6 deletions

View File

@ -254,6 +254,9 @@ void FormSettings::loadFeedsMessages() {
if (index_format >= 0) {
m_ui->m_cmbMessagesDateTimeFormat->setCurrentIndex(index_format);
}
m_ui->m_cmbMessageFontStandard->setCurrentIndex(m_ui->m_cmbMessageFontStandard->findText(settings->value(GROUP(Messages),
SETTING(Messages::PreviewerFontStandard)).toString()));
}
void FormSettings::initializeMessageDateFormats() {
@ -283,6 +286,10 @@ void FormSettings::saveFeedsMessages() {
m_ui->m_cmbMessagesDateTimeFormat->itemData(m_ui->m_cmbMessagesDateTimeFormat->currentIndex()).toString());
settings->setValue(GROUP(Messages), Messages::RemoveDuplicates, m_ui->m_checkRemoveDuplicateMessages->isChecked());
// Save fonts.
settings->setValue(GROUP(Messages), Messages::PreviewerFontStandard, m_ui->m_cmbMessageFontStandard->currentFont().family());
qApp->mainForm()->tabWidget()->feedMessageViewer()->loadMessageViewerFonts();
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->updateAutoUpdateStatus();
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->reloadWholeLayout();
qApp->mainForm()->tabWidget()->feedMessageViewer()->messagesView()->sourceModel()->updateDateFormat();

View File

@ -419,8 +419,8 @@ MySQL backend will automatically use database with name "rssguard". Do
<rect>
<x>0</x>
<y>0</y>
<width>782</width>
<height>451</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
@ -497,8 +497,8 @@ MySQL backend will automatically use database with name &quot;rssguard&quot;. Do
<rect>
<x>0</x>
<y>0</y>
<width>776</width>
<height>425</height>
<width>167</width>
<height>219</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@ -1459,7 +1459,7 @@ MySQL backend will automatically use database with name &quot;rssguard&quot;. Do
</widget>
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="fontComboBox">
<widget class="QFontComboBox" name="m_cmbMessageFontStandard">
<property name="editable">
<bool>false</bool>
</property>

View File

@ -70,6 +70,7 @@ FeedMessageViewer::FeedMessageViewer(QWidget *parent)
m_dbCleaner(NULL) {
initialize();
initializeViews();
loadMessageViewerFonts();
createConnections();
// Now, update all feeds if user has set it.
@ -144,7 +145,8 @@ void FeedMessageViewer::loadMessageViewerFonts() {
Settings *settings = qApp->settings();
QWebSettings *view_settings = m_messagesBrowser->view()->settings();
// TODO: Setup fonts.
view_settings->setFontFamily(QWebSettings::StandardFont, settings->value(GROUP(Messages),
SETTING(Messages::PreviewerFontStandard)).toString());
}
void FeedMessageViewer::quit() {