Added empty feed message widget.
This commit is contained in:
parent
1e36d7e3e4
commit
27e78b6b20
|
@ -191,6 +191,7 @@ set(APP_SOURCES
|
|||
src/gui/tabbar.cpp
|
||||
src/gui/tabcontent.cpp
|
||||
src/gui/cornerbutton.cpp
|
||||
src/gui/feedmessageviewer.cpp
|
||||
|
||||
# CORE sources.
|
||||
src/core/debugging.cpp
|
||||
|
@ -236,6 +237,7 @@ set(APP_HEADERS
|
|||
src/gui/tabbar.h
|
||||
src/gui/tabcontent.h
|
||||
src/gui/cornerbutton.h
|
||||
src/gui/feedmessageviewer.h
|
||||
|
||||
# CORE headers.
|
||||
src/core/settings.h
|
||||
|
|
|
@ -4,26 +4,27 @@
|
|||
// Loads currently active language.
|
||||
// NOTE: Macro is used due to QTranslator persistency.
|
||||
#define LoadLocalization(); \
|
||||
QString locale_name = Settings::getInstance()->value(APP_CFG_GEN, \
|
||||
"language", \
|
||||
"en").toString(); \
|
||||
QString locale_name = Settings::getInstance()->value( \
|
||||
APP_CFG_GEN, \
|
||||
"language", \
|
||||
"en").toString(); \
|
||||
QTranslator qt_translator, app_translator; \
|
||||
if (app_translator.load(QString("rssguard_%1.qm").arg(locale_name), \
|
||||
APP_LANG_PATH)) { \
|
||||
QApplication::installTranslator(&app_translator); \
|
||||
qDebug("Application localization %s loaded successfully.", \
|
||||
qPrintable(locale_name)); \
|
||||
APP_LANG_PATH)) { \
|
||||
QApplication::installTranslator(&app_translator); \
|
||||
qDebug("Application localization %s loaded successfully.", \
|
||||
qPrintable(locale_name)); \
|
||||
} \
|
||||
else { \
|
||||
qWarning("Application localization %s was not loaded.", qPrintable(locale_name)); \
|
||||
qWarning("Application localization %s was not loaded.", qPrintable(locale_name)); \
|
||||
} \
|
||||
if (qt_translator.load(QString("qt_%1.qm").arg(locale_name), \
|
||||
APP_LANG_PATH)) { \
|
||||
qDebug("Qt localization %s loaded successfully.", \
|
||||
qPrintable(locale_name)); \
|
||||
APP_LANG_PATH)) { \
|
||||
qDebug("Qt localization %s loaded successfully.", \
|
||||
qPrintable(locale_name)); \
|
||||
} \
|
||||
else { \
|
||||
qWarning("Qt localization %s was not loaded.", qPrintable(locale_name)); \
|
||||
qWarning("Qt localization %s was not loaded.", qPrintable(locale_name)); \
|
||||
} \
|
||||
QLocale::setDefault(QLocale(locale_name));
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#include "gui/feedmessageviewer.h"
|
||||
#include "gui/webbrowser.h"
|
||||
|
||||
|
||||
FeedMessageViewer::FeedMessageViewer(QWidget *parent) : TabContent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FeedMessageViewer::~FeedMessageViewer() {
|
||||
qDebug("Destroying FeedMessageViewer instance.");
|
||||
}
|
||||
|
||||
WebBrowser *FeedMessageViewer::webBrowser() {
|
||||
return NULL;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef FEEDMESSAGEVIEWER_H
|
||||
#define FEEDMESSAGEVIEWER_H
|
||||
|
||||
#include "gui/tabcontent.h"
|
||||
|
||||
|
||||
class WebBrowser;
|
||||
|
||||
class FeedMessageViewer : public TabContent {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FeedMessageViewer(QWidget *parent = 0);
|
||||
virtual ~FeedMessageViewer();
|
||||
|
||||
WebBrowser *webBrowser();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // FEEDMESSAGEVIEWER_H
|
|
@ -81,6 +81,12 @@ void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) {
|
|||
"icon_theme",
|
||||
"mini-kfaenza").toString();
|
||||
|
||||
if (m_currentIconTheme == theme_name_from_settings) {
|
||||
qDebug("Icon theme '%s' already loaded.",
|
||||
qPrintable(theme_name_from_settings));
|
||||
return;
|
||||
}
|
||||
|
||||
// Display list of installed themes.
|
||||
qDebug("Installed icon themes are: %s.",
|
||||
qPrintable(installed_themes.join(", ")));
|
||||
|
@ -88,7 +94,7 @@ void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) {
|
|||
|
||||
if (installed_themes.contains(theme_name_from_settings)) {
|
||||
// Desired icon theme is installed and can be loaded.
|
||||
qDebug("Loading theme '%s'.", qPrintable(theme_name_from_settings));
|
||||
qDebug("Loading icon theme '%s'.", qPrintable(theme_name_from_settings));
|
||||
QIcon::setThemeName(theme_name_from_settings);
|
||||
m_currentIconTheme = theme_name_from_settings;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "gui/tabbar.h"
|
||||
#include "gui/iconthemefactory.h"
|
||||
#include "gui/webbrowser.h"
|
||||
#include "gui/feedmessageviewer.h"
|
||||
#include "gui/cornerbutton.h"
|
||||
|
||||
|
||||
|
@ -43,7 +44,7 @@ TabBar *TabWidget::tabBar() {
|
|||
|
||||
void TabWidget::initializeTabs() {
|
||||
// Create widget for "Feeds" page and add it.
|
||||
WebBrowser *browser = new WebBrowser(this);
|
||||
FeedMessageViewer *browser = new FeedMessageViewer(this);
|
||||
int index_of_browser = addTab(static_cast<TabContent*>(browser),
|
||||
QIcon(),
|
||||
tr("Feeds"),
|
||||
|
@ -196,6 +197,6 @@ void TabWidget::fixContentsAfterMove(int from, int to) {
|
|||
void TabWidget::fixContentsIndexes(int starting_index, int ending_index) {
|
||||
for ( ; starting_index <= ending_index; starting_index++) {
|
||||
TabContent *content = static_cast<TabContent*>(widget(starting_index));
|
||||
content->webBrowser()->setIndex(starting_index);
|
||||
content->setIndex(starting_index);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue