This commit is contained in:
Martin Rotter 2013-12-10 18:54:55 +01:00
parent 651fe22c64
commit 9f13912f5c
9 changed files with 24 additions and 4 deletions

View File

@ -39,6 +39,8 @@
#define APP_CFG_PROXY "proxy"
#define APP_CFG_CUTS "keyboard"
#define APP_CFG_BROWSER "browser"
#define APP_CFG_MESSAGES "messages"
#define APP_CFG_FEEDS "feeds"
#define APP_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define APP_REVISION "@APP_REVISION@"

View File

@ -22,6 +22,7 @@ class Message {
friend class WebBrowser;
friend class MessagesModel;
friend class MessagesView;
};

View File

@ -37,6 +37,9 @@ void FeedMessageViewer::createConnections() {
connect(m_messagesView, SIGNAL(openMessageNewTabRequested(Message)),
FormMain::getInstance()->m_ui->m_tabWidget,
SLOT(addBrowserWithMessage(Message)));
connect(m_messagesView, SIGNAL(openLinkMessageNewTabRequested(QString)),
FormMain::getInstance()->m_ui->m_tabWidget,
SLOT(addLinkedBrowser(QString)));
// Toolbar forwardings.
connect(FormMain::getInstance()->m_ui->m_actionSwitchImportanceOfSelectedMessages,

View File

@ -124,7 +124,14 @@ void FormSettings::changeBrowserProgressColor() {
}
void FormSettings::loadFeedsMessages() {
Settings *settings = Settings::getInstance();
m_ui->m_cmbExternalBrowserPreset->addItem("Chromium", "aa %1");
m_ui->m_txtExternalBrowserExecutable->setText(settings->value(APP_CFG_MESSAGES,
"external_browser_executable").toString());
m_ui->m_txtExternalBrowserArguments->setText(settings->value(APP_CFG_MESSAGES,
"external_browser_arguments").toString());
}
void FormSettings::saveFeedsMessages() {

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>803</width>
<height>373</height>
<height>410</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -182,12 +182,13 @@ void MessagesView::openSelectedSourceArticlesExternally() {
}
void MessagesView::openSelectedSourceMessagesInternally() {
// TODO: otevre vybrane zpravy ze zdrojovych webz v internch tabech
foreach (const QModelIndex &index, selectionModel()->selectedRows()) {
// TODO: What to do with messages w/o link?
emit openLinkMessageNewTabRequested(m_sourceModel->messageAt(m_proxyModel->mapToSource(index).row()).m_url);
}
}
void MessagesView::openSelectedMessagesInternally() {
// TODO: otevre vybrane nactene zpravy v internich tabech
foreach (const QModelIndex &index, selectionModel()->selectedRows()) {
emit openMessageNewTabRequested(m_sourceModel->messageAt(m_proxyModel->mapToSource(index).row()));
}

View File

@ -51,6 +51,7 @@ class MessagesView : public QTreeView {
const QItemSelection &deselected);
signals:
void openLinkMessageNewTabRequested(const QString &link);
void openMessageNewTabRequested(const Message &message);
void currentMessageChanged(const Message &message);
void currentMessageRemoved();

View File

@ -184,6 +184,10 @@ int TabWidget::addEmptyBrowser() {
return addBrowser(false, true);
}
int TabWidget::addLinkedBrowser(const QString &initial_url) {
return addLinkedBrowser(QUrl(initial_url));
}
int TabWidget::addLinkedBrowser(const QUrl &initial_url) {
return addBrowser(Settings::getInstance()->value(APP_CFG_BROWSER,
"queue_tabs",

View File

@ -81,6 +81,7 @@ class TabWidget : public QTabWidget {
// Adds new WebBrowser with link. This is used when user
// selects to "Open link in new tab.".
int addLinkedBrowser(const QUrl &initial_url = QUrl());
int addLinkedBrowser(const QString &initial_url);
// General method for adding WebBrowsers.
int addBrowser(bool move_after_current,