many
This commit is contained in:
parent
82f6f2491e
commit
d16dbfa2e2
@ -353,7 +353,6 @@ set(APP_TEXT
|
||||
|
||||
# Wrap files, create moc files.
|
||||
if(${USE_QT_5})
|
||||
#qt5_wrap_cpp(APP_MOC ${APP_HEADERS})
|
||||
qt5_wrap_ui(APP_UI ${APP_FORMS})
|
||||
qt5_add_resources(APP_RCC ${APP_RESOURCES})
|
||||
|
||||
@ -453,6 +452,8 @@ if(WIN32 OR OS2)
|
||||
install(FILES resources/graphics/${APP_LOW_NAME}_plain_128.png
|
||||
DESTINATION ./
|
||||
RENAME ${APP_LOW_NAME}_plain.png)
|
||||
install(FILES resources/graphics/${APP_LOW_NAME}.ico
|
||||
DESTINATION ./)
|
||||
install(FILES ${APP_QM}
|
||||
DESTINATION ./l10n)
|
||||
install(FILES ${APP_TEXT}
|
||||
|
@ -161,8 +161,8 @@
|
||||
<translation>Informace o autorech nebyly nalezeny.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><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></source>
|
||||
<translation><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></translation>
|
||||
<source><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></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -407,6 +407,14 @@
|
||||
<source>Delete all messages.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new &feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new feed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormSettings</name>
|
||||
@ -558,14 +566,6 @@
|
||||
<source>Do you want to restart now?</source>
|
||||
<translation>Chcete restartovat nyní?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language changed</source>
|
||||
<translation>Jazyk změněn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with RSS Guard restart</source>
|
||||
<translation>Problém s restartem</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> (not supported on this platform)</source>
|
||||
<translation> (na této platformě nepodporováno)</translation>
|
||||
@ -610,14 +610,6 @@
|
||||
<source>Web browser & proxy</source>
|
||||
<translation>Webový prohlížeč & proxy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language of RSS Guard was changed. Note that changes will take effect on next Qonverter start.</source>
|
||||
<translation>Jazyk RSS Guardu byl změnen. Změn se projeví až po restartu aplikace.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RSS Guard couldn't be restarted, please restart it manually for changes to take effect.</source>
|
||||
<translation>RSS Guard nemohl být restartován, prosím restartuje jej ručně.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable (Tray icon is not available.)</source>
|
||||
<translation>Zakázat (Notifikační ikona není k dispozici.)</translation>
|
||||
@ -679,6 +671,31 @@
|
||||
<source>Hide tab bar if just one tab is visible</source>
|
||||
<translation>Skrýt přepínač tabů, je-li viditelný pouze jeden tab</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Some critical settings were changed and will be applied after the application gets restarted.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Critical settings were changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>List of changes:
|
||||
%1.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with application restart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application couldn't be restarted. Please, restart it manually for changes to take effect.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>• language changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormWelcome</name>
|
||||
|
@ -161,7 +161,7 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><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></source>
|
||||
<source><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></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -407,6 +407,14 @@
|
||||
<source>Delete all messages.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new &feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new feed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormSettings</name>
|
||||
@ -558,14 +566,6 @@
|
||||
<source>Do you want to restart now?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with RSS Guard restart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> (not supported on this platform)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -610,14 +610,6 @@
|
||||
<source>Web browser & proxy</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language of RSS Guard was changed. Note that changes will take effect on next Qonverter start.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RSS Guard couldn't be restarted, please restart it manually for changes to take effect.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable (Tray icon is not available.)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -673,6 +665,31 @@
|
||||
<source>Hide tab bar if just one tab is visible</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Some critical settings were changed and will be applied after the application gets restarted.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Critical settings were changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>List of changes:
|
||||
%1.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with application restart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application couldn't be restarted. Please, restart it manually for changes to take effect.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>• language changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormWelcome</name>
|
||||
|
@ -161,7 +161,7 @@
|
||||
<translation>Auteurs informatie niet gevonden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><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></source>
|
||||
<source><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></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -407,6 +407,14 @@
|
||||
<source>Delete all messages.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new &feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add new feed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormSettings</name>
|
||||
@ -558,14 +566,6 @@
|
||||
<source>Do you want to restart now?</source>
|
||||
<translation>Wil je nu herstarten?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language changed</source>
|
||||
<translation>Taal is veranderd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with RSS Guard restart</source>
|
||||
<translation>Problemen met RSS Guard herstart</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> (not supported on this platform)</source>
|
||||
<translation> (Platform wordt niet ondersteunt)</translation>
|
||||
@ -610,14 +610,6 @@
|
||||
<source>Web browser & proxy</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language of RSS Guard was changed. Note that changes will take effect on next Qonverter start.</source>
|
||||
<translation>Taal van RSS Guard is veranderd. Taal veranderd bij een herstart.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RSS Guard couldn't be restarted, please restart it manually for changes to take effect.</source>
|
||||
<translation>RSS Guard kan niet worden geherstart, herstart het handmatig AUB.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable (Tray icon is not available.)</source>
|
||||
<translation>Uitzetten (Pictogram in systeemvak is niet beschikbaar.)</translation>
|
||||
@ -680,6 +672,31 @@
|
||||
<source>Hide tab bar if just one tab is visible</source>
|
||||
<translation>Verberg tabblad als alleen een tabblad zichtbaar is</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Some critical settings were changed and will be applied after the application gets restarted.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Critical settings were changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>List of changes:
|
||||
%1.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Problem with application restart</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Application couldn't be restarted. Please, restart it manually for changes to take effect.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>• language changed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FormWelcome</name>
|
||||
|
@ -130,10 +130,16 @@ QVariant MessagesModel::data(const QModelIndex &idx, int role) const {
|
||||
}
|
||||
}
|
||||
|
||||
// Return RAW data for EditRole.
|
||||
// Return RAW data for EditRole.
|
||||
case Qt::EditRole:
|
||||
return QSqlTableModel::data(idx, role);
|
||||
|
||||
// Return "red" color for just deleted messages.
|
||||
case Qt::BackgroundRole:
|
||||
return record(idx.row()).value(MSG_DB_DELETED_INDEX).toInt() == 1 ?
|
||||
QColor(255, 0, 0, 100) :
|
||||
QVariant();
|
||||
|
||||
case Qt::FontRole:
|
||||
return record(idx.row()).value(MSG_DB_READ_INDEX).toInt() == 1 ?
|
||||
m_normalFont :
|
||||
|
@ -71,6 +71,7 @@ class MessagesModel : public QSqlTableModel {
|
||||
// NOTE: These methods are used for changing of attributes
|
||||
// of many messages via DIRECT SQL calls.
|
||||
// List of loaded feed ids is used for WHERE clause.
|
||||
// Model is reset after one of these methods is applied.
|
||||
bool switchAllMessageImportance();
|
||||
bool setAllMessagesDeleted(int deleted);
|
||||
bool setAllMessagesRead(int read);
|
||||
|
@ -19,8 +19,9 @@ QDateTime TextFactory::parseDateTime(const QString &date_time) {
|
||||
QString temp;
|
||||
QLocale locale(QLocale::C);
|
||||
QStringList date_patterns;
|
||||
// Dec 1 2013 07:56:46
|
||||
date_patterns << "yyyy-MM-ddTHH:mm:ss" << "MMM dd yyyy hh:mm:ss" <<
|
||||
"MMM hd yyyy hh:mm:ss" << "ddd, dd MMM yyyy HH:mm:ss" <<
|
||||
"MMM d yyyy hh:mm:ss" << "ddd, dd MMM yyyy HH:mm:ss" <<
|
||||
"dd MMM yyyy" << "yyyy-MM-dd HH:mm:ss.z" << "yyyy-MM-dd" <<
|
||||
"YYYY" << "YYYY-MM" << "YYYY-MM-DD" << "YYYY-MM-DDThh:mmTZD" <<
|
||||
"YYYY-MM-DDThh:mm:ssTZD";
|
||||
|
@ -23,7 +23,7 @@ bool DynamicShortcutsWidget::areShortcutsUnique() {
|
||||
QList<QKeySequence> all_shortcuts;
|
||||
|
||||
// Obtain all shortcuts.
|
||||
foreach (ActionBinding binding, m_actionBindings) {
|
||||
foreach (const ActionBinding &binding, m_actionBindings) {
|
||||
QKeySequence new_shortcut = binding.second->shortcut();
|
||||
|
||||
if (all_shortcuts.contains(new_shortcut)) {
|
||||
|
@ -39,12 +39,13 @@ void FeedMessageViewer::initialize() {
|
||||
m_toolBar->setAllowedAreas(Qt::TopToolBarArea);
|
||||
m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
|
||||
// TODO: For testing.
|
||||
|
||||
// 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();
|
||||
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionMarkAllMessagesAsRead);
|
||||
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionMarkAllMessagesAsUnread);
|
||||
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionDeleteAllMessages);
|
||||
|
||||
// Finish web/message browser setup.
|
||||
m_messagesBrowser->setNavigationBarVisible(false);
|
||||
|
@ -130,13 +130,6 @@ void FormMain::onAboutToQuit() {
|
||||
}
|
||||
|
||||
bool FormMain::event(QEvent *event) {
|
||||
if (event->type() == IconThemeFactoryEvent::type()) {
|
||||
// Handle the change of icon theme.
|
||||
setupIcons();
|
||||
event->accept();
|
||||
return true;
|
||||
}
|
||||
|
||||
return QMainWindow::event(event);
|
||||
}
|
||||
|
||||
|
@ -282,14 +282,14 @@ void FormSettings::saveProxy() {
|
||||
void FormSettings::loadLanguage() {
|
||||
QList<Language> languages = Localization::getInstalledLanguages();
|
||||
|
||||
foreach (Language lang, languages) {
|
||||
foreach (const Language &language, languages) {
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->m_treeLanguages);
|
||||
item->setText(0, lang.m_name);
|
||||
item->setText(1, lang.m_code);
|
||||
item->setText(2, lang.m_version);
|
||||
item->setText(3, lang.m_author);
|
||||
item->setText(4, lang.m_email);
|
||||
item->setIcon(0, QIcon(APP_FLAGS_PATH + "/" + lang.m_code + ".png"));
|
||||
item->setText(0, language.m_name);
|
||||
item->setText(1, language.m_code);
|
||||
item->setText(2, language.m_version);
|
||||
item->setText(3, language.m_author);
|
||||
item->setText(4, language.m_email);
|
||||
item->setIcon(0, QIcon(APP_FLAGS_PATH + "/" + language.m_code + ".png"));
|
||||
}
|
||||
|
||||
QList<QTreeWidgetItem*> matching_items = m_ui->m_treeLanguages->findItems(Settings::getInstance()->value(APP_CFG_GEN,
|
||||
@ -315,7 +315,11 @@ void FormSettings::saveLanguage() {
|
||||
QString new_lang = m_ui->m_treeLanguages->currentItem()->text(1);
|
||||
|
||||
if (new_lang != actual_lang) {
|
||||
m_changedDataTexts.append(tr("• language changed"));
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_changedDataTexts.append(tr(" • language changed"));
|
||||
#else
|
||||
m_changedDataTexts.append(trUtf8(" • language changed"));
|
||||
#endif
|
||||
settings->setValue(APP_CFG_GEN, "language", new_lang);
|
||||
}
|
||||
}
|
||||
@ -388,7 +392,7 @@ void FormSettings::loadInterface() {
|
||||
// Load settings of icon theme.
|
||||
QString current_theme = IconThemeFactory::getInstance()->getCurrentIconTheme();
|
||||
|
||||
foreach (QString icon_theme_name, IconThemeFactory::getInstance()->getInstalledIconThemes()) {
|
||||
foreach (const QString &icon_theme_name, IconThemeFactory::getInstance()->getInstalledIconThemes()) {
|
||||
if (icon_theme_name == APP_THEME_SYSTEM) {
|
||||
#if defined(Q_OS_LINUX)
|
||||
m_ui->m_cmbIconTheme->addItem(tr("system icon theme (default)"),
|
||||
@ -424,7 +428,7 @@ void FormSettings::loadInterface() {
|
||||
QList<Skin> installed_skins = SkinFactory::getInstance()->getInstalledSkins();
|
||||
QString selected_skin = SkinFactory::getInstance()->getSelectedSkinName();
|
||||
|
||||
foreach (Skin skin, installed_skins) {
|
||||
foreach (const Skin &skin, installed_skins) {
|
||||
QTreeWidgetItem *new_item = new QTreeWidgetItem(QStringList() <<
|
||||
skin.m_visibleName <<
|
||||
skin.m_version <<
|
||||
@ -491,7 +495,15 @@ void FormSettings::saveInterface() {
|
||||
// Save and activate new skin.
|
||||
if (m_ui->m_treeSkins->selectedItems().size() > 0) {
|
||||
Skin active_skin = m_ui->m_treeSkins->currentItem()->data(0, Qt::UserRole).value<Skin>();
|
||||
SkinFactory::getInstance()->setCurrentSkinName(active_skin.m_baseName);
|
||||
|
||||
if (SkinFactory::getInstance()->getSelectedSkinName() != active_skin.m_baseName) {
|
||||
SkinFactory::getInstance()->setCurrentSkinName(active_skin.m_baseName);
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_changedDataTexts.append(tr(" • skin changed"));
|
||||
#else
|
||||
m_changedDataTexts.append(trUtf8(" • skin changed"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Save tab settings.
|
||||
|
@ -21,8 +21,6 @@ struct TemporarySettings {
|
||||
|
||||
QColor m_webBrowserProgress;
|
||||
QString m_skin;
|
||||
|
||||
|
||||
};
|
||||
|
||||
class FormSettings : public QDialog {
|
||||
|
@ -11,31 +11,6 @@
|
||||
|
||||
|
||||
QPointer<IconThemeFactory> IconThemeFactory::s_instance;
|
||||
QEvent::Type IconThemeFactoryEvent::m_typeOfEvent = QEvent::None;
|
||||
|
||||
//
|
||||
// ThemeFactoryEvent class
|
||||
//
|
||||
|
||||
IconThemeFactoryEvent::IconThemeFactoryEvent() : QEvent(IconThemeFactoryEvent::type()) {
|
||||
}
|
||||
|
||||
IconThemeFactoryEvent::~IconThemeFactoryEvent() {
|
||||
qDebug("Destroying IconThemeFactoryEvent.");
|
||||
}
|
||||
|
||||
QEvent::Type IconThemeFactoryEvent::type() {
|
||||
if (m_typeOfEvent == QEvent::None) {
|
||||
m_typeOfEvent = static_cast<QEvent::Type>(QEvent::registerEventType(2000));
|
||||
}
|
||||
|
||||
return m_typeOfEvent;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ThemeFactory class
|
||||
//
|
||||
|
||||
IconThemeFactory::IconThemeFactory(QObject *parent)
|
||||
: QObject(parent), m_currentIconTheme(APP_THEME_SYSTEM) {
|
||||
@ -71,10 +46,9 @@ void IconThemeFactory::setCurrentIconTheme(const QString &theme_name) {
|
||||
Settings::getInstance()->setValue(APP_CFG_GUI,
|
||||
"icon_theme",
|
||||
theme_name);
|
||||
loadCurrentIconTheme(true);
|
||||
}
|
||||
|
||||
void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) {
|
||||
void IconThemeFactory::loadCurrentIconTheme() {
|
||||
QStringList installed_themes = getInstalledIconThemes();
|
||||
QString theme_name_from_settings = Settings::getInstance()->value(APP_CFG_GUI,
|
||||
"icon_theme",
|
||||
@ -104,15 +78,6 @@ void IconThemeFactory::loadCurrentIconTheme(bool notify_widgets) {
|
||||
QIcon::setThemeName(APP_THEME_SYSTEM);
|
||||
m_currentIconTheme = APP_THEME_SYSTEM;
|
||||
}
|
||||
|
||||
// We need to deliver custom event for all widgets
|
||||
// to make sure they get a chance to setup their icons.
|
||||
if (notify_widgets) {
|
||||
foreach (QWidget *widget, QtSingleApplication::allWidgets()) {
|
||||
QtSingleApplication::postEvent((QObject*) widget,
|
||||
new IconThemeFactoryEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QStringList IconThemeFactory::getInstalledIconThemes() {
|
||||
@ -123,11 +88,11 @@ QStringList IconThemeFactory::getInstalledIconThemes() {
|
||||
QStringList icon_themes_paths = QIcon::themeSearchPaths();
|
||||
icon_themes_paths.removeDuplicates();
|
||||
|
||||
foreach (QString icon_path, icon_themes_paths) {
|
||||
foreach (const QString &icon_path, icon_themes_paths) {
|
||||
QDir icon_dir(icon_path);
|
||||
|
||||
// Iterate all icon themes in this directory.
|
||||
foreach (QString icon_theme_path, icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
|
||||
foreach (const QString &icon_theme_path, icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot |
|
||||
QDir::Readable | QDir::CaseSensitive |
|
||||
QDir::NoSymLinks,
|
||||
QDir::Time)) {
|
||||
|
@ -35,7 +35,7 @@ class IconThemeFactory : public QObject {
|
||||
// "default" theme is loaded.
|
||||
// NOTE: All existing widgets get a chance to repaint its icons if
|
||||
// notify_widgets is true.
|
||||
void loadCurrentIconTheme(bool notify_widgets);
|
||||
void loadCurrentIconTheme();
|
||||
|
||||
// Returns name of currently activated theme for the application.
|
||||
QString getCurrentIconTheme();
|
||||
@ -54,22 +54,4 @@ class IconThemeFactory : public QObject {
|
||||
static QPointer<IconThemeFactory> s_instance;
|
||||
};
|
||||
|
||||
// NOTE: Think about removing dynamic icon theme change,
|
||||
// because skins are not dynamic nor tranlations.
|
||||
class IconThemeFactoryEvent : public QEvent {
|
||||
public:
|
||||
enum Type {
|
||||
IconThemeChange = 2000
|
||||
};
|
||||
|
||||
// Constructors.
|
||||
explicit IconThemeFactoryEvent();
|
||||
virtual ~IconThemeFactoryEvent();
|
||||
|
||||
static QEvent::Type type();
|
||||
|
||||
private:
|
||||
static QEvent::Type m_typeOfEvent;
|
||||
};
|
||||
|
||||
#endif // THEMEFACTORY_H
|
||||
|
@ -78,7 +78,7 @@ bool SkinFactory::loadSkinFromData(const Skin &skin) {
|
||||
}
|
||||
|
||||
// Iterate supported styles and load one.
|
||||
foreach (QString style, skin.m_stylesNames) {
|
||||
foreach (const QString &style, skin.m_stylesNames) {
|
||||
if (qApp->setStyle(style) != 0) {
|
||||
qDebug("Style '%s' loaded.", qPrintable(style));
|
||||
break;
|
||||
@ -176,12 +176,12 @@ QList<Skin> SkinFactory::getInstalledSkins() {
|
||||
QDir::NoSymLinks |
|
||||
QDir::Readable);
|
||||
|
||||
foreach (QString base_directory, skin_directories) {
|
||||
foreach (const QString &base_directory, skin_directories) {
|
||||
// Check skins installed in this base directory.
|
||||
QStringList skin_files = QDir(APP_SKIN_PATH + QDir::separator() + base_directory).entryList(QStringList() << "*.xml",
|
||||
QDir::Files | QDir::Readable | QDir::NoDotAndDotDot | QDir::NoSymLinks);
|
||||
QDir::Files | QDir::Readable | QDir::NoDotAndDotDot | QDir::NoSymLinks);
|
||||
|
||||
foreach (QString skin_file, skin_files) {
|
||||
foreach (const QString &skin_file, skin_files) {
|
||||
// Check if skin file is valid and add it if it is valid.
|
||||
Skin skin_info = getSkinInfo(base_directory + QDir::separator() + skin_file,
|
||||
&skin_load_ok);
|
||||
|
@ -20,7 +20,7 @@ struct Skin {
|
||||
|
||||
Q_DECLARE_METATYPE(Skin)
|
||||
|
||||
// TODO: Skin "base/vergilius.xml" is now NEEDED for rssguard
|
||||
// NOTE: Skin "base/vergilius.xml" is now NEEDED for rssguard
|
||||
// to run. IT IS DEFAULT skin. It sets no styles and stylesheet.
|
||||
// It just contains markup for webbrowser.
|
||||
// NOTE: Check skins "base/vergilius.xml" and "luxuous.xml"
|
||||
|
@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
|
||||
// Add an extra path for non-system icon themes and set current icon theme
|
||||
// and skin.
|
||||
IconThemeFactory::getInstance()->setupSearchPaths();
|
||||
IconThemeFactory::getInstance()->loadCurrentIconTheme(false);
|
||||
IconThemeFactory::getInstance()->loadCurrentIconTheme();
|
||||
SkinFactory::getInstance()->loadCurrentSkin();
|
||||
|
||||
// Load localization and setup locale before any widget is constructed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user