fixed #205, version bump
This commit is contained in:
parent
9716ab5422
commit
5e420f66d4
@ -30,7 +30,7 @@
|
|||||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||||
<content_rating type="oars-1.1" />
|
<content_rating type="oars-1.1" />
|
||||||
<releases>
|
<releases>
|
||||||
<release version="3.5.7" date="2019-05-28"/>
|
<release version="3.5.7" date="2019-05-31"/>
|
||||||
</releases>
|
</releases>
|
||||||
<content_rating type="oars-1.0">
|
<content_rating type="oars-1.0">
|
||||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||||
|
@ -51,7 +51,7 @@ APP_REVERSE_NAME = "com.github.rssguard"
|
|||||||
APP_LOW_H_NAME = ".rssguard"
|
APP_LOW_H_NAME = ".rssguard"
|
||||||
APP_AUTHOR = "Martin Rotter"
|
APP_AUTHOR = "Martin Rotter"
|
||||||
APP_COPYRIGHT = "(C) 2011-2019 $$APP_AUTHOR"
|
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_LONG_NAME = "$$APP_NAME $$APP_VERSION"
|
||||||
APP_EMAIL = "rotter.martinos@gmail.com"
|
APP_EMAIL = "rotter.martinos@gmail.com"
|
||||||
APP_URL = "https://github.com/martinrotter/rssguard"
|
APP_URL = "https://github.com/martinrotter/rssguard"
|
||||||
|
@ -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);
|
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::CaseInsensitiveOption |
|
||||||
QRegularExpression::PatternOption::InvertedGreedinessOption);
|
QRegularExpression::PatternOption::InvertedGreedinessOption);
|
||||||
QRegularExpressionMatchIterator i = imgTagRegex.globalMatch(message.m_contents);
|
QRegularExpressionMatchIterator i = imgTagRegex.globalMatch(message.m_contents);
|
||||||
|
QString pictures_html;
|
||||||
|
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
QRegularExpressionMatch match = i.next();
|
QRegularExpressionMatch match = i.next();
|
||||||
|
|
||||||
m_pictures.append(match.captured(1));
|
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/>";
|
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
|
||||||
html += message.m_contents;
|
html += message.m_contents;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QString cnts = message.m_contents;
|
||||||
|
|
||||||
|
html += cnts.replace(imgTagRegex, QString());
|
||||||
|
}
|
||||||
|
|
||||||
|
html += pictures_html;
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
@ -13,12 +13,17 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl& name) {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QTextDocument::ImageResource: {
|
case QTextDocument::ImageResource: {
|
||||||
|
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::DisplayImagePlaceholders)).toBool()) {
|
||||||
if (m_imagePlaceholder.isNull()) {
|
if (m_imagePlaceholder.isNull()) {
|
||||||
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
|
m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_imagePlaceholder;
|
return m_imagePlaceholder;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QTextBrowser::loadResource(type, name);
|
return QTextBrowser::loadResource(type, name);
|
||||||
|
@ -23,6 +23,13 @@ SettingsFeedsMessages::SettingsFeedsMessages(Settings* settings, QWidget* parent
|
|||||||
initializeMessageDateFormats();
|
initializeMessageDateFormats();
|
||||||
GuiUtilities::setLabelAsNotice(*m_ui->label_9, false);
|
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),
|
connect(m_ui->m_spinHeightRowsMessages, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
this, &SettingsFeedsMessages::requireRestart);
|
this, &SettingsFeedsMessages::requireRestart);
|
||||||
connect(m_ui->m_spinHeightRowsFeeds, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
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_cmbCountsFeedList->setEditText(settings()->value(GROUP(Feeds), SETTING(Feeds::CountFormat)).toString());
|
||||||
m_ui->m_spinHeightImageAttachments->setValue(settings()->value(GROUP(Messages), SETTING(Messages::MessageHeadImageHeight)).toInt());
|
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());
|
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),
|
const int index_format = m_ui->m_cmbMessagesDateTimeFormat->findData(settings()->value(GROUP(Messages),
|
||||||
SETTING(Messages::CustomDateFormat)).toString());
|
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(Feeds), Feeds::CountFormat, m_ui->m_cmbCountsFeedList->currentText());
|
||||||
settings()->setValue(GROUP(Messages), Messages::UseCustomDate, m_ui->m_checkMessagesDateTimeFormat->isChecked());
|
settings()->setValue(GROUP(Messages), Messages::UseCustomDate, m_ui->m_checkMessagesDateTimeFormat->isChecked());
|
||||||
settings()->setValue(GROUP(Messages), Messages::MessageHeadImageHeight, m_ui->m_spinHeightImageAttachments->value());
|
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,
|
settings()->setValue(GROUP(Messages), Messages::CustomDateFormat,
|
||||||
m_ui->m_cmbMessagesDateTimeFormat->itemData(m_ui->m_cmbMessagesDateTimeFormat->currentIndex()).toString());
|
m_ui->m_cmbMessagesDateTimeFormat->itemData(m_ui->m_cmbMessagesDateTimeFormat->currentIndex()).toString());
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>651</width>
|
<width>651</width>
|
||||||
<height>270</height>
|
<height>295</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="m_tabFeedsMessages">
|
<widget class="QTabWidget" name="m_tabFeedsMessages">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="m_tabFeeds">
|
<widget class="QWidget" name="m_tabFeeds">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -190,14 +190,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="m_checkKeppMessagesInTheMiddle">
|
<widget class="QCheckBox" name="m_checkKeppMessagesInTheMiddle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Keep message selection in the middle of the message list viewport</string>
|
<string>Keep message selection in the middle of the message list viewport</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
@ -221,7 +221,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QCheckBox" name="m_checkMessagesDateTimeFormat">
|
<widget class="QCheckBox" name="m_checkMessagesDateTimeFormat">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use custom date/time format (overrides format loaded from active localization)</string>
|
<string>Use custom date/time format (overrides format loaded from active localization)</string>
|
||||||
@ -234,10 +234,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QComboBox" name="m_cmbMessagesDateTimeFormat"/>
|
<widget class="QComboBox" name="m_cmbMessagesDateTimeFormat"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" colspan="2">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Internal message browser fonts</string>
|
<string>Internal message browser fonts</string>
|
||||||
@ -273,7 +273,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
@ -297,6 +297,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@ -320,6 +327,7 @@
|
|||||||
<tabstop>m_spinHeightRowsFeeds</tabstop>
|
<tabstop>m_spinHeightRowsFeeds</tabstop>
|
||||||
<tabstop>m_cmbCountsFeedList</tabstop>
|
<tabstop>m_cmbCountsFeedList</tabstop>
|
||||||
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
|
<tabstop>m_checkRemoveReadMessagesOnExit</tabstop>
|
||||||
|
<tabstop>m_checkDisplayPlaceholders</tabstop>
|
||||||
<tabstop>m_checkKeppMessagesInTheMiddle</tabstop>
|
<tabstop>m_checkKeppMessagesInTheMiddle</tabstop>
|
||||||
<tabstop>m_spinHeightRowsMessages</tabstop>
|
<tabstop>m_spinHeightRowsMessages</tabstop>
|
||||||
<tabstop>m_spinHeightImageAttachments</tabstop>
|
<tabstop>m_spinHeightImageAttachments</tabstop>
|
||||||
|
@ -65,6 +65,12 @@ DKEY Messages::EnableMessagePreview = "enable_message_preview";
|
|||||||
|
|
||||||
DVALUE(bool) Messages::EnableMessagePreviewDef = true;
|
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";
|
DKEY Messages::UseCustomDate = "use_custom_date";
|
||||||
|
|
||||||
DVALUE(bool) Messages::UseCustomDateDef = false;
|
DVALUE(bool) Messages::UseCustomDateDef = false;
|
||||||
|
@ -88,6 +88,12 @@ namespace Messages {
|
|||||||
|
|
||||||
VALUE(bool) EnableMessagePreviewDef;
|
VALUE(bool) EnableMessagePreviewDef;
|
||||||
|
|
||||||
|
#if !defined (USE_WEBENGINE)
|
||||||
|
KEY DisplayImagePlaceholders;
|
||||||
|
|
||||||
|
VALUE(bool) DisplayImagePlaceholdersDef;
|
||||||
|
#endif
|
||||||
|
|
||||||
KEY UseCustomDate;
|
KEY UseCustomDate;
|
||||||
|
|
||||||
VALUE(bool) UseCustomDateDef;
|
VALUE(bool) UseCustomDateDef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user