diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui index 2bff3a2fd..e4f75d6b6 100644 --- a/src/gui/formsettings.ui +++ b/src/gui/formsettings.ui @@ -17,7 +17,7 @@ - 2 + 0 @@ -51,8 +51,8 @@ 0 0 - 100 - 30 + 576 + 373 @@ -102,8 +102,8 @@ 0 0 - 568 - 344 + 177 + 213 @@ -565,7 +565,7 @@ - 1 + 0 @@ -576,16 +576,13 @@ Messages - - - QFormLayout::AllNonFixedFieldsGrow - + External web browser for message viewing - + @@ -619,36 +616,32 @@ - - - - - Parameters to executable - - - - - - - use sample arguments for - - - - - - - QComboBox::AdjustToContents - - - - select browser - - - - - + + + Parameters to executable + + - + + + + use sample arguments for + + + + + + + QComboBox::AdjustToContents + + + + select browser + + + + + Note that "%1" (without quotation marks) is placeholder for URL of selected message. @@ -662,6 +655,8 @@ + groupBox_3 + label diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index 0981c49b0..c647e128d 100644 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -214,10 +214,10 @@ void MessagesView::loadFeeds(const QList &feed_ids) { void MessagesView::openSelectedSourceArticlesExternally() { QString browser = Settings::instance()->value(APP_CFG_MESSAGES, - "external_browser_executable").toString(); - QString arguments = Settings::instance()->value(APP_CFG_MESSAGES, - "external_browser_arguments", - "%1").toString(); + "external_browser_executable").toString(); + QStringList arguments = Settings::instance()->value(APP_CFG_MESSAGES, + "external_browser_arguments", + "%1").toString().split(' '); if (browser.isEmpty() || arguments.isEmpty()) { QMessageBox::critical(this, @@ -229,12 +229,14 @@ void MessagesView::openSelectedSourceArticlesExternally() { foreach (const QModelIndex &index, selectionModel()->selectedRows()) { QString link = m_sourceModel->messageAt(m_proxyModel->mapToSource(index).row()).m_url; + QStringList real_arguments = arguments.replaceInStrings("%1", link); - if (!QProcess::startDetached(browser, QStringList() << arguments.arg(link))) { + if (!QProcess::startDetached(browser, real_arguments)) { QMessageBox::critical(this, tr("Problem with starting external web browser"), tr("External web browser could not be started."), QMessageBox::Ok); + return; } } }