fixed #205, version bump

This commit is contained in:
Martin Rotter 2019-05-31 08:33:02 +02:00
parent 9716ab5422
commit 5e420f66d4
8 changed files with 69 additions and 18 deletions

View File

@ -30,7 +30,7 @@
<url type="donation">https://martinrotter.github.io/donate/</url>
<content_rating type="oars-1.1" />
<releases>
<release version="3.5.7" date="2019-05-28"/>
<release version="3.5.7" date="2019-05-31"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

View File

@ -51,7 +51,7 @@ APP_REVERSE_NAME = "com.github.rssguard"
APP_LOW_H_NAME = ".rssguard"
APP_AUTHOR = "Martin Rotter"
APP_COPYRIGHT = "(C) 2011-2019 $$APP_AUTHOR"
APP_VERSION = "3.5.7"
APP_VERSION = "3.5.8"
APP_LONG_NAME = "$$APP_NAME $$APP_VERSION"
APP_EMAIL = "rotter.martinos@gmail.com"
APP_URL = "https://github.com/martinrotter/rssguard"

View File

@ -241,19 +241,29 @@ QString MessagePreviewer::prepareHtmlForMessage(const Message& message) {
html += QString("[%2] <a href=\"%1\">%1</a><br/>").arg(enc_url, enc.m_mimeType);
}
QRegularExpression imgTagRegex("\\<img[^\\>]*src\\s*=\\s*\"([^\"]*)\"[^\\>]*\\>",
QRegularExpression imgTagRegex("\\<img[^\\>]*src\\s*=\\s*[\"\']([^\"\']*)[\"\'][^\\>]*\\>",
QRegularExpression::PatternOption::CaseInsensitiveOption |
QRegularExpression::PatternOption::InvertedGreedinessOption);
QRegularExpressionMatchIterator i = imgTagRegex.globalMatch(message.m_contents);
QString pictures_html;
while (i.hasNext()) {
QRegularExpressionMatch match = i.next();
m_pictures.append(match.captured(1));
html += QString("[%1] <a href=\"%2\">%2</a><br/>").arg(tr("image"), match.captured(1));
pictures_html += QString("<br/>[%1] <a href=\"%2\">%2</a>").arg(tr("image"), match.captured(1));
}
html += "<br/>";
html += message.m_contents;
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
html += message.m_contents;
}
else {
QString cnts = message.m_contents;
html += cnts.replace(imgTagRegex, QString());
}
html += pictures_html;
return html;
}

View File

@ -13,11 +13,16 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl& name) {
switch (type) {
case QTextDocument::ImageResource: {
if (m_imagePlaceholder.isNull()) {
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
}
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
if (m_imagePlaceholder.isNull()) {
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
}
return m_imagePlaceholder;
return m_imagePlaceholder;
}
else {
return QVariant();
}
}
default:

View File

@ -23,6 +23,13 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
initializeMessageDateFormats();
GuiUtilities::setLabelAsNotice(*m_ui->label_9, false);
#if defined (USE_WEBENGINE)
m_ui->m_tabMessages->layout()->removeWidget(m_ui->m_checkDisplayPlaceholders);
m_ui->m_checkDisplayPlaceholders->hide();
#else
connect(m_ui->m_checkDisplayPlaceholders, &QCheckBox::toggled, this, &SettingsFeedsMessages::dirtifySettings);
#endif
connect(m_ui->m_spinHeightRowsMessages, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &SettingsFeedsMessages::requireRestart);
connect(m_ui->m_spinHeightRowsFeeds, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
@ -110,6 +117,10 @@ void SettingsFeedsMessages::loadSettings() {
m_ui->m_cmbCountsFeedList->setEditText(settings()->value(GROUP(Feeds), SETTING(Feeds::CountFormat)).toString());
m_ui->m_spinHeightImageAttachments->setValue(settings()->value(GROUP(Messages), SETTING(Messages::MessageHeadImageHeight)).toInt());
#if !defined (USE_WEBENGINE)
m_ui->m_checkDisplayPlaceholders->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool());
#endif
m_ui->m_checkMessagesDateTimeFormat->setChecked(settings()->value(GROUP(Messages), SETTING(Messages::UseCustomDate)).toBool());
const int index_format = m_ui->m_cmbMessagesDateTimeFormat->findData(settings()->value(GROUP(Messages),
SETTING(Messages::CustomDateFormat)).toString());
@ -143,6 +154,11 @@ void SettingsFeedsMessages::saveSettings() {
settings()->setValue(GROUP(Feeds), Feeds::CountFormat, m_ui->m_cmbCountsFeedList->currentText());
settings()->setValue(GROUP(Messages), Messages::UseCustomDate, m_ui->m_checkMessagesDateTimeFormat->isChecked());
settings()->setValue(GROUP(Messages), Messages::MessageHeadImageHeight, m_ui->m_spinHeightImageAttachments->value());
#if !defined (USE_WEBENGINE)
settings()->setValue(GROUP(Messages), Messages::DisplayImagePlaceholders, m_ui->m_checkDisplayPlaceholders->isChecked());
#endif
settings()->setValue(GROUP(Messages), Messages::CustomDateFormat,
m_ui->m_cmbMessagesDateTimeFormat->itemData(m_ui->m_cmbMessagesDateTimeFormat->currentIndex()).toString());

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>651</width>
<height>270</height>
<height>295</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="m_tabFeedsMessages">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="m_tabFeeds">
<attribute name="title">
@ -190,14 +190,14 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QCheckBox" name="m_checkKeppMessagesInTheMiddle">
<property name="text">
<string>Keep message selection in the middle of the message list viewport</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
@ -221,7 +221,7 @@
</item>
</layout>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="m_checkMessagesDateTimeFormat">
<property name="text">
<string>Use custom date/time format (overrides format loaded from active localization)</string>
@ -234,10 +234,10 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="m_cmbMessagesDateTimeFormat"/>
</item>
<item row="5" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Internal message browser fonts</string>
@ -273,7 +273,7 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
@ -297,6 +297,13 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="m_checkDisplayPlaceholders">
<property name="text">
<string>Display placeholders to indicate locations of pictures</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@ -320,6 +327,7 @@
<tabstop>m_spinHeightRowsFeeds</tabstop>
<tabstop>m_cmbCountsFeedList</tabstop>
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
<tabstop>m_checkDisplayPlaceholders</tabstop>
<tabstop>m_checkKeppMessagesInTheMiddle</tabstop>
<tabstop>m_spinHeightRowsMessages</tabstop>
<tabstop>m_spinHeightImageAttachments</tabstop>

View File

@ -65,6 +65,12 @@ DKEY Messages::EnableMessagePreview = "enable_message_preview";
DVALUE(bool) Messages::EnableMessagePreviewDef = true;
#if !defined (USE_WEBENGINE)
DKEY Messages::DisplayImagePlaceholders = "display_image_placeholders";
DVALUE(bool) Messages::DisplayImagePlaceholdersDef = false;
#endif
DKEY Messages::UseCustomDate = "use_custom_date";
DVALUE(bool) Messages::UseCustomDateDef = false;

View File

@ -88,6 +88,12 @@ namespace Messages {
VALUE(bool) EnableMessagePreviewDef;
#if !defined (USE_WEBENGINE)
KEY DisplayImagePlaceholders;
VALUE(bool) DisplayImagePlaceholdersDef;
#endif
KEY UseCustomDate;
VALUE(bool) UseCustomDateDef;