From 6d39aace90b602fbe857e86e6e5aa870f22b13ed Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 30 Nov 2013 19:24:09 +0100 Subject: [PATCH] Many changes... --- localization/rssguard_cs.ts | 134 +++++++++++++++++++++++++++------- localization/rssguard_en.ts | 130 ++++++++++++++++++++++++++------- localization/rssguard_nl.ts | 130 ++++++++++++++++++++++++++------- resources/text/AUTHORS | 1 + src/core/databasefactory.cpp | 9 ++- src/core/defs.h.in | 2 - src/core/messagesmodel.cpp | 9 ++- src/core/messagesmodel.h | 4 +- src/gui/feedmessageviewer.cpp | 31 +++----- src/gui/formabout.ui | 30 ++++---- src/gui/formmain.cpp | 30 +++++--- src/gui/formmain.h | 5 +- src/gui/formmain.ui | 92 +++++++++++++---------- src/gui/iconthemefactory.h | 2 + src/gui/skinfactory.cpp | 7 +- src/gui/webbrowser.cpp | 5 +- src/gui/webbrowser.h | 3 + 17 files changed, 450 insertions(+), 174 deletions(-) diff --git a/localization/rssguard_cs.ts b/localization/rssguard_cs.ts index 0899c529a..5c63a4003 100644 --- a/localization/rssguard_cs.ts +++ b/localization/rssguard_cs.ts @@ -161,8 +161,8 @@ Informace o autorech nebyly nalezeny. - <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> - <body>RSS Guard je velmi jednoduchá čtečka kanálů<br><br>Tento software je šířen pod podmínkami licence GNU General Public License, verze 3.<br><br>Kontakty:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~web</li></ul>Zdrojové kódy této aplikace lze získat z jejího webu.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> + <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> + <body>RSS Guard je (velmi) štíhlá čtečka kanálů.<br><br>Tento software je šířen pod licencí GNU General Public License, verze 3.<br><br>Kontakty:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~web programu</li></ul>Zdrojový kód tohoto programu je možné získat z jeho domovské stránky.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> @@ -205,7 +205,7 @@ &Fullscreen mode - &Režime celé obrazovky + &Režim celé obrazovky &Current tab @@ -215,10 +215,6 @@ &Add tab &Přidat panel - - Add tab - Přidat panel - Close &all tabs except current one Zavřít &všechny panely kromě aktivního @@ -247,34 +243,18 @@ &Messages &Zprávy - - Update &all - Aktualizovat &vše - Update all feeds. Aktualizovat všechny kanály. - - Update &selected - &Aktualizovat vybrané - Update selected feeds/categories. - - &Edit selected - - Edit selected feed/category. - - &Delete selected - - Delete selected feeds/categories. @@ -307,10 +287,6 @@ Switch &importance of selected messages - - Mark selected as read - - Mark &all messages read @@ -327,6 +303,110 @@ Dele&te all messages + + Import stuff. + + + + Ctrl+Shift+I + + + + Export stuff. + + + + Ctrl+Shift+E + + + + Quit the application. + + + + Ctrl+Shift+Q + + + + Display settings of the application. + + + + Ctrl+Shift+S + + + + About RSS Guard. + + + + Ctrl+Shift+A + + + + Switch fullscreen mode. + + + + Ctrl+Shift+F + + + + Add new web browser tab. + + + + Ctrl+Shift+T + + + + Close current web browser tab. + + + + Ctrl+Shift+C + + + + Update &all feeds + + + + Update &selected feeds + + + + &Edit selected feed(s)/category(ies) + + + + &Delete selected feed(s)/category(ies) + + + + Mark selected feed(s)/category(ies) as read + + + + Mark selected feed(s)/category(ies) as read. + + + + Mark all messages read. + + + + Mark all messages unread. + + + + Delete selected messages. + + + + Delete all messages. + + FormSettings diff --git a/localization/rssguard_en.ts b/localization/rssguard_en.ts index 511ecac6a..5b856bb69 100644 --- a/localization/rssguard_en.ts +++ b/localization/rssguard_en.ts @@ -161,7 +161,7 @@ - <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> + <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> @@ -215,10 +215,6 @@ &Add tab - - Add tab - - Close &all tabs except current one @@ -247,34 +243,18 @@ &Messages - - Update &all - - Update all feeds. - - Update &selected - - Update selected feeds/categories. - - &Edit selected - - Edit selected feed/category. - - &Delete selected - - Delete selected feeds/categories. @@ -307,10 +287,6 @@ Switch &importance of selected messages - - Mark selected as read - - Mark &all messages read @@ -327,6 +303,110 @@ Dele&te all messages + + Import stuff. + + + + Ctrl+Shift+I + + + + Export stuff. + + + + Ctrl+Shift+E + + + + Quit the application. + + + + Ctrl+Shift+Q + + + + Display settings of the application. + + + + Ctrl+Shift+S + + + + About RSS Guard. + + + + Ctrl+Shift+A + + + + Switch fullscreen mode. + + + + Ctrl+Shift+F + + + + Add new web browser tab. + + + + Ctrl+Shift+T + + + + Close current web browser tab. + + + + Ctrl+Shift+C + + + + Update &all feeds + + + + Update &selected feeds + + + + &Edit selected feed(s)/category(ies) + + + + &Delete selected feed(s)/category(ies) + + + + Mark selected feed(s)/category(ies) as read + + + + Mark selected feed(s)/category(ies) as read. + + + + Mark all messages read. + + + + Mark all messages unread. + + + + Delete selected messages. + + + + Delete all messages. + + FormSettings diff --git a/localization/rssguard_nl.ts b/localization/rssguard_nl.ts index aec70df88..181d94038 100644 --- a/localization/rssguard_nl.ts +++ b/localization/rssguard_nl.ts @@ -161,7 +161,7 @@ Auteurs informatie niet gevonden. - <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> + <body>RSS Guard is a (very) tiny feed reader.<br><br>This software is distributed under the terms of GNU General Public License, version 3.<br><br>Contacts:<ul><li><a href="mailto://rotter.martinos@gmail.com">rotter.martinos@gmail</a> ~email</li><li><a href="http://www.rssguard.sf.net">www.rssguard.sf.net</a> ~website</li></ul>You can obtain source code for RSS Guard from its website.<br><br><br>Copyright © 2011-%1 Martin Rotter</body> @@ -215,10 +215,6 @@ &Add tab &Tabblad toevoegen - - Add tab - Tabblad toevoegen - Close &all tabs except current one Sluit &alle tabbladen behalve deze @@ -247,34 +243,18 @@ &Messages &Berichten - - Update &all - Update &alles - Update all feeds. Update alle feeds. - - Update &selected - Update ge&selekteerde - Update selected feeds/categories. Update geselekteerde feeds/categorieën. - - &Edit selected - Bew&erk geselekteerde - Edit selected feed/category. Bewerk geselekteerde feeds/categorieën. - - &Delete selected - Verwij&der geselekteerde - Delete selected feeds/categories. verwijder geselekteerde feeds/categorieën. @@ -307,10 +287,6 @@ Switch &importance of selected messages - - Mark selected as read - - Mark &all messages read @@ -327,6 +303,110 @@ Dele&te all messages + + Import stuff. + + + + Ctrl+Shift+I + + + + Export stuff. + + + + Ctrl+Shift+E + + + + Quit the application. + + + + Ctrl+Shift+Q + + + + Display settings of the application. + + + + Ctrl+Shift+S + + + + About RSS Guard. + + + + Ctrl+Shift+A + + + + Switch fullscreen mode. + + + + Ctrl+Shift+F + + + + Add new web browser tab. + + + + Ctrl+Shift+T + + + + Close current web browser tab. + + + + Ctrl+Shift+C + + + + Update &all feeds + + + + Update &selected feeds + + + + &Edit selected feed(s)/category(ies) + + + + &Delete selected feed(s)/category(ies) + + + + Mark selected feed(s)/category(ies) as read + + + + Mark selected feed(s)/category(ies) as read. + + + + Mark all messages read. + + + + Mark all messages unread. + + + + Delete selected messages. + + + + Delete all messages. + + FormSettings diff --git a/resources/text/AUTHORS b/resources/text/AUTHORS index 85373560c..42e16c542 100644 --- a/resources/text/AUTHORS +++ b/resources/text/AUTHORS @@ -5,5 +5,6 @@ Authors and contributors:
  • snakebite & tiheum (authors of KFaenza/Faenza icon theme)
  • Digia Plc (author of QtSingleApplication component)
  • Artem Galichkin <doomer3d@gmail.com> (author of original QKeySequenceWidget component)
  • +
  • Elbert Pol (OS/2 packages maintainer).
  • \ No newline at end of file diff --git a/src/core/databasefactory.cpp b/src/core/databasefactory.cpp index 227f2be04..55569c651 100644 --- a/src/core/databasefactory.cpp +++ b/src/core/databasefactory.cpp @@ -30,11 +30,14 @@ DatabaseFactory *DatabaseFactory::getInstance() { void DatabaseFactory::assemblyDatabaseFilePath() { if (Settings::getInstance()->type() == Settings::Portable) { - m_databasePath = qApp->applicationDirPath() + QDir::separator() + QString(APP_DB_PATH); + m_databasePath = qApp->applicationDirPath() + + QDir::separator() + + QString(APP_DB_PATH); } else { - m_databasePath = QDir::homePath() + QDir::separator() + QString(APP_LOW_H_NAME) + - QDir::separator() + QString(APP_DB_PATH); + m_databasePath = QDir::homePath() + QDir::separator() + + QString(APP_LOW_H_NAME) + QDir::separator() + + QString(APP_DB_PATH); } } diff --git a/src/core/defs.h.in b/src/core/defs.h.in index dc739cd5f..4d93683db 100644 --- a/src/core/defs.h.in +++ b/src/core/defs.h.in @@ -22,8 +22,6 @@ #if QT_VERSION >= 0x040600 #define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion() -#else -#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@;") #endif #define TEXT_TITLE_LIMIT 30 diff --git a/src/core/messagesmodel.cpp b/src/core/messagesmodel.cpp index 431ce7690..2747f6f9e 100644 --- a/src/core/messagesmodel.cpp +++ b/src/core/messagesmodel.cpp @@ -63,12 +63,19 @@ void MessagesModel::loadMessages(const QList feed_ids) { stringy_ids.append(QString::number(feed_id)); } - // TODO: časem povolit. + // TODO: Enable when time is right. //setFilter(QString("feed IN (%1) AND deleted = 0").arg(stringy_ids.join(','))); select(); fetchAll(); } +void MessagesModel::endInsertColumns() { + + qDebug("end insert cols"); + + QSqlTableModel::endInsertColumns(); +} + int MessagesModel::messageId(int row_index) const { return record(row_index).value(MSG_DB_ID_INDEX).toInt(); } diff --git a/src/core/messagesmodel.h b/src/core/messagesmodel.h index 16d759d20..4b5d0d7a0 100644 --- a/src/core/messagesmodel.h +++ b/src/core/messagesmodel.h @@ -48,6 +48,9 @@ class MessagesModel : public QSqlTableModel { Message messageAt(int row_index) const; int messageId(int row_index) const; + protected: + void endInsertColumns(); + public slots: // CORE messages manipulators. // NOTE: These are used to change properties of one message. @@ -87,7 +90,6 @@ class MessagesModel : public QSqlTableModel { // Creates "normal" and "bold" fonts. void setupFonts(); - private: QList m_currentFeeds; QList m_headerData; bool m_isInEditingMode; diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index f7b423f4b..0c2dec20a 100644 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -10,6 +10,7 @@ #include "gui/feedmessageviewer.h" #include "gui/webbrowser.h" +#include "gui/formmain.h" #include "gui/messagesview.h" #include "gui/feedsview.h" #include "core/messagesproxymodel.h" @@ -24,10 +25,11 @@ FeedMessageViewer::FeedMessageViewer(QWidget *parent) initialize(); initializeViews(); - // TODO: oddělit do createConnections(); + // TODO: Separate into createConnections. + connect(m_messagesView, SIGNAL(currentMessageRemoved()), + m_messagesBrowser, SLOT(clear())); connect(m_messagesView, SIGNAL(currentMessageChanged(Message)), m_messagesBrowser, SLOT(navigateToMessage(Message))); - } void FeedMessageViewer::initialize() { @@ -35,27 +37,14 @@ void FeedMessageViewer::initialize() { m_toolBar->setFloatable(false); m_toolBar->setMovable(false); m_toolBar->setAllowedAreas(Qt::TopToolBarArea); + m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); - // TODO: testovaci - QMenu *update_menu = new QMenu(m_toolBar); - QAction *testAction = new QAction("test menu item", this); - update_menu->addAction(testAction); + // TODO: For testing. - QToolButton* toolButton = new QToolButton(); - toolButton->setMenu(update_menu); - toolButton->setIcon(QIcon::fromTheme("application-exit")); - toolButton->setText("aaa"); - toolButton->setPopupMode(QToolButton::MenuButtonPopup); - - QWidgetAction* toolButtonAction = new QWidgetAction(this); - toolButtonAction->setDefaultWidget(toolButton); - - m_toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - m_toolBar->addAction(toolButtonAction); - m_toolBar->addAction(QIcon::fromTheme("application-exit"), "aaa"); - QAction *ac = m_toolBar->actions().at(0); - connect(testAction, SIGNAL(triggered()), - m_messagesView, SLOT(setAllMessagesRead())); + // Add everything to toolbar. + m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionUpdateAllFeeds); + m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionUpdateSelectedFeeds); + m_toolBar->addSeparator(); // Finish web/message browser setup. m_messagesBrowser->setNavigationBarVisible(false); diff --git a/src/gui/formabout.ui b/src/gui/formabout.ui index 2626c7754..be78a07e4 100644 --- a/src/gui/formabout.ui +++ b/src/gui/formabout.ui @@ -135,8 +135,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> false @@ -162,15 +162,15 @@ p, li { white-space: pre-wrap; } - 1 + 0 0 0 - 98 - 69 + 687 + 180 @@ -227,8 +227,8 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html> Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -245,8 +245,8 @@ p, li { white-space: pre-wrap; } 0 0 - 685 - 184 + 687 + 180 @@ -297,8 +297,8 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'DejaVu Sans Mono'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html> Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -338,8 +338,8 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;"><br /></span></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> 30 @@ -381,8 +381,8 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><br /></p></body></html> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> false diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp index 767946674..0ae69b9cc 100644 --- a/src/gui/formmain.cpp +++ b/src/gui/formmain.cpp @@ -148,19 +148,27 @@ void FormMain::setupIcons() { m_ui->m_actionImport->setIcon(IconThemeFactory::getInstance()->fromTheme("document-import")); m_ui->m_actionExport->setIcon(IconThemeFactory::getInstance()->fromTheme("document-export")); m_ui->m_actionFullscreen->setIcon(IconThemeFactory::getInstance()->fromTheme("view-fullscreen")); + + // Web browser. + m_ui->m_actionAddBrowser->setIcon(IconThemeFactory::getInstance()->fromTheme("list-add")); + m_ui->m_actionCloseCurrentTab->setIcon(IconThemeFactory::getInstance()->fromTheme("list-remove")); + m_ui->m_actionCloseAllTabs->setIcon(IconThemeFactory::getInstance()->fromTheme("list-remove")); + m_ui->m_menuCurrentTab->setIcon(IconThemeFactory::getInstance()->fromTheme("go-home")); + + // Feeds/messages. m_ui->m_actionUpdateAllFeeds->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); m_ui->m_actionUpdateSelectedFeeds->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - - m_ui->m_actionDeleteAllMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionDeleteSelectedFeeds->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionDeleteSelectedMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionEditSelectedFeed->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionMarkAllMessagesAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionMarkAllMessagesAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionMarkSelectedMessagesAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionMarkSelectedMessagesAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); - m_ui->m_actionSwitchImportanceOfSelectedMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh")); + m_ui->m_actionDeleteAllMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("edit-delete")); + m_ui->m_actionDeleteSelectedFeeds->setIcon(IconThemeFactory::getInstance()->fromTheme("edit-delete")); + m_ui->m_actionDeleteSelectedMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("edit-delete")); + m_ui->m_actionAddNewFeed->setIcon(IconThemeFactory::getInstance()->fromTheme("document-new")); + m_ui->m_actionEditSelectedFeed->setIcon(IconThemeFactory::getInstance()->fromTheme("document-properties")); + m_ui->m_actionMarkAllMessagesAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-read")); + m_ui->m_actionMarkAllMessagesAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-unread")); + m_ui->m_actionMarkFeedsAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-read")); + m_ui->m_actionMarkSelectedMessagesAsRead->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-read")); + m_ui->m_actionMarkSelectedMessagesAsUnread->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-unread")); + m_ui->m_actionSwitchImportanceOfSelectedMessages->setIcon(IconThemeFactory::getInstance()->fromTheme("mail-mark-important")); // Setup icons for underlying components: opened web browsers... diff --git a/src/gui/formmain.h b/src/gui/formmain.h index 66f0427cc..c50c00d9a 100644 --- a/src/gui/formmain.h +++ b/src/gui/formmain.h @@ -9,7 +9,10 @@ class FormMain : public QMainWindow { Q_OBJECT - + + friend class TabWidget; + friend class FeedMessageViewer; + public: // Constructors and destructors. explicit FormMain(QWidget *parent = 0); diff --git a/src/gui/formmain.ui b/src/gui/formmain.ui index e5cdd321d..1ff581b36 100644 --- a/src/gui/formmain.ui +++ b/src/gui/formmain.ui @@ -48,7 +48,7 @@ 0 0 800 - 21 + 19 @@ -100,6 +100,7 @@ + @@ -131,40 +132,55 @@ &Import + + Import stuff. + - Ctrl+Shift+I + Ctrl+Shift+I E&xport + + Export stuff. + - Ctrl+Shift+E + Ctrl+Shift+E &Quit + + Quit the application. + - Ctrl+Shift+Q + Ctrl+Shift+Q &Settings + + Display settings of the application. + - Ctrl+Shift+S + Ctrl+Shift+S &About RSS Guard + + About RSS Guard. + - Ctrl+Shift+A + Ctrl+Shift+A @@ -174,8 +190,11 @@ &Fullscreen mode + + Switch fullscreen mode. + - Ctrl+Shift+F + Ctrl+Shift+F @@ -183,10 +202,10 @@ &Add tab - Add tab + Add new web browser tab. - Ctrl+Shift+T + Ctrl+Shift+T @@ -204,8 +223,11 @@ Close current &tab + + Close current web browser tab. + - Ctrl+Shift+C + Ctrl+Shift+C @@ -224,47 +246,35 @@ - Update &all + Update &all feeds Update all feeds. - - - - Update &selected + Update &selected feeds Update selected feeds/categories. - - - - &Edit selected + &Edit selected feed(s)/category(ies) Edit selected feed/category. - - - - &Delete selected + &Delete selected feed(s)/category(ies) Delete selected feeds/categories. - - - @@ -301,42 +311,50 @@ - Mark selected as read + Mark selected feed(s)/category(ies) as read - - + + Mark selected feed(s)/category(ies) as read. Mark &all messages read - - + + Mark all messages read. Mark a&ll messages unread - - + + Mark all messages unread. &Delete selected messages - - + + Delete selected messages. Dele&te all messages - - + + Delete all messages. + + + + + Add new &feed + + + Add new feed. diff --git a/src/gui/iconthemefactory.h b/src/gui/iconthemefactory.h index 64070940e..11a1fbba1 100644 --- a/src/gui/iconthemefactory.h +++ b/src/gui/iconthemefactory.h @@ -54,6 +54,8 @@ class IconThemeFactory : public QObject { static QPointer s_instance; }; +// NOTE: Think about removing dynamic icon theme change, +// because skins are not dynamic nor tranlations. class IconThemeFactoryEvent : public QEvent { public: enum Type { diff --git a/src/gui/skinfactory.cpp b/src/gui/skinfactory.cpp index a106276a7..e03801667 100644 --- a/src/gui/skinfactory.cpp +++ b/src/gui/skinfactory.cpp @@ -40,7 +40,7 @@ void SkinFactory::loadCurrentSkin() { qDebug("Skin '%s' loaded.", qPrintable(skin_name_from_settings)); } else { - // TODO: změnit toto na qFatal v produkčním kodu. + // TODO: Change this to qFatal once code is stable. qWarning("Skin '%s' not loaded because its data are corrupted. No skin is loaded now!", qPrintable(skin_name_from_settings)); } @@ -152,7 +152,8 @@ Skin SkinFactory::getSkinInfo(const QString &skin_name, bool *ok) { skin.m_layoutMarkup = QByteArray::fromBase64(skin.m_layoutMarkup.toLocal8Bit()); // Obtain other information. - skin.m_baseName = skin_name; + // NOTE: Probably fixed bug with "active skin" on Windows. + skin.m_baseName = QString(skin_name).replace(QDir::separator(), '/'); // Free resources. skin_file.close(); @@ -182,8 +183,6 @@ QList SkinFactory::getInstalledSkins() { foreach (QString skin_file, skin_files) { // Check if skin file is valid and add it if it is valid. - // TODO: tady problem se separatorem, na windows v nastaveni - // pak spatne nacte skin Skin skin_info = getSkinInfo(base_directory + QDir::separator() + skin_file, &skin_load_ok); diff --git a/src/gui/webbrowser.cpp b/src/gui/webbrowser.cpp index 7b3ebb01f..127c8c6c8 100644 --- a/src/gui/webbrowser.cpp +++ b/src/gui/webbrowser.cpp @@ -167,8 +167,11 @@ void WebBrowser::navigateToUrl(const QUrl &url) { } } +void WebBrowser::clear() { + m_webView->load(QUrl()); +} + void WebBrowser::navigateToMessage(const Message &message) { - // TODO: dodělat. m_webView->setHtml(SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title, tr("Written by ") + message.m_author, message.m_url, diff --git a/src/gui/webbrowser.h b/src/gui/webbrowser.h index ba181a552..476057c42 100644 --- a/src/gui/webbrowser.h +++ b/src/gui/webbrowser.h @@ -63,6 +63,9 @@ class WebBrowser : public TabContent { // Navigates to message. void navigateToMessage(const Message &message); + // Clears contents. + void clear(); + // Zoom manipulators. void increaseZoom(); void decreaseZoom();