Rename some classes.

This commit is contained in:
Martin Rotter 2016-06-18 20:38:24 +02:00
parent f755277853
commit 3101d0916f
11 changed files with 59 additions and 59 deletions

View File

@ -189,7 +189,6 @@ HEADERS += src/core/feeddownloader.h \
src/gui/labelwithstatus.h \
src/gui/lineeditwithstatus.h \
src/gui/messagebox.h \
src/gui/messagepreviewer.h \
src/gui/messagessearchlineedit.h \
src/gui/messagestoolbar.h \
src/gui/messagesview.h \
@ -264,8 +263,9 @@ HEADERS += src/core/feeddownloader.h \
src/services/tt-rss/ttrssrecyclebin.h \
src/services/tt-rss/ttrssserviceentrypoint.h \
src/services/tt-rss/ttrssserviceroot.h \
src/gui/messagebrowser.h \
src/network-web/messagebrowserpage.h
src/network-web/messagebrowserpage.h \
src/gui/webviewer.h \
src/gui/webbrowser.h
SOURCES += src/core/feeddownloader.cpp \
src/core/feedsmodel.cpp \
@ -299,7 +299,6 @@ SOURCES += src/core/feeddownloader.cpp \
src/gui/labelwithstatus.cpp \
src/gui/lineeditwithstatus.cpp \
src/gui/messagebox.cpp \
src/gui/messagepreviewer.cpp \
src/gui/messagessearchlineedit.cpp \
src/gui/messagestoolbar.cpp \
src/gui/messagesview.cpp \
@ -372,10 +371,11 @@ SOURCES += src/core/feeddownloader.cpp \
src/services/tt-rss/ttrssrecyclebin.cpp \
src/services/tt-rss/ttrssserviceentrypoint.cpp \
src/services/tt-rss/ttrssserviceroot.cpp \
src/gui/messagebrowser.cpp \
src/network-web/messagebrowserpage.cpp
src/network-web/messagebrowserpage.cpp \
src/gui/webviewer.cpp \
src/gui/webbrowser.cpp
FORMS += src/gui/messagepreviewer.ui \
FORMS += \
src/gui/toolbareditor.ui \
src/network-web/downloaditem.ui \
src/network-web/downloadmanager.ui \
@ -391,7 +391,8 @@ FORMS += src/gui/messagepreviewer.ui \
src/services/owncloud/gui/formeditowncloudaccount.ui \
src/services/standard/gui/formstandardcategorydetails.ui \
src/services/standard/gui/formstandardimportexport.ui \
src/services/tt-rss/gui/formeditaccount.ui
src/services/tt-rss/gui/formeditaccount.ui \
src/gui/webbrowser.ui
TRANSLATIONS += localization/qtbase-cs_CZ.ts \
localization/qtbase-da_DK.ts \

View File

@ -36,7 +36,7 @@
#include "gui/messagebox.h"
#include "gui/messagestoolbar.h"
#include "gui/feedstoolbar.h"
#include "gui/messagepreviewer.h"
#include "gui/webbrowser.h"
#include "gui/dialogs/formdatabasecleanup.h"
#include "gui/dialogs/formmain.h"
#include "exceptions/applicationexception.h"
@ -64,7 +64,7 @@ FeedMessageViewer::FeedMessageViewer(QWidget *parent)
m_toolBarMessages(new MessagesToolBar(tr("Toolbar for messages"), this)),
m_messagesView(new MessagesView(this)),
m_feedsView(new FeedsView(this)),
m_messagesBrowser(new MessagePreviewer(this)) {
m_messagesBrowser(new WebBrowser(this)) {
initialize();
initializeViews();
loadMessageViewerFonts();

View File

@ -30,7 +30,7 @@ class WebBrowser;
class MessagesView;
class MessagesToolBar;
class FeedsToolBar;
class MessagePreviewer;
class WebBrowser;
class FeedsView;
class StandardFeed;
class QToolBar;
@ -134,7 +134,7 @@ class FeedMessageViewer : public TabContent {
FeedsView *m_feedsView;
QWidget *m_feedsWidget;
QWidget *m_messagesWidget;
MessagePreviewer *m_messagesBrowser;
WebBrowser *m_messagesBrowser;
};
#endif // FEEDMESSAGEVIEWER_H

View File

@ -24,7 +24,7 @@
#include "network-web/webfactory.h"
#include "gui/dialogs/formmain.h"
#include "gui/messagebox.h"
#include "gui/messagepreviewer.h"
#include "gui/webbrowser.h"
#include "gui/styleditemdelegatewithoutfocus.h"
#include <QKeyEvent>
@ -470,7 +470,7 @@ void MessagesView::filterMessages(MessagesModel::MessageHighlighter filter) {
}
void MessagesView::createNewspaperView(RootItem *selected_item, const QList<Message> &messages) {
MessagePreviewer *prev = new MessagePreviewer(this);
WebBrowser *prev = new WebBrowser(this);
int index = qApp->mainForm()->tabWidget()->addTab(prev,
qApp->icons()->fromTheme(QSL("text-x-script")),
tr("Newspaper view"),

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "gui/messagepreviewer.h"
#include "gui/webbrowser.h"
#include "miscellaneous/application.h"
#include "network-web/webfactory.h"
@ -30,13 +30,12 @@
#include <QToolTip>
void MessagePreviewer::createConnections() {
connect(m_ui->m_webMessage, &MessageBrowser::messageStatusChangeRequested,
this, &MessagePreviewer::receiveMessageStatusChangeRequest);
void WebBrowser::createConnections() {
connect(m_ui->m_webMessage, &WebViewer::messageStatusChangeRequested, this, &WebBrowser::receiveMessageStatusChangeRequest);
}
MessagePreviewer::MessagePreviewer(QWidget *parent) : TabContent(parent),
m_ui(new Ui::MessagePreviewer) {
WebBrowser::WebBrowser(QWidget *parent) : TabContent(parent),
m_ui(new Ui::WebBrowser) {
m_ui->setupUi(this);
createConnections();
@ -44,10 +43,10 @@ MessagePreviewer::MessagePreviewer(QWidget *parent) : TabContent(parent),
clear();
}
MessagePreviewer::~MessagePreviewer() {
WebBrowser::~WebBrowser() {
}
void MessagePreviewer::reloadFontSettings() {
void WebBrowser::reloadFontSettings() {
QFont fon;
fon.fromString(qApp->settings()->value(GROUP(Messages),
SETTING(Messages::PreviewerFontStandard)).toString());
@ -56,12 +55,12 @@ void MessagePreviewer::reloadFontSettings() {
QWebEngineSettings::globalSettings()->setFontSize(QWebEngineSettings::DefaultFontSize, fon.pointSize());
}
void MessagePreviewer::clear() {
void WebBrowser::clear() {
m_ui->m_webMessage->clear();
hide();
}
void MessagePreviewer::loadMessages(const QList<Message> &messages, RootItem *root) {
void WebBrowser::loadMessages(const QList<Message> &messages, RootItem *root) {
if (m_messages.size() == messages.size()) {
for (int i = 0; i < messages.size(); i++) {
if (m_messages.at(i).m_customId != messages.at(i).m_customId) {
@ -84,11 +83,11 @@ void MessagePreviewer::loadMessages(const QList<Message> &messages, RootItem *ro
}
}
void MessagePreviewer::loadMessage(const Message &message, RootItem *root) {
void WebBrowser::loadMessage(const Message &message, RootItem *root) {
loadMessages(QList<Message>() << message, root);
}
void MessagePreviewer::receiveMessageStatusChangeRequest(int message_id, MessageBrowserPage::MessageStatusChange change) {
void WebBrowser::receiveMessageStatusChangeRequest(int message_id, MessageBrowserPage::MessageStatusChange change) {
switch (change) {
case MessageBrowserPage::MarkRead:
markMessageAsRead(message_id, true);
@ -111,7 +110,7 @@ void MessagePreviewer::receiveMessageStatusChangeRequest(int message_id, Message
}
}
void MessagePreviewer::markMessageAsRead(int id, bool read) {
void WebBrowser::markMessageAsRead(int id, bool read) {
if (!m_root.isNull()) {
Message *msg = findMessage(id);
@ -131,7 +130,7 @@ void MessagePreviewer::markMessageAsRead(int id, bool read) {
}
}
void MessagePreviewer::switchMessageImportance(int id, bool checked) {
void WebBrowser::switchMessageImportance(int id, bool checked) {
if (!m_root.isNull()) {
Message *msg = findMessage(id);
@ -155,7 +154,7 @@ void MessagePreviewer::switchMessageImportance(int id, bool checked) {
}
}
Message *MessagePreviewer::findMessage(int id) {
Message *WebBrowser::findMessage(int id) {
for (int i = 0; i < m_messages.size(); i++) {
if (m_messages.at(i).m_id == id) {
return &m_messages[i];

View File

@ -15,12 +15,12 @@
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef MESSAGEPREVIEWER_H
#define MESSAGEPREVIEWER_H
#ifndef WEBBROWSER_H
#define WEBBROWSER_H
#include "gui/tabcontent.h"
#include "ui_messagepreviewer.h"
#include "ui_webbrowser.h"
#include "core/message.h"
#include "services/abstract/rootitem.h"
@ -34,12 +34,12 @@ namespace Ui {
class QToolBar;
class MessagePreviewer : public TabContent {
class WebBrowser : public TabContent {
Q_OBJECT
public:
explicit MessagePreviewer(QWidget *parent = 0);
virtual ~MessagePreviewer();
explicit WebBrowser(QWidget *parent = 0);
virtual ~WebBrowser();
void reloadFontSettings();
@ -62,9 +62,9 @@ class MessagePreviewer : public TabContent {
void switchMessageImportance(int id, bool checked);
void createConnections();
QScopedPointer<Ui::MessagePreviewer> m_ui;
QScopedPointer<Ui::WebBrowser> m_ui;
QList<Message> m_messages;
QPointer<RootItem> m_root;
};
#endif // MESSAGEPREVIEWER_H
#endif // WEBBROWSER_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MessagePreviewer</class>
<widget class="QWidget" name="MessagePreviewer">
<class>WebBrowser</class>
<widget class="QWidget" name="WebBrowser">
<property name="geometry">
<rect>
<x>0</x>
@ -30,15 +30,15 @@
<number>0</number>
</property>
<item row="0" column="1">
<widget class="MessageBrowser" name="m_webMessage" native="true"/>
<widget class="WebViewer" name="m_webMessage" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MessageBrowser</class>
<class>WebViewer</class>
<extends>QWidget</extends>
<header>messagebrowser.h</header>
<header>webviewer.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "gui/messagebrowser.h"
#include "gui/webviewer.h"
#include "miscellaneous/skinfactory.h"
#include "miscellaneous/application.h"
@ -23,15 +23,15 @@
#include "network-web/messagebrowserpage.h"
MessageBrowser::MessageBrowser(QWidget *parent) : QWebEngineView(parent) {
WebViewer::WebViewer(QWidget *parent) : QWebEngineView(parent) {
MessageBrowserPage *page = new MessageBrowserPage(this);
connect(page, &MessageBrowserPage::messageStatusChangeRequested,
this, &MessageBrowser::messageStatusChangeRequested);
this, &WebViewer::messageStatusChangeRequested);
setPage(page);
}
void MessageBrowser::loadMessages(const QList<Message> &messages) {
void WebViewer::loadMessages(const QList<Message> &messages) {
Skin skin = qApp->skins()->currentSkin();
QString messages_layout;
QString single_message_layout = skin.m_layoutMarkup;
@ -65,14 +65,14 @@ void MessageBrowser::loadMessages(const QList<Message> &messages) {
setEnabled(previously_enabled);
}
void MessageBrowser::loadMessage(const Message &message) {
void WebViewer::loadMessage(const Message &message) {
loadMessages(QList<Message>() << message);
}
void MessageBrowser::clear() {
void WebViewer::clear() {
setHtml("<!DOCTYPE html><html><body</body></html>", QUrl(INTERNAL_URL_BLANK));
}
void MessageBrowser::assignMessageContents() {
void WebViewer::assignMessageContents() {
setHtml(m_messageContents, QUrl(INTERNAL_URL_MESSAGE));
}

View File

@ -15,8 +15,8 @@
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef MESSAGEBROWSER_H
#define MESSAGEBROWSER_H
#ifndef WEBVIEWER_H
#define WEBVIEWER_H
#include <QWebEngineView>
@ -24,11 +24,11 @@
#include "network-web/messagebrowserpage.h"
class MessageBrowser : public QWebEngineView {
class WebViewer : public QWebEngineView {
Q_OBJECT
public:
explicit MessageBrowser(QWidget* parent = 0);
explicit WebViewer(QWidget* parent = 0);
public slots:
void loadMessages(const QList<Message> &messages);
@ -45,4 +45,4 @@ class MessageBrowser : public QWebEngineView {
QString m_messageContents;
};
#endif // MESSAGEBROWSER_H
#endif // WEBVIEWER_H

View File

@ -18,7 +18,7 @@
#include "network-web/messagebrowserpage.h"
#include "definitions/definitions.h"
#include "gui/messagebrowser.h"
#include "gui/webviewer.h"
#include <QStringList>
#include <QString>
@ -27,8 +27,8 @@
MessageBrowserPage::MessageBrowserPage(QObject *parent) : QWebEnginePage(parent) {
}
MessageBrowser *MessageBrowserPage::view() const {
return qobject_cast<MessageBrowser*>(QWebEnginePage::view());
WebViewer *MessageBrowserPage::view() const {
return qobject_cast<WebViewer*>(QWebEnginePage::view());
}
void MessageBrowserPage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg) {

View File

@ -21,7 +21,7 @@
#include <QWebEnginePage>
class MessageBrowser;
class WebViewer;
class MessageBrowserPage : public QWebEnginePage {
Q_OBJECT
@ -37,7 +37,7 @@ class MessageBrowserPage : public QWebEnginePage {
explicit MessageBrowserPage(QObject *parent = 0);
MessageBrowser *view() const;
WebViewer *view() const;
protected:
void javaScriptAlert(const QUrl &securityOrigin, const QString &msg);