Work on newspaper mode + langs updated.
This commit is contained in:
parent
b89a95899c
commit
4842361397
@ -389,6 +389,14 @@
|
|||||||
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>View selected items in newspaper mode</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Displays all messages from selected feeds/categories in a new "newspaper mode" tab. All selected feeds are marked as read.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FormSettings</name>
|
<name>FormSettings</name>
|
||||||
@ -1056,6 +1064,10 @@ Jazyk: %5</translation>
|
|||||||
<source>uknown author</source>
|
<source>uknown author</source>
|
||||||
<translation>neznámý autor</translation>
|
<translation>neznámý autor</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Newspaper view</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>WebView</name>
|
<name>WebView</name>
|
||||||
@ -1139,5 +1151,9 @@ Jazyk: %5</translation>
|
|||||||
<source>Hyperlink</source>
|
<source>Hyperlink</source>
|
||||||
<translation>Hypertextový odkaz</translation>
|
<translation>Hypertextový odkaz</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Error page</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@ -389,6 +389,14 @@
|
|||||||
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>View selected items in newspaper mode</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Displays all messages from selected feeds/categories in a new "newspaper mode" tab. All selected feeds are marked as read.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FormSettings</name>
|
<name>FormSettings</name>
|
||||||
@ -1037,6 +1045,10 @@ Language: %5</source>
|
|||||||
<source>uknown author</source>
|
<source>uknown author</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Newspaper view</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>WebView</name>
|
<name>WebView</name>
|
||||||
@ -1120,5 +1132,9 @@ Language: %5</source>
|
|||||||
<source>Hyperlink</source>
|
<source>Hyperlink</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Error page</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@ -389,6 +389,14 @@
|
|||||||
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
<source>Mark all messages in all feeds read. This does not take message filters into account.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>View selected items in newspaper mode</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Displays all messages from selected feeds/categories in a new "newspaper mode" tab. All selected feeds are marked as read.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FormSettings</name>
|
<name>FormSettings</name>
|
||||||
@ -1053,6 +1061,10 @@ Taal: %5</translation>
|
|||||||
<source>uknown author</source>
|
<source>uknown author</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Newspaper view</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>WebView</name>
|
<name>WebView</name>
|
||||||
@ -1136,5 +1148,9 @@ Taal: %5</translation>
|
|||||||
<source>Hyperlink</source>
|
<source>Hyperlink</source>
|
||||||
<translation type="unfinished">Koppeling</translation>
|
<translation type="unfinished">Koppeling</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Error page</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
@ -23,18 +23,20 @@
|
|||||||
#define APP_VERSION "@APP_VERSION@"
|
#define APP_VERSION "@APP_VERSION@"
|
||||||
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion()
|
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion()
|
||||||
|
|
||||||
#define TEXT_TITLE_LIMIT 30
|
#define TEXT_TITLE_LIMIT 30
|
||||||
#define MAX_ZOOM_FACTOR 10.0
|
#define MAX_ZOOM_FACTOR 10.0
|
||||||
#define ICON_SIZE_SETTINGS 16
|
#define ICON_SIZE_SETTINGS 16
|
||||||
#define DATABASE_DRIVER "QSQLITE"
|
#define DATABASE_DRIVER "QSQLITE"
|
||||||
#define NO_PARENT_CATEGORY -1
|
#define NO_PARENT_CATEGORY -1
|
||||||
#define TRAY_ICON_BUBBLE_TIMEOUT 15000
|
#define TRAY_ICON_BUBBLE_TIMEOUT 15000
|
||||||
#define KEY_MESSAGES_VIEW "messages_view_column_"
|
#define KEY_MESSAGES_VIEW "messages_view_column_"
|
||||||
#define CLOSE_LOCK_TIMEOUT 3000
|
#define CLOSE_LOCK_TIMEOUT 3000
|
||||||
#define DOWNLOAD_TIMEOUT 5000
|
#define DOWNLOAD_TIMEOUT 5000
|
||||||
#define MESSAGES_VIEW_DEFAULT_COL 170
|
#define MESSAGES_VIEW_DEFAULT_COL 170
|
||||||
#define ELLIPSIS_LENGTH 3
|
#define ELLIPSIS_LENGTH 3
|
||||||
#define NEWSPAPER_URL "rssguard:newspaper"
|
#define INTERNAL_URL_SCHEME APP_LOW_NAME
|
||||||
|
#define INTERNAL_URL_NEWSPAPER "@APP_LOW_NAME@:newspaper"
|
||||||
|
#define INTERNAL_URL_NEWSPAPER_PATH "newspaper"
|
||||||
|
|
||||||
#define APP_DB_INIT_FILE "db_init.sql"
|
#define APP_DB_INIT_FILE "db_init.sql"
|
||||||
#define APP_DB_INIT_SPLIT "-- !\n"
|
#define APP_DB_INIT_SPLIT "-- !\n"
|
||||||
|
@ -134,23 +134,19 @@ void FeedsView::markAllFeedsRead() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::openSelectedFeedsInNewspaperMode() {
|
void FeedsView::openSelectedFeedsInNewspaperMode() {
|
||||||
// TODO: oznacit vybrane feedy jako prectene zde
|
|
||||||
// protoze je uzivatel otvira v newspaperu -> jsou prectene automaticky
|
|
||||||
|
|
||||||
|
|
||||||
QList<FeedsModelFeed*> selected_feeds = selectedFeeds();
|
QList<FeedsModelFeed*> selected_feeds = selectedFeeds();
|
||||||
QList<Message> messages = m_sourceModel->messagesForFeeds(selected_feeds);
|
QList<Message> messages = m_sourceModel->messagesForFeeds(selected_feeds);
|
||||||
|
|
||||||
if (!messages.isEmpty()) {
|
if (!messages.isEmpty()) {
|
||||||
emit newspaperModeRequested(messages);
|
emit newspaperModeRequested(messages);
|
||||||
|
|
||||||
|
// Moreover, mark those feeds as read because they were opened in
|
||||||
|
// newspaper mode, thus, they are read.
|
||||||
|
m_sourceModel->markFeedsRead(selected_feeds, 1);
|
||||||
|
updateCountsOfAllFeeds(false);
|
||||||
|
|
||||||
|
emit feedsNeedToBeReloaded(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Moreover, mark those feeds as read because they were opened in
|
|
||||||
// newspaper mode, thus, they are read.
|
|
||||||
m_sourceModel->markFeedsRead(selected_feeds, 1);
|
|
||||||
updateCountsOfAllFeeds(false);
|
|
||||||
|
|
||||||
emit feedsNeedToBeReloaded(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) {
|
void FeedsView::updateCountsOfSelectedFeeds(bool update_total_too) {
|
||||||
|
@ -166,25 +166,13 @@ void WebBrowser::clear() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::navigateToMessage(const Message &message) {
|
void WebBrowser::navigateToMessage(const Message &message) {
|
||||||
QString message_layout = SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title,
|
navigateToMessages(QList<Message>() << message);
|
||||||
tr("Written by ") + (message.m_author.isEmpty() ?
|
|
||||||
tr("uknown author") :
|
|
||||||
message.m_author),
|
|
||||||
message.m_url,
|
|
||||||
message.m_contents,
|
|
||||||
message.m_created.toString(Qt::DefaultLocaleShortDate));
|
|
||||||
|
|
||||||
QString layout_wrapper = SkinFactory::getInstance()->getCurrentMarkupLayout().arg(message.m_title,
|
|
||||||
message_layout);
|
|
||||||
|
|
||||||
m_webView->setHtml(layout_wrapper, QUrl(NEWSPAPER_URL));
|
|
||||||
emit iconChanged(m_index,
|
|
||||||
IconThemeFactory::getInstance()->fromTheme("document-multiple"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::navigateToMessages(const QList<Message> &messages) {
|
void WebBrowser::navigateToMessages(const QList<Message> &messages) {
|
||||||
|
SkinFactory *factory = SkinFactory::getInstance();
|
||||||
QString messages_layout;
|
QString messages_layout;
|
||||||
QString default_message_layout = SkinFactory::getInstance()->getCurrentMarkup();
|
QString default_message_layout = factory->getCurrentMarkup();
|
||||||
|
|
||||||
foreach (const Message &message, messages) {
|
foreach (const Message &message, messages) {
|
||||||
messages_layout.append(default_message_layout.arg(message.m_title,
|
messages_layout.append(default_message_layout.arg(message.m_title,
|
||||||
@ -195,13 +183,15 @@ void WebBrowser::navigateToMessages(const QList<Message> &messages) {
|
|||||||
message.m_contents,
|
message.m_contents,
|
||||||
message.m_created.toString(Qt::DefaultLocaleShortDate)));
|
message.m_created.toString(Qt::DefaultLocaleShortDate)));
|
||||||
}
|
}
|
||||||
QString layout_wrapper = SkinFactory::getInstance()->getCurrentMarkupLayout().arg(tr("Newspaper view"),
|
|
||||||
messages_layout);
|
|
||||||
|
|
||||||
m_webView->setHtml(layout_wrapper, QUrl(NEWSPAPER_URL));
|
QString layout_wrapper = factory->getCurrentMarkupLayout().arg(messages.size() == 1 ?
|
||||||
|
messages.at(0).m_title :
|
||||||
|
tr("Newspaper view"),
|
||||||
|
messages_layout);
|
||||||
|
|
||||||
|
m_webView->setHtml(layout_wrapper, QUrl(INTERNAL_URL_NEWSPAPER));
|
||||||
emit iconChanged(m_index,
|
emit iconChanged(m_index,
|
||||||
IconThemeFactory::getInstance()->fromTheme("document-multiple"));
|
IconThemeFactory::getInstance()->fromTheme("document-multiple"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::updateZoomGui() {
|
void WebBrowser::updateZoomGui() {
|
||||||
|
@ -28,6 +28,10 @@ WebView::~WebView() {
|
|||||||
qDebug("Destroying BaseWebView.");
|
qDebug("Destroying BaseWebView.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebPage *WebView::page() const {
|
||||||
|
return m_page;
|
||||||
|
}
|
||||||
|
|
||||||
void WebView::onLoadFinished(bool ok) {
|
void WebView::onLoadFinished(bool ok) {
|
||||||
// If page was not loaded, then display custom error page.
|
// If page was not loaded, then display custom error page.
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
|
@ -16,6 +16,8 @@ class WebView : public QWebView {
|
|||||||
explicit WebView(QWidget *parent = 0);
|
explicit WebView(QWidget *parent = 0);
|
||||||
virtual ~WebView();
|
virtual ~WebView();
|
||||||
|
|
||||||
|
WebPage *page() const;
|
||||||
|
|
||||||
void setupIcons();
|
void setupIcons();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user