diff --git a/CMakeLists.txt b/CMakeLists.txt index 23d9529a2..b9ddd4395 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,8 +283,8 @@ set(APP_SOURCES src/gui/feedsview.cpp src/gui/messagesview.cpp src/gui/statusbar.cpp - src/gui/formstandardcategorydetails.cpp - src/gui/formstandardfeeddetails.cpp + src/gui/formcategorydetails.cpp + src/gui/formfeeddetails.cpp src/gui/plaintoolbutton.cpp src/gui/lineeditwithstatus.cpp src/gui/widgetwithstatus.cpp @@ -362,8 +362,8 @@ set(APP_HEADERS src/gui/feedsview.h src/gui/messagesview.h src/gui/statusbar.h - src/gui/formstandardcategorydetails.h - src/gui/formstandardfeeddetails.h + src/gui/formcategorydetails.h + src/gui/formfeeddetails.h src/gui/plaintoolbutton.h src/gui/lineeditwithstatus.h src/gui/widgetwithstatus.h @@ -416,8 +416,8 @@ set(APP_FORMS src/gui/formmain.ui src/gui/formsettings.ui src/gui/formabout.ui - src/gui/formstandardcategorydetails.ui - src/gui/formstandardfeeddetails.ui + src/gui/formcategorydetails.ui + src/gui/formfeeddetails.ui src/gui/toolbareditor.ui ) diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index dfdecdc0a..279090b33 100644 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -9,6 +9,8 @@ Fixed: Added: Changed: diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index 71ccea281..d6e714d38 100644 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -65,7 +65,7 @@ #define TIMEZONE_OFFSET_LIMIT 6 #define CHANGE_EVENT_DELAY 250 #define SEACRH_MESSAGES_ACTION_NAME "search" -#define FILTER_ACTION_NAME "filter" +#define HIGHLIGHTER_ACTION_NAME "highlighter" #define SPACER_ACTION_NAME "spacer" #define SEPARATOR_ACTION_NAME "separator" #define FILTER_WIDTH 150 diff --git a/src/gui/basetoolbar.cpp b/src/gui/basetoolbar.cpp index 1debe452b..3ba2522b6 100644 --- a/src/gui/basetoolbar.cpp +++ b/src/gui/basetoolbar.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #include "gui/basetoolbar.h" #include "definitions/definitions.h" @@ -9,6 +26,10 @@ BaseToolBar::BaseToolBar(const QString &title, QWidget *parent) : QToolBar(title, parent) { + // Update right margin of filter textbox. + QMargins margins = contentsMargins(); + margins.setRight(margins.right() + FILTER_RIGHT_MARGIN); + setContentsMargins(margins); } BaseToolBar::~BaseToolBar() { diff --git a/src/gui/basetoolbar.h b/src/gui/basetoolbar.h index b49f7f6f2..47a60e558 100644 --- a/src/gui/basetoolbar.h +++ b/src/gui/basetoolbar.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #ifndef TOOLBAR_H #define TOOLBAR_H diff --git a/src/gui/feedstoolbar.cpp b/src/gui/feedstoolbar.cpp index bbc0bb3fd..718c7b50f 100644 --- a/src/gui/feedstoolbar.cpp +++ b/src/gui/feedstoolbar.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #include "gui/feedstoolbar.h" #include "gui/formmain.h" diff --git a/src/gui/feedstoolbar.h b/src/gui/feedstoolbar.h index 2198a9956..6e55bcc8c 100644 --- a/src/gui/feedstoolbar.h +++ b/src/gui/feedstoolbar.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #ifndef FEEDSTOOLBAR_H #define FEEDSTOOLBAR_H diff --git a/src/gui/feedsview.cpp b/src/gui/feedsview.cpp index ee1cb0711..21b79579b 100644 --- a/src/gui/feedsview.cpp +++ b/src/gui/feedsview.cpp @@ -26,8 +26,8 @@ #include "core/feedsmodelfeed.h" #include "miscellaneous/systemfactory.h" #include "gui/formmain.h" -#include "gui/formstandardcategorydetails.h" -#include "gui/formstandardfeeddetails.h" +#include "gui/formcategorydetails.h" +#include "gui/formfeeddetails.h" #include "gui/systemtrayicon.h" #include "gui/messagebox.h" @@ -270,7 +270,7 @@ void FeedsView::addNewCategory() { return; } - QPointer form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); + QPointer form_pointer = new FormCategoryDetails(m_sourceModel, this); form_pointer.data()->exec(NULL); @@ -281,7 +281,7 @@ void FeedsView::addNewCategory() { } void FeedsView::editCategory(FeedsModelCategory *category) { - QPointer form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); + QPointer form_pointer = new FormCategoryDetails(m_sourceModel, this); form_pointer.data()->exec(category); @@ -309,7 +309,7 @@ void FeedsView::addNewFeed() { return; } - QPointer form_pointer = new FormStandardFeedDetails(m_sourceModel, this); + QPointer form_pointer = new FormFeedDetails(m_sourceModel, this); form_pointer.data()->exec(NULL); @@ -320,7 +320,7 @@ void FeedsView::addNewFeed() { } void FeedsView::editFeed(FeedsModelFeed *feed) { - QPointer form_pointer = new FormStandardFeedDetails(m_sourceModel, this); + QPointer form_pointer = new FormFeedDetails(m_sourceModel, this); form_pointer.data()->exec(feed); diff --git a/src/gui/formstandardcategorydetails.cpp b/src/gui/formcategorydetails.cpp similarity index 89% rename from src/gui/formstandardcategorydetails.cpp rename to src/gui/formcategorydetails.cpp index 82b4c62d5..02bf67aff 100644 --- a/src/gui/formstandardcategorydetails.cpp +++ b/src/gui/formcategorydetails.cpp @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with RSS Guard. If not, see . -#include "gui/formstandardcategorydetails.h" +#include "gui/formcategorydetails.h" #include "definitions/definitions.h" #include "core/feedsmodelrootitem.h" @@ -37,7 +37,7 @@ #include -FormStandardCategoryDetails::FormStandardCategoryDetails(FeedsModel *model, +FormCategoryDetails::FormCategoryDetails(FeedsModel *model, QWidget *parent) : QDialog(parent), m_editableCategory(NULL), @@ -50,11 +50,11 @@ FormStandardCategoryDetails::FormStandardCategoryDetails(FeedsModel *model, onDescriptionChanged(QString()); } -FormStandardCategoryDetails::~FormStandardCategoryDetails() { +FormCategoryDetails::~FormCategoryDetails() { qDebug("Destroying FormCategoryDetails instance."); } -void FormStandardCategoryDetails::createConnections() { +void FormCategoryDetails::createConnections() { // General connections. connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply())); @@ -69,7 +69,7 @@ void FormStandardCategoryDetails::createConnections() { connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon())); } -void FormStandardCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) { +void FormCategoryDetails::setEditableCategory(FeedsModelCategory *editable_category) { m_editableCategory = editable_category; m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_category->parent()))); @@ -78,7 +78,7 @@ void FormStandardCategoryDetails::setEditableCategory(FeedsModelCategory *editab m_ui->m_btnIcon->setIcon(editable_category->icon()); } -int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) { +int FormCategoryDetails::exec(FeedsModelCategory *input_category) { // Load categories. loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem(), @@ -86,7 +86,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) { if (input_category == NULL) { // User is adding new category. - setWindowTitle(tr("Add new standard category")); + setWindowTitle(tr("Add new category")); // Make sure that "default" icon is used as the default option for new // categories. @@ -94,7 +94,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) { } else { // User is editing existing category. - setWindowTitle(tr("Edit existing standard category")); + setWindowTitle(tr("Edit existing category")); setEditableCategory(input_category); } @@ -102,7 +102,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) { return QDialog::exec(); } -void FormStandardCategoryDetails::apply() { +void FormCategoryDetails::apply() { FeedsModelRootItem *parent = static_cast(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value()); FeedsModelCategory *new_category = new FeedsModelCategory(); @@ -151,7 +151,7 @@ void FormStandardCategoryDetails::apply() { } } -void FormStandardCategoryDetails::onTitleChanged(const QString &new_title){ +void FormCategoryDetails::onTitleChanged(const QString &new_title){ if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) { m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Category name is ok.")); @@ -162,7 +162,7 @@ void FormStandardCategoryDetails::onTitleChanged(const QString &new_title){ } } -void FormStandardCategoryDetails::onDescriptionChanged(const QString &new_description) { +void FormCategoryDetails::onDescriptionChanged(const QString &new_description) { if (new_description.simplified().isEmpty()) { m_ui->m_txtDescription->setStatus(LineEditWithStatus::Warning, tr("Description is empty.")); } @@ -171,11 +171,11 @@ void FormStandardCategoryDetails::onDescriptionChanged(const QString &new_descri } } -void FormStandardCategoryDetails::onNoIconSelected() { +void FormCategoryDetails::onNoIconSelected() { m_ui->m_btnIcon->setIcon(QIcon()); } -void FormStandardCategoryDetails::onLoadIconFromFile() { +void FormCategoryDetails::onLoadIconFromFile() { QFileDialog dialog(this, tr("Select icon file for the category"), QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)")); dialog.setFileMode(QFileDialog::ExistingFile); @@ -194,12 +194,12 @@ void FormStandardCategoryDetails::onLoadIconFromFile() { } } -void FormStandardCategoryDetails::onUseDefaultIcon() { +void FormCategoryDetails::onUseDefaultIcon() { m_ui->m_btnIcon->setIcon(IconFactory::instance()->fromTheme("folder-category")); } -void FormStandardCategoryDetails::initialize() { - m_ui = new Ui::FormStandardCategoryDetails(); +void FormCategoryDetails::initialize() { + m_ui = new Ui::FormCategoryDetails(); m_ui->setupUi(this); // Set text boxes. @@ -245,7 +245,7 @@ void FormStandardCategoryDetails::initialize() { m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason); } -void FormStandardCategoryDetails::loadCategories(const QList categories, +void FormCategoryDetails::loadCategories(const QList categories, FeedsModelRootItem *root_item, FeedsModelCategory *input_category) { m_ui->m_cmbParentCategory->addItem(root_item->icon(), diff --git a/src/gui/formstandardcategorydetails.h b/src/gui/formcategorydetails.h similarity index 88% rename from src/gui/formstandardcategorydetails.h rename to src/gui/formcategorydetails.h index c36868f11..8bd3ab93e 100644 --- a/src/gui/formstandardcategorydetails.h +++ b/src/gui/formcategorydetails.h @@ -18,13 +18,13 @@ #ifndef FORMCATEGORYDETAILS_H #define FORMCATEGORYDETAILS_H -#include "ui_formstandardcategorydetails.h" +#include "ui_formcategorydetails.h" #include namespace Ui { - class FormStandardCategoryDetails; + class FormCategoryDetails; } class FeedsModelCategory; @@ -34,13 +34,13 @@ class FeedsModelRootItem; class QMenu; class QAction; -class FormStandardCategoryDetails : public QDialog { +class FormCategoryDetails : public QDialog { Q_OBJECT public: // Constructors and destructors. - explicit FormStandardCategoryDetails(FeedsModel *model, QWidget *parent = 0); - virtual ~FormStandardCategoryDetails(); + explicit FormCategoryDetails(FeedsModel *model, QWidget *parent = 0); + virtual ~FormCategoryDetails(); public slots: // Executes add/edit standard category dialog. @@ -77,7 +77,7 @@ class FormStandardCategoryDetails : public QDialog { FeedsModelCategory *input_category); private: - Ui::FormStandardCategoryDetails *m_ui; + Ui::FormCategoryDetails *m_ui; FeedsModelCategory *m_editableCategory; FeedsModel *m_feedsModel; diff --git a/src/gui/formstandardcategorydetails.ui b/src/gui/formcategorydetails.ui similarity index 96% rename from src/gui/formstandardcategorydetails.ui rename to src/gui/formcategorydetails.ui index 67bbed086..7c2fd546c 100644 --- a/src/gui/formstandardcategorydetails.ui +++ b/src/gui/formcategorydetails.ui @@ -1,7 +1,7 @@ - FormStandardCategoryDetails - + FormCategoryDetails + 0 @@ -153,7 +153,7 @@ m_buttonBox rejected() - FormStandardCategoryDetails + FormCategoryDetails reject() diff --git a/src/gui/formstandardfeeddetails.cpp b/src/gui/formfeeddetails.cpp similarity index 90% rename from src/gui/formstandardfeeddetails.cpp rename to src/gui/formfeeddetails.cpp index df63a198b..c2dc5c05b 100644 --- a/src/gui/formstandardfeeddetails.cpp +++ b/src/gui/formfeeddetails.cpp @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with RSS Guard. If not, see . -#include "gui/formstandardfeeddetails.h" +#include "gui/formfeeddetails.h" #include "definitions/definitions.h" #include "core/feedsmodel.h" @@ -37,7 +37,7 @@ #include -FormStandardFeedDetails::FormStandardFeedDetails(FeedsModel *model, QWidget *parent) +FormFeedDetails::FormFeedDetails(FeedsModel *model, QWidget *parent) : QDialog(parent), m_editableFeed(NULL), m_feedsModel(model) { @@ -52,18 +52,18 @@ FormStandardFeedDetails::FormStandardFeedDetails(FeedsModel *model, QWidget *par onPasswordChanged(QString()); } -FormStandardFeedDetails::~FormStandardFeedDetails() { +FormFeedDetails::~FormFeedDetails() { delete m_ui; } -int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) { +int FormFeedDetails::exec(FeedsModelFeed *input_feed) { // Load categories. loadCategories(m_feedsModel->allCategories().values(), m_feedsModel->rootItem()); if (input_feed == NULL) { // User is adding new category. - setWindowTitle(tr("Add new standard feed")); + setWindowTitle(tr("Add new feed")); // Make sure that "default" icon is used as the default option for new // feed. @@ -77,7 +77,7 @@ int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) { } else { // User is editing existing category. - setWindowTitle(tr("Edit existing standard feed")); + setWindowTitle(tr("Edit existing feed")); setEditableFeed(input_feed); } @@ -85,7 +85,7 @@ int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) { return QDialog::exec(); } -void FormStandardFeedDetails::onTitleChanged(const QString &new_title){ +void FormFeedDetails::onTitleChanged(const QString &new_title){ if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) { m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Feed name is ok.")); } @@ -96,7 +96,7 @@ void FormStandardFeedDetails::onTitleChanged(const QString &new_title){ checkOkButtonEnabled(); } -void FormStandardFeedDetails::onDescriptionChanged(const QString &new_description) { +void FormFeedDetails::onDescriptionChanged(const QString &new_description) { if (new_description.simplified().isEmpty()) { m_ui->m_txtDescription->setStatus(LineEditWithStatus::Warning, tr("Description is empty.")); } @@ -105,7 +105,7 @@ void FormStandardFeedDetails::onDescriptionChanged(const QString &new_descriptio } } -void FormStandardFeedDetails::onUrlChanged(const QString &new_url) { +void FormFeedDetails::onUrlChanged(const QString &new_url) { if (QRegExp(URL_REGEXP).exactMatch(new_url)) { // New url is well-formed. m_ui->m_txtUrl->setStatus(LineEditWithStatus::Ok, tr("The url is ok.")); @@ -122,7 +122,7 @@ void FormStandardFeedDetails::onUrlChanged(const QString &new_url) { checkOkButtonEnabled(); } -void FormStandardFeedDetails::onUsernameChanged(const QString &new_username) { +void FormFeedDetails::onUsernameChanged(const QString &new_username) { bool is_username_ok = !m_ui->m_gbAuthentication->isChecked() || !new_username.simplified().isEmpty(); m_ui->m_txtUsername->setStatus(is_username_ok ? @@ -133,7 +133,7 @@ void FormStandardFeedDetails::onUsernameChanged(const QString &new_username) { tr("Username is empty.")); } -void FormStandardFeedDetails::onPasswordChanged(const QString &new_password) { +void FormFeedDetails::onPasswordChanged(const QString &new_password) { bool is_password_ok = !m_ui->m_gbAuthentication->isChecked() || !new_password.simplified().isEmpty(); m_ui->m_txtPassword->setStatus(is_password_ok ? @@ -144,12 +144,12 @@ void FormStandardFeedDetails::onPasswordChanged(const QString &new_password) { tr("Password is empty.")); } -void FormStandardFeedDetails::onAuthenticationSwitched() { +void FormFeedDetails::onAuthenticationSwitched() { onUsernameChanged(m_ui->m_txtUsername->lineEdit()->text()); onPasswordChanged(m_ui->m_txtPassword->lineEdit()->text()); } -void FormStandardFeedDetails::onAutoUpdateTypeChanged(int new_index) { +void FormFeedDetails::onAutoUpdateTypeChanged(int new_index) { FeedsModelFeed::AutoUpdateType auto_update_type = static_cast(m_ui->m_cmbAutoUpdateType->itemData(new_index).toInt()); switch (auto_update_type) { @@ -164,7 +164,7 @@ void FormStandardFeedDetails::onAutoUpdateTypeChanged(int new_index) { } } -void FormStandardFeedDetails::checkOkButtonEnabled() { +void FormFeedDetails::checkOkButtonEnabled() { LineEditWithStatus::StatusType title_status = m_ui->m_txtTitle->status(); LineEditWithStatus::StatusType url_status = m_ui->m_txtUrl->status(); @@ -173,11 +173,11 @@ void FormStandardFeedDetails::checkOkButtonEnabled() { url_status == LineEditWithStatus::Warning)); } -void FormStandardFeedDetails::onNoIconSelected() { +void FormFeedDetails::onNoIconSelected() { m_ui->m_btnIcon->setIcon(QIcon()); } -void FormStandardFeedDetails::onLoadIconFromFile() { +void FormFeedDetails::onLoadIconFromFile() { QFileDialog dialog(this, tr("Select icon file for the feed"), QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)")); dialog.setFileMode(QFileDialog::ExistingFile); @@ -196,11 +196,11 @@ void FormStandardFeedDetails::onLoadIconFromFile() { } } -void FormStandardFeedDetails::onUseDefaultIcon() { +void FormFeedDetails::onUseDefaultIcon() { m_ui->m_btnIcon->setIcon(IconFactory::instance()->fromTheme("folder-feed")); } -void FormStandardFeedDetails::apply() { +void FormFeedDetails::apply() { FeedsModelRootItem *parent = static_cast(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value()); FeedsModelFeed::Type type = static_cast(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value()); FeedsModelFeed *new_feed = new FeedsModelFeed(); @@ -260,7 +260,7 @@ void FormStandardFeedDetails::apply() { } } -void FormStandardFeedDetails::guessFeed() { +void FormFeedDetails::guessFeed() { QPair result = FeedsModelFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(), m_ui->m_txtUsername->lineEdit()->text(), m_ui->m_txtPassword->lineEdit()->text()); @@ -304,7 +304,7 @@ void FormStandardFeedDetails::guessFeed() { } } -void FormStandardFeedDetails::createConnections() { +void FormFeedDetails::createConnections() { // General connections. connect(m_ui->m_buttonBox, SIGNAL(accepted()), this, SLOT(apply())); @@ -331,7 +331,7 @@ void FormStandardFeedDetails::createConnections() { connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon())); } -void FormStandardFeedDetails::setEditableFeed(FeedsModelFeed *editable_feed) { +void FormFeedDetails::setEditableFeed(FeedsModelFeed *editable_feed) { m_editableFeed = editable_feed; m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_feed->parent()))); @@ -348,8 +348,8 @@ void FormStandardFeedDetails::setEditableFeed(FeedsModelFeed *editable_feed) { m_ui->m_spinAutoUpdateInterval->setValue(editable_feed->autoUpdateInitialInterval()); } -void FormStandardFeedDetails::initialize() { - m_ui = new Ui::FormStandardFeedDetails(); +void FormFeedDetails::initialize() { + m_ui = new Ui::FormFeedDetails(); m_ui->setupUi(this); // Set flags and attributes. @@ -446,7 +446,7 @@ void FormStandardFeedDetails::initialize() { m_ui->m_txtUrl->lineEdit()->setFocus(Qt::TabFocusReason); } -void FormStandardFeedDetails::loadCategories(const QList categories, +void FormFeedDetails::loadCategories(const QList categories, FeedsModelRootItem *root_item) { m_ui->m_cmbParentCategory->addItem(root_item->icon(), root_item->title(), diff --git a/src/gui/formstandardfeeddetails.h b/src/gui/formfeeddetails.h similarity index 87% rename from src/gui/formstandardfeeddetails.h rename to src/gui/formfeeddetails.h index 5774168ef..29ee71aab 100644 --- a/src/gui/formstandardfeeddetails.h +++ b/src/gui/formfeeddetails.h @@ -20,11 +20,11 @@ #include -#include "ui_formstandardfeeddetails.h" +#include "ui_formfeeddetails.h" namespace Ui { - class FormStandardFeedDetails; + class FormFeedDetails; } class FeedsModel; @@ -32,13 +32,13 @@ class FeedsModelFeed; class FeedsModelCategory; class FeedsModelRootItem; -class FormStandardFeedDetails : public QDialog { +class FormFeedDetails : public QDialog { Q_OBJECT public: // Constructors and destructors. - explicit FormStandardFeedDetails(FeedsModel *model, QWidget *parent = 0); - virtual ~FormStandardFeedDetails(); + explicit FormFeedDetails(FeedsModel *model, QWidget *parent = 0); + virtual ~FormFeedDetails(); public slots: // Executes add/edit standard feed dialog. @@ -81,7 +81,7 @@ class FormStandardFeedDetails : public QDialog { FeedsModelRootItem *root_item); private: - Ui::FormStandardFeedDetails *m_ui; + Ui::FormFeedDetails *m_ui; FeedsModelFeed *m_editableFeed; FeedsModel *m_feedsModel; diff --git a/src/gui/formstandardfeeddetails.ui b/src/gui/formfeeddetails.ui similarity index 95% rename from src/gui/formstandardfeeddetails.ui rename to src/gui/formfeeddetails.ui index 980103b88..4a8906631 100644 --- a/src/gui/formstandardfeeddetails.ui +++ b/src/gui/formfeeddetails.ui @@ -1,7 +1,7 @@ - FormStandardFeedDetails - + FormFeedDetails + 0 @@ -310,7 +310,7 @@ m_buttonBox rejected() - FormStandardFeedDetails + FormFeedDetails reject() diff --git a/src/gui/formsettings.ui b/src/gui/formsettings.ui index e98080d45..83b59933e 100644 --- a/src/gui/formsettings.ui +++ b/src/gui/formsettings.ui @@ -332,7 +332,7 @@ Authors of this application are NOT responsible for lost data. QTabWidget::North - 3 + 0 @@ -1286,18 +1286,18 @@ Authors of this application are NOT responsible for lost data. - - LabelWithStatus - QWidget -
labelwithstatus.h
- 1 -
LineEditWithStatus QWidget
lineeditwithstatus.h
1
+ + LabelWithStatus + QWidget +
labelwithstatus.h
+ 1 +
DynamicShortcutsWidget QWidget diff --git a/src/gui/messagessearchlineedit.cpp b/src/gui/messagessearchlineedit.cpp index 80e4ba95b..78e97b80c 100644 --- a/src/gui/messagessearchlineedit.cpp +++ b/src/gui/messagessearchlineedit.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #include "gui/messagessearchlineedit.h" diff --git a/src/gui/messagessearchlineedit.h b/src/gui/messagessearchlineedit.h index 033ff33c5..6dbbcb976 100644 --- a/src/gui/messagessearchlineedit.h +++ b/src/gui/messagessearchlineedit.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #ifndef MESSAGESEARCHLINEEDIT_H #define MESSAGESEARCHLINEEDIT_H diff --git a/src/gui/messagestoolbar.cpp b/src/gui/messagestoolbar.cpp index f7c7d67c7..0f01ea8ed 100644 --- a/src/gui/messagestoolbar.cpp +++ b/src/gui/messagestoolbar.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #include "gui/messagestoolbar.h" #include "definitions/definitions.h" @@ -13,47 +30,9 @@ MessagesToolBar::MessagesToolBar(const QString &title, QWidget *parent) - : BaseToolBar(title, parent), - m_txtSearchMessages(new MessagesSearchLineEdit(this)) { - - m_txtSearchMessages->setFixedWidth(FILTER_WIDTH); - m_txtSearchMessages->setPlaceholderText(tr("Search messages")); - - // Setup wrapping action for search box. - m_actionSearchMessages = new QWidgetAction(this); - m_actionSearchMessages->setDefaultWidget(m_txtSearchMessages); - m_actionSearchMessages->setIcon(IconFactory::instance()->fromTheme("view-spacer")); - m_actionSearchMessages->setProperty("type", SEACRH_MESSAGES_ACTION_NAME); - m_actionSearchMessages->setProperty("name", tr("Message search box")); - - m_menuFilterMessages = new QMenu(tr("Menu for highlighting messages"), this); - m_menuFilterMessages->addAction(IconFactory::instance()->fromTheme("mail-mark-read"), - tr("No extra highlighting"))->setData(QVariant::fromValue(MessagesModel::DisplayAll)); - m_menuFilterMessages->addAction(IconFactory::instance()->fromTheme("mail-mark-unread"), - tr("Highlight unread messages"))->setData(QVariant::fromValue(MessagesModel::DisplayUnread)); - m_menuFilterMessages->addAction(IconFactory::instance()->fromTheme("mail-mark-favorite"), - tr("Highlight important messages"))->setData(QVariant::fromValue(MessagesModel::DisplayImportant)); - - m_btnFilterMessages = new QToolButton(this); - m_btnFilterMessages->setToolTip(tr("Display all messages")); - m_btnFilterMessages->setMenu(m_menuFilterMessages); - m_btnFilterMessages->setPopupMode(QToolButton::MenuButtonPopup); - m_btnFilterMessages->setIcon(IconFactory::instance()->fromTheme("mail-mark-read")); - - m_actionFilterMessages = new QWidgetAction(this); - m_actionFilterMessages->setDefaultWidget(m_btnFilterMessages); - m_actionFilterMessages->setProperty("type", FILTER_ACTION_NAME); - m_actionFilterMessages->setProperty("name", tr("Message highlighter")); - - // Update right margin of filter textbox. - QMargins margins = contentsMargins(); - margins.setRight(margins.right() + FILTER_RIGHT_MARGIN); - setContentsMargins(margins); - - connect(m_txtSearchMessages, SIGNAL(textChanged(QString)), - this, SIGNAL(messageSearchPatternChanged(QString))); - connect(m_menuFilterMessages, SIGNAL(triggered(QAction*)), - this, SLOT(handleMessageFilterChange(QAction*))); + : BaseToolBar(title, parent) { + initializeSearchBox(); + initializeHighlighter(); } MessagesToolBar::~MessagesToolBar() { @@ -62,7 +41,7 @@ MessagesToolBar::~MessagesToolBar() { QHash MessagesToolBar::availableActions() const { QHash available_actions = FormMain::instance()->allActions(); available_actions.insert(SEACRH_MESSAGES_ACTION_NAME, m_actionSearchMessages); - available_actions.insert(FILTER_ACTION_NAME, m_actionFilterMessages); + available_actions.insert(HIGHLIGHTER_ACTION_NAME, m_actionMessageHighlighter); return available_actions; } @@ -99,9 +78,9 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) { // Add search box. addAction(m_actionSearchMessages); } - else if (action_name == FILTER_ACTION_NAME) { + else if (action_name == HIGHLIGHTER_ACTION_NAME) { // Add filter button. - addAction(m_actionFilterMessages); + addAction(m_actionMessageHighlighter); } else if (action_name == SPACER_ACTION_NAME) { // Add new spacer. @@ -109,25 +88,65 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) { spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); QAction *action = addWidget(spacer); - action->setIcon(IconFactory::instance()->fromTheme("application-search")); + action->setIcon(IconFactory::instance()->fromTheme("view-spacer")); action->setProperty("type", SPACER_ACTION_NAME); action->setProperty("name", tr("Toolbar spacer")); } } } -void MessagesToolBar::handleMessageFilterChange(QAction *action) { - m_btnFilterMessages->setIcon(action->icon()); - m_btnFilterMessages->setToolTip(action->text()); +void MessagesToolBar::handleMessageHighlighterChange(QAction *action) { + m_btnMessageHighlighter->setIcon(action->icon()); + m_btnMessageHighlighter->setToolTip(action->text()); emit messageFilterChanged(action->data().value()); } +void MessagesToolBar::initializeSearchBox() { + m_txtSearchMessages = new MessagesSearchLineEdit(this); + m_txtSearchMessages->setFixedWidth(FILTER_WIDTH); + m_txtSearchMessages->setPlaceholderText(tr("Search messages")); + + // Setup wrapping action for search box. + m_actionSearchMessages = new QWidgetAction(this); + m_actionSearchMessages->setDefaultWidget(m_txtSearchMessages); + m_actionSearchMessages->setIcon(IconFactory::instance()->fromTheme("application-search")); + m_actionSearchMessages->setProperty("type", SEACRH_MESSAGES_ACTION_NAME); + m_actionSearchMessages->setProperty("name", tr("Message search box")); + + connect(m_txtSearchMessages, SIGNAL(textChanged(QString)), + this, SIGNAL(messageSearchPatternChanged(QString))); +} + +void MessagesToolBar::initializeHighlighter() { + m_menuMessageHighlighter = new QMenu(tr("Menu for highlighting messages"), this); + m_menuMessageHighlighter->addAction(IconFactory::instance()->fromTheme("mail-mark-read"), + tr("No extra highlighting"))->setData(QVariant::fromValue(MessagesModel::DisplayAll)); + m_menuMessageHighlighter->addAction(IconFactory::instance()->fromTheme("mail-mark-unread"), + tr("Highlight unread messages"))->setData(QVariant::fromValue(MessagesModel::DisplayUnread)); + m_menuMessageHighlighter->addAction(IconFactory::instance()->fromTheme("mail-mark-favorite"), + tr("Highlight important messages"))->setData(QVariant::fromValue(MessagesModel::DisplayImportant)); + + m_btnMessageHighlighter = new QToolButton(this); + m_btnMessageHighlighter->setToolTip(tr("Display all messages")); + m_btnMessageHighlighter->setMenu(m_menuMessageHighlighter); + m_btnMessageHighlighter->setPopupMode(QToolButton::MenuButtonPopup); + m_btnMessageHighlighter->setIcon(IconFactory::instance()->fromTheme("mail-mark-read")); + + m_actionMessageHighlighter = new QWidgetAction(this); + m_actionMessageHighlighter->setDefaultWidget(m_btnMessageHighlighter); + m_actionMessageHighlighter->setProperty("type", HIGHLIGHTER_ACTION_NAME); + m_actionMessageHighlighter->setProperty("name", tr("Message highlighter")); + + connect(m_menuMessageHighlighter, SIGNAL(triggered(QAction*)), + this, SLOT(handleMessageHighlighterChange(QAction*))); +} + void MessagesToolBar::loadChangeableActions() { QStringList action_names = Settings::instance()->value(APP_CFG_GUI, "messages_toolbar", - "m_actionMarkSelectedMessagesAsRead,m_actionMarkSelectedMessagesAsUnread,m_actionSwitchImportanceOfSelectedMessages,spacer,search").toString().split(',', - QString::SkipEmptyParts); + "m_actionMarkSelectedMessagesAsRead,m_actionMarkSelectedMessagesAsUnread,m_actionSwitchImportanceOfSelectedMessages,separator,highlighter,spacer,search").toString().split(',', + QString::SkipEmptyParts); loadChangeableActions(action_names); } diff --git a/src/gui/messagestoolbar.h b/src/gui/messagestoolbar.h index 51f130fae..e7d46c3b2 100644 --- a/src/gui/messagestoolbar.h +++ b/src/gui/messagestoolbar.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #ifndef NEWSTOOLBAR_H #define NEWSTOOLBAR_H @@ -44,12 +61,17 @@ class MessagesToolBar : public BaseToolBar { void messageFilterChanged(MessagesModel::DisplayFilter filter); private slots: - void handleMessageFilterChange(QAction *action); + // Called when highlighter gets changed. + void handleMessageHighlighterChange(QAction *action); private: - QWidgetAction *m_actionFilterMessages; - QToolButton *m_btnFilterMessages; - QMenu *m_menuFilterMessages; + void initializeSearchBox(); + void initializeHighlighter(); + + private: + QWidgetAction *m_actionMessageHighlighter; + QToolButton *m_btnMessageHighlighter; + QMenu *m_menuMessageHighlighter; QWidgetAction *m_actionSearchMessages; MessagesSearchLineEdit *m_txtSearchMessages; diff --git a/src/gui/toolbareditor.cpp b/src/gui/toolbareditor.cpp index c5ac2e9c8..b506099e2 100644 --- a/src/gui/toolbareditor.cpp +++ b/src/gui/toolbareditor.cpp @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #include "gui/toolbareditor.h" #include "gui/basetoolbar.h" @@ -86,7 +103,7 @@ void ToolBarEditor::insertSpacer() { int current_row = m_ui->m_listActivatedActions->currentRow(); QListWidgetItem *item = new QListWidgetItem(tr("Toolbar spacer")); - item->setIcon(IconFactory::instance()->fromTheme("application-search")); + item->setIcon(IconFactory::instance()->fromTheme("view-spacer")); item->setData(Qt::UserRole, SPACER_ACTION_NAME); if (current_row >= 0) { diff --git a/src/gui/toolbareditor.h b/src/gui/toolbareditor.h index 0aba34e7c..ed2a55441 100644 --- a/src/gui/toolbareditor.h +++ b/src/gui/toolbareditor.h @@ -1,3 +1,20 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2014 by Martin Rotter +// +// RSS Guard is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// RSS Guard is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with RSS Guard. If not, see . + #ifndef TOOLBAREDITOR_H #define TOOLBAREDITOR_H diff --git a/src/gui/toolbareditor.ui b/src/gui/toolbareditor.ui index 83a2b52f7..37b2eaaa1 100644 --- a/src/gui/toolbareditor.ui +++ b/src/gui/toolbareditor.ui @@ -72,12 +72,18 @@ QAbstractItemView::ScrollPerPixel + + false + QListView::Adjust true + + false +
@@ -143,12 +149,18 @@ QAbstractItemView::ScrollPerPixel + + false + QListView::Adjust true + + false +
diff --git a/src/network-web/webbrowser.cpp b/src/network-web/webbrowser.cpp index b46357ac0..0f4cfbc21 100644 --- a/src/network-web/webbrowser.cpp +++ b/src/network-web/webbrowser.cpp @@ -149,6 +149,7 @@ void WebBrowser::initializeLayout() { } void WebBrowser::onLoadingStarted() { + // TODO: Do not display this when navigating to "about:blank". m_loadingProgress->setValue(0); m_loadingProgress->show(); } @@ -156,7 +157,7 @@ void WebBrowser::onLoadingStarted() { void WebBrowser::onLoadingProgress(int progress) { m_loadingProgress->setValue(progress); - m_lblProgress->setText(tr(" %1 kB / %2 kB"). + m_lblProgress->setText(QString(" %1 kB / %2 kB"). arg(m_webView->page()->bytesReceived() / 1000). arg(m_webView->page()->totalBytes() / 1000)); }