fixed #385
This commit is contained in:
parent
991ded863a
commit
5100b5195a
5 changed files with 36 additions and 13 deletions
|
@ -37,6 +37,7 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
||||||
connect(m_ui->m_spinHeightRowsFeeds, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
connect(m_ui->m_spinHeightRowsFeeds, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
this, &SettingsFeedsMessages::requireRestart);
|
this, &SettingsFeedsMessages::requireRestart);
|
||||||
|
|
||||||
|
connect(m_ui->m_cbHideCountsIfNoUnread, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
connect(m_ui->m_checkAutoUpdateNotification, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
connect(m_ui->m_checkAutoUpdateNotification, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
connect(m_ui->m_checkAutoUpdate, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
connect(m_ui->m_checkAutoUpdate, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
connect(m_ui->m_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
connect(m_ui->m_checkAutoUpdateOnlyUnfocused, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
|
||||||
|
@ -127,6 +128,7 @@ void SettingsFeedsMessages::loadSettings() {
|
||||||
m_ui->m_spinHeightRowsMessages->setValue(settings()->value(GROUP(GUI), SETTING(GUI::HeightRowMessages)).toInt());
|
m_ui->m_spinHeightRowsMessages->setValue(settings()->value(GROUP(GUI), SETTING(GUI::HeightRowMessages)).toInt());
|
||||||
m_ui->m_spinHeightRowsFeeds->setValue(settings()->value(GROUP(GUI), SETTING(GUI::HeightRowFeeds)).toInt());
|
m_ui->m_spinHeightRowsFeeds->setValue(settings()->value(GROUP(GUI), SETTING(GUI::HeightRowFeeds)).toInt());
|
||||||
|
|
||||||
|
m_ui->m_cbHideCountsIfNoUnread->setChecked(settings()->value(GROUP(Feeds), SETTING(Feeds::HideCountsIfNoUnread)).toBool());
|
||||||
m_ui->m_checkDisplayFeedIcons->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayFeedIconsInList)).toBool());
|
m_ui->m_checkDisplayFeedIcons->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayFeedIconsInList)).toBool());
|
||||||
m_ui->m_checkBringToForegroundAfterMsgOpened->setChecked(settings()->value(GROUP(Messages),
|
m_ui->m_checkBringToForegroundAfterMsgOpened->setChecked(settings()->value(GROUP(Messages),
|
||||||
SETTING(Messages::BringAppToFrontAfterMessageOpenedExternally)).toBool());
|
SETTING(Messages::BringAppToFrontAfterMessageOpenedExternally)).toBool());
|
||||||
|
@ -186,6 +188,7 @@ void SettingsFeedsMessages::saveSettings() {
|
||||||
settings()->setValue(GROUP(GUI), GUI::HeightRowMessages, m_ui->m_spinHeightRowsMessages->value());
|
settings()->setValue(GROUP(GUI), GUI::HeightRowMessages, m_ui->m_spinHeightRowsMessages->value());
|
||||||
settings()->setValue(GROUP(GUI), GUI::HeightRowFeeds, m_ui->m_spinHeightRowsFeeds->value());
|
settings()->setValue(GROUP(GUI), GUI::HeightRowFeeds, m_ui->m_spinHeightRowsFeeds->value());
|
||||||
|
|
||||||
|
settings()->setValue(GROUP(Feeds), Feeds::HideCountsIfNoUnread, m_ui->m_cbHideCountsIfNoUnread->isChecked());
|
||||||
settings()->setValue(GROUP(Messages), Messages::DisplayFeedIconsInList, m_ui->m_checkDisplayFeedIcons->isChecked());
|
settings()->setValue(GROUP(Messages), Messages::DisplayFeedIconsInList, m_ui->m_checkDisplayFeedIcons->isChecked());
|
||||||
settings()->setValue(GROUP(Messages), Messages::BringAppToFrontAfterMessageOpenedExternally,
|
settings()->setValue(GROUP(Messages), Messages::BringAppToFrontAfterMessageOpenedExternally,
|
||||||
m_ui->m_checkBringToForegroundAfterMsgOpened->isChecked());
|
m_ui->m_checkBringToForegroundAfterMsgOpened->isChecked());
|
||||||
|
|
|
@ -70,13 +70,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="m_checkAutoUpdateOnlyUnfocused">
|
|
||||||
<property name="text">
|
|
||||||
<string>Only auto-download messages when application is unfocused</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_6">
|
<widget class="QGroupBox" name="groupBox_6">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -214,7 +207,7 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
|
@ -232,7 +225,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0" colspan="2">
|
<item row="10" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -245,6 +238,20 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_cbHideCountsIfNoUnread">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide message counts if there are no unread messages</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkAutoUpdateOnlyUnfocused">
|
||||||
|
<property name="text">
|
||||||
|
<string>Only auto-download messages when application is unfocused</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="m_tabMessages">
|
<widget class="QWidget" name="m_tabMessages">
|
||||||
|
@ -449,6 +456,7 @@
|
||||||
<tabstop>m_spinFeedUpdateTimeout</tabstop>
|
<tabstop>m_spinFeedUpdateTimeout</tabstop>
|
||||||
<tabstop>m_spinHeightRowsFeeds</tabstop>
|
<tabstop>m_spinHeightRowsFeeds</tabstop>
|
||||||
<tabstop>m_cmbCountsFeedList</tabstop>
|
<tabstop>m_cmbCountsFeedList</tabstop>
|
||||||
|
<tabstop>m_cbHideCountsIfNoUnread</tabstop>
|
||||||
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
|
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
|
||||||
<tabstop>m_checkDisplayPlaceholders</tabstop>
|
<tabstop>m_checkDisplayPlaceholders</tabstop>
|
||||||
<tabstop>m_checkDisplayFeedIcons</tabstop>
|
<tabstop>m_checkDisplayFeedIcons</tabstop>
|
||||||
|
|
|
@ -63,6 +63,9 @@ DVALUE(bool) Feeds::ShowOnlyUnreadFeedsDef = false;
|
||||||
DKEY Feeds::ShowTreeBranches = "show_tree_branches";
|
DKEY Feeds::ShowTreeBranches = "show_tree_branches";
|
||||||
DVALUE(bool) Feeds::ShowTreeBranchesDef = true;
|
DVALUE(bool) Feeds::ShowTreeBranchesDef = true;
|
||||||
|
|
||||||
|
DKEY Feeds::HideCountsIfNoUnread = "hide_counts_if_no_unread";
|
||||||
|
DVALUE(bool) Feeds::HideCountsIfNoUnreadDef = false;
|
||||||
|
|
||||||
DKEY Feeds::AutoExpandOnSelection = "auto_expand_on_selection";
|
DKEY Feeds::AutoExpandOnSelection = "auto_expand_on_selection";
|
||||||
DVALUE(bool) Feeds::AutoExpandOnSelectionDef = false;
|
DVALUE(bool) Feeds::AutoExpandOnSelectionDef = false;
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ namespace Feeds {
|
||||||
KEY ShowTreeBranches;
|
KEY ShowTreeBranches;
|
||||||
VALUE(bool) ShowTreeBranchesDef;
|
VALUE(bool) ShowTreeBranchesDef;
|
||||||
|
|
||||||
|
KEY HideCountsIfNoUnread;
|
||||||
|
VALUE(bool) HideCountsIfNoUnreadDef;
|
||||||
|
|
||||||
KEY AutoExpandOnSelection;
|
KEY AutoExpandOnSelection;
|
||||||
VALUE(bool) AutoExpandOnSelectionDef;
|
VALUE(bool) AutoExpandOnSelectionDef;
|
||||||
|
|
||||||
|
|
|
@ -167,12 +167,18 @@ QVariant RootItem::data(int column, int role) const {
|
||||||
return m_title;
|
return m_title;
|
||||||
}
|
}
|
||||||
else if (column == FDS_MODEL_COUNTS_INDEX) {
|
else if (column == FDS_MODEL_COUNTS_INDEX) {
|
||||||
int count_all = countOfAllMessages();
|
|
||||||
int count_unread = countOfUnreadMessages();
|
int count_unread = countOfUnreadMessages();
|
||||||
|
|
||||||
return qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::CountFormat)).toString()
|
if (count_unread <= 0 && qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::HideCountsIfNoUnread)).toBool()) {
|
||||||
.replace(PLACEHOLDER_UNREAD_COUNTS, count_unread < 0 ? QSL("-") : QString::number(count_unread))
|
return QString();
|
||||||
.replace(PLACEHOLDER_ALL_COUNTS, count_all < 0 ? QSL("-") : QString::number(count_all));
|
}
|
||||||
|
else {
|
||||||
|
int count_all = countOfAllMessages();
|
||||||
|
|
||||||
|
return qApp->settings()->value(GROUP(Feeds), SETTING(Feeds::CountFormat)).toString()
|
||||||
|
.replace(PLACEHOLDER_UNREAD_COUNTS, count_unread < 0 ? QSL("-") : QString::number(count_unread))
|
||||||
|
.replace(PLACEHOLDER_ALL_COUNTS, count_all < 0 ? QSL("-") : QString::number(count_all));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
Loading…
Add table
Reference in a new issue