Merge branch 'master' of github.com:martinrotter/rssguard
This commit is contained in:
commit
bbe144837f
@ -1,6 +1,10 @@
|
||||
3.4.0
|
||||
—————
|
||||
|
||||
Added:
|
||||
▪ "Cleanup database" action has now configurable shortcut. (issue #90)
|
||||
▪ Fixed #76, now user can choose to "not show the dialog again" when opening hyperlink from message previewer. This only concerns the lite version of RSS Guard which uses simpler text component for message previewing.
|
||||
|
||||
Changed:
|
||||
▪ (Linux only) Primary user data/config storage is now undex $HOME/.config. XDG_CONFIG_HOME variable is respected. If old user data is detected, then old user data path is used.
|
||||
▪ RSS Guard now uses "_" character as localization file names separator. (issue #75)
|
||||
|
@ -164,6 +164,7 @@ QList<QAction*> FormMain::allActions() const {
|
||||
actions << m_ui->m_actionServiceAdd;
|
||||
actions << m_ui->m_actionServiceEdit;
|
||||
actions << m_ui->m_actionServiceDelete;
|
||||
actions << m_ui->m_actionCleanupDatabase;
|
||||
actions << m_ui->m_actionAddFeedIntoSelectedAccount;
|
||||
actions << m_ui->m_actionAddCategoryIntoSelectedAccount;
|
||||
actions << m_ui->m_actionViewSelectedItemsNewspaperMode;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QStyle>
|
||||
#include <QCheckBox>
|
||||
|
||||
|
||||
MessageBox::MessageBox(QWidget *parent) : QMessageBox(parent) {
|
||||
@ -41,6 +42,19 @@ void MessageBox::setIcon(QMessageBox::Icon icon) {
|
||||
setIconPixmap(iconForStatus(icon).pixmap(icon_size, icon_size));
|
||||
}
|
||||
|
||||
void MessageBox::setCheckBox(QMessageBox *msg_box, const QString &text, bool *data) {
|
||||
// Add "don't show this again checkbox.
|
||||
QCheckBox *check_box = new QCheckBox(msg_box);
|
||||
|
||||
check_box->setChecked(*data);
|
||||
check_box->setText(text);
|
||||
connect(check_box, &QCheckBox::toggled, [=](bool checked) {
|
||||
*data = checked;
|
||||
});
|
||||
|
||||
msg_box->setCheckBox(check_box);
|
||||
}
|
||||
|
||||
QIcon MessageBox::iconForStatus(QMessageBox::Icon status) {
|
||||
switch (status) {
|
||||
case QMessageBox::Information:
|
||||
@ -68,7 +82,8 @@ QMessageBox::StandardButton MessageBox::show(QWidget *parent,
|
||||
const QString &informative_text,
|
||||
const QString &detailed_text,
|
||||
QMessageBox::StandardButtons buttons,
|
||||
QMessageBox::StandardButton default_button) {
|
||||
QMessageBox::StandardButton default_button,
|
||||
bool *dont_show_again) {
|
||||
// Create and find needed components.
|
||||
MessageBox msg_box(parent);
|
||||
|
||||
@ -81,6 +96,10 @@ QMessageBox::StandardButton MessageBox::show(QWidget *parent,
|
||||
msg_box.setStandardButtons(buttons);
|
||||
msg_box.setDefaultButton(default_button);
|
||||
|
||||
if (dont_show_again != nullptr) {
|
||||
MessageBox::setCheckBox(&msg_box, tr("Do not show this dialog again."), dont_show_again);
|
||||
}
|
||||
|
||||
// Display it.
|
||||
if (msg_box.exec() == -1) {
|
||||
return QMessageBox::Cancel;
|
||||
|
@ -33,6 +33,8 @@ class MessageBox : public QMessageBox {
|
||||
// Custom icon setting.
|
||||
void setIcon(Icon icon);
|
||||
|
||||
static void setCheckBox(QMessageBox *msg_box, const QString &text, bool *data);
|
||||
|
||||
// Displays custom message box.
|
||||
static QMessageBox::StandardButton show(QWidget *parent,
|
||||
QMessageBox::Icon icon,
|
||||
@ -41,7 +43,8 @@ class MessageBox : public QMessageBox {
|
||||
const QString &informative_text = QString(),
|
||||
const QString &detailed_text = QString(),
|
||||
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
||||
QMessageBox::StandardButton default_button = QMessageBox::Ok);
|
||||
QMessageBox::StandardButton default_button = QMessageBox::Ok,
|
||||
bool *dont_show_again = nullptr);
|
||||
|
||||
static QIcon iconForStatus(QMessageBox::Icon status);
|
||||
};
|
||||
|
@ -32,29 +32,45 @@
|
||||
void MessagePreviewer::createConnections() {
|
||||
connect(m_ui->m_txtMessage, &QTextBrowser::anchorClicked, [=](const QUrl &url) {
|
||||
if (!url.isEmpty()) {
|
||||
// User clicked some URL. Open it in external browser or download?
|
||||
MessageBox box(qApp->mainForm());
|
||||
bool open_externally_now = qApp->settings()->value(GROUP(Browser),
|
||||
SETTING(Browser::OpenLinksInExternalBrowserRightAway)).toBool();
|
||||
|
||||
box.setText(tr("You clicked some link. You can download the link contents or open it in external web browser."));
|
||||
box.setInformativeText(tr("What action do you want to take?"));
|
||||
box.setDetailedText(url.toString());
|
||||
QAbstractButton *btn_open = box.addButton(tr("Open in external browser"), QMessageBox::ActionRole);
|
||||
QAbstractButton *btn_download = box.addButton(tr("Download"), QMessageBox::ActionRole);
|
||||
QAbstractButton *btn_cancel = box.addButton(QMessageBox::Cancel);
|
||||
|
||||
box.setDefaultButton(QMessageBox::Cancel);
|
||||
box.exec();
|
||||
|
||||
if (box.clickedButton() == btn_open) {
|
||||
if (open_externally_now) {
|
||||
WebFactory::instance()->openUrlInExternalBrowser(url.toString());
|
||||
}
|
||||
else if (box.clickedButton() == btn_download) {
|
||||
qApp->downloadManager()->download(url);
|
||||
}
|
||||
else {
|
||||
// User clicked some URL. Open it in external browser or download?
|
||||
MessageBox box(qApp->mainForm());
|
||||
|
||||
btn_download->deleteLater();
|
||||
btn_open->deleteLater();
|
||||
btn_cancel->deleteLater();
|
||||
box.setText(tr("You clicked some link. You can download the link contents or open it in external web browser."));
|
||||
box.setInformativeText(tr("What action do you want to take?"));
|
||||
box.setDetailedText(url.toString());
|
||||
QAbstractButton *btn_open = box.addButton(tr("Open in external browser"), QMessageBox::ActionRole);
|
||||
QAbstractButton *btn_download = box.addButton(tr("Download"), QMessageBox::ActionRole);
|
||||
QAbstractButton *btn_cancel = box.addButton(QMessageBox::Cancel);
|
||||
|
||||
bool always;
|
||||
MessageBox::setCheckBox(&box, tr("Alway open links in external browser."), &always);
|
||||
|
||||
box.setDefaultButton(QMessageBox::Cancel);
|
||||
box.exec();
|
||||
|
||||
if (box.clickedButton() != box.button(QMessageBox::Cancel)) {
|
||||
// Store selected checkbox value.
|
||||
qApp->settings()->setValue(GROUP(Browser), Browser::OpenLinksInExternalBrowserRightAway, always);
|
||||
}
|
||||
|
||||
if (box.clickedButton() == btn_open) {
|
||||
WebFactory::instance()->openUrlInExternalBrowser(url.toString());
|
||||
}
|
||||
else if (box.clickedButton() == btn_download) {
|
||||
qApp->downloadManager()->download(url);
|
||||
}
|
||||
|
||||
btn_download->deleteLater();
|
||||
btn_open->deleteLater();
|
||||
btn_cancel->deleteLater();
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageBox::show(qApp->mainForm(), QMessageBox::Warning, tr("Incorrect link"),
|
||||
|
@ -29,6 +29,12 @@ SettingsBrowserMail::SettingsBrowserMail(Settings *settings, QWidget *parent)
|
||||
: SettingsPanel(settings, parent), m_ui(new Ui::SettingsBrowserMail) {
|
||||
m_ui->setupUi(this);
|
||||
|
||||
#if defined(USE_WEBENGINE)
|
||||
m_ui->m_checkOpenLinksInExternal->setVisible(false);
|
||||
#else
|
||||
connect(m_ui->m_checkOpenLinksInExternal, &QCheckBox::stateChanged, this, &SettingsBrowserMail::dirtifySettings);
|
||||
#endif
|
||||
|
||||
connect(m_ui->m_cmbProxyType, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SettingsBrowserMail::dirtifySettings);
|
||||
connect(m_ui->m_txtProxyHost, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings);
|
||||
connect(m_ui->m_txtProxyPassword, &QLineEdit::textChanged, this, &SettingsBrowserMail::dirtifySettings);
|
||||
@ -127,6 +133,11 @@ void SettingsBrowserMail::selectEmailExecutable() {
|
||||
void SettingsBrowserMail::loadSettings() {
|
||||
onBeginLoadSettings();
|
||||
|
||||
#if !defined(USE_WEBENGINE)
|
||||
m_ui->m_checkOpenLinksInExternal->setChecked(settings()->value(GROUP(Browser),
|
||||
SETTING(Browser::OpenLinksInExternalBrowserRightAway)).toBool());
|
||||
#endif
|
||||
|
||||
// Load settings of web browser GUI.
|
||||
m_ui->m_cmbExternalBrowserPreset->addItem(tr("Opera 12 or older"), QSL("-nosession %1"));
|
||||
m_ui->m_txtExternalBrowserExecutable->setText(settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserExecutable)).toString());
|
||||
@ -159,6 +170,10 @@ void SettingsBrowserMail::loadSettings() {
|
||||
void SettingsBrowserMail::saveSettings() {
|
||||
onBeginSaveSettings();
|
||||
|
||||
#if !defined(USE_WEBENGINE)
|
||||
settings()->setValue(GROUP(Browser), Browser::OpenLinksInExternalBrowserRightAway, m_ui->m_checkOpenLinksInExternal->isChecked());
|
||||
#endif
|
||||
|
||||
// Save settings of GUI of web browser.
|
||||
settings()->setValue(GROUP(Browser), Browser::CustomExternalBrowserEnabled, m_ui->m_grpCustomExternalBrowser->isChecked());
|
||||
settings()->setValue(GROUP(Browser), Browser::CustomExternalBrowserExecutable, m_ui->m_txtExternalBrowserExecutable->text());
|
||||
|
@ -33,7 +33,7 @@
|
||||
<string>External web browser</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout_17">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="m_grpCustomExternalBrowser">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>If unchecked, then default system-wide web browser is used.</p></body></html></string>
|
||||
@ -122,6 +122,13 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="m_checkOpenLinksInExternal">
|
||||
<property name="text">
|
||||
<string>Always open links from simple internal text browser in external web browser</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
|
@ -246,6 +246,9 @@ DKEY Keyboard::ID = "keyboard";
|
||||
// Web browser.
|
||||
DKEY Browser::ID = "browser";
|
||||
|
||||
DKEY Browser::OpenLinksInExternalBrowserRightAway = "open_link_externally_wo_confirmation";
|
||||
DVALUE(bool) Browser::OpenLinksInExternalBrowserRightAwayDef = false;
|
||||
|
||||
DKEY Browser::CustomExternalBrowserEnabled = "custom_external_browser";
|
||||
DVALUE(bool) Browser::CustomExternalBrowserEnabledDef = false;
|
||||
|
||||
|
@ -276,6 +276,9 @@ namespace Keyboard {
|
||||
namespace Browser {
|
||||
KEY ID;
|
||||
|
||||
KEY OpenLinksInExternalBrowserRightAway;
|
||||
VALUE(bool) OpenLinksInExternalBrowserRightAwayDef;
|
||||
|
||||
KEY CustomExternalBrowserEnabled;
|
||||
VALUE(bool) CustomExternalBrowserEnabledDef;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user