Added license headers + some toolbar fixups and renaming.

This commit is contained in:
Martin Rotter 2014-04-10 08:15:14 +02:00
parent 5b6966b533
commit a876726177
23 changed files with 331 additions and 135 deletions

View File

@ -283,8 +283,8 @@ set(APP_SOURCES
src/gui/feedsview.cpp src/gui/feedsview.cpp
src/gui/messagesview.cpp src/gui/messagesview.cpp
src/gui/statusbar.cpp src/gui/statusbar.cpp
src/gui/formstandardcategorydetails.cpp src/gui/formcategorydetails.cpp
src/gui/formstandardfeeddetails.cpp src/gui/formfeeddetails.cpp
src/gui/plaintoolbutton.cpp src/gui/plaintoolbutton.cpp
src/gui/lineeditwithstatus.cpp src/gui/lineeditwithstatus.cpp
src/gui/widgetwithstatus.cpp src/gui/widgetwithstatus.cpp
@ -362,8 +362,8 @@ set(APP_HEADERS
src/gui/feedsview.h src/gui/feedsview.h
src/gui/messagesview.h src/gui/messagesview.h
src/gui/statusbar.h src/gui/statusbar.h
src/gui/formstandardcategorydetails.h src/gui/formcategorydetails.h
src/gui/formstandardfeeddetails.h src/gui/formfeeddetails.h
src/gui/plaintoolbutton.h src/gui/plaintoolbutton.h
src/gui/lineeditwithstatus.h src/gui/lineeditwithstatus.h
src/gui/widgetwithstatus.h src/gui/widgetwithstatus.h
@ -416,8 +416,8 @@ set(APP_FORMS
src/gui/formmain.ui src/gui/formmain.ui
src/gui/formsettings.ui src/gui/formsettings.ui
src/gui/formabout.ui src/gui/formabout.ui
src/gui/formstandardcategorydetails.ui src/gui/formcategorydetails.ui
src/gui/formstandardfeeddetails.ui src/gui/formfeeddetails.ui
src/gui/toolbareditor.ui src/gui/toolbareditor.ui
) )

View File

@ -9,6 +9,8 @@ Fixed:
Added: Added:
<ul> <ul>
<li>Added option to adjust icons/buttons displayed in toolbars. See Settings/User interface/Toolbars dialog for more information.</li> <li>Added option to adjust icons/buttons displayed in toolbars. See Settings/User interface/Toolbars dialog for more information.</li>
<li>Added option to search messages via regular expression.</li>
<li>Added option to highlight particular messages - unread, important, none.</li>
</ul> </ul>
Changed: Changed:

View File

@ -65,7 +65,7 @@
#define TIMEZONE_OFFSET_LIMIT 6 #define TIMEZONE_OFFSET_LIMIT 6
#define CHANGE_EVENT_DELAY 250 #define CHANGE_EVENT_DELAY 250
#define SEACRH_MESSAGES_ACTION_NAME "search" #define SEACRH_MESSAGES_ACTION_NAME "search"
#define FILTER_ACTION_NAME "filter" #define HIGHLIGHTER_ACTION_NAME "highlighter"
#define SPACER_ACTION_NAME "spacer" #define SPACER_ACTION_NAME "spacer"
#define SEPARATOR_ACTION_NAME "separator" #define SEPARATOR_ACTION_NAME "separator"
#define FILTER_WIDTH 150 #define FILTER_WIDTH 150

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#include "gui/basetoolbar.h" #include "gui/basetoolbar.h"
#include "definitions/definitions.h" #include "definitions/definitions.h"
@ -9,6 +26,10 @@
BaseToolBar::BaseToolBar(const QString &title, QWidget *parent) BaseToolBar::BaseToolBar(const QString &title, QWidget *parent)
: QToolBar(title, parent) { : QToolBar(title, parent) {
// Update right margin of filter textbox.
QMargins margins = contentsMargins();
margins.setRight(margins.right() + FILTER_RIGHT_MARGIN);
setContentsMargins(margins);
} }
BaseToolBar::~BaseToolBar() { BaseToolBar::~BaseToolBar() {

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#ifndef TOOLBAR_H #ifndef TOOLBAR_H
#define TOOLBAR_H #define TOOLBAR_H

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#include "gui/feedstoolbar.h" #include "gui/feedstoolbar.h"
#include "gui/formmain.h" #include "gui/formmain.h"

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#ifndef FEEDSTOOLBAR_H #ifndef FEEDSTOOLBAR_H
#define FEEDSTOOLBAR_H #define FEEDSTOOLBAR_H

View File

@ -26,8 +26,8 @@
#include "core/feedsmodelfeed.h" #include "core/feedsmodelfeed.h"
#include "miscellaneous/systemfactory.h" #include "miscellaneous/systemfactory.h"
#include "gui/formmain.h" #include "gui/formmain.h"
#include "gui/formstandardcategorydetails.h" #include "gui/formcategorydetails.h"
#include "gui/formstandardfeeddetails.h" #include "gui/formfeeddetails.h"
#include "gui/systemtrayicon.h" #include "gui/systemtrayicon.h"
#include "gui/messagebox.h" #include "gui/messagebox.h"
@ -270,7 +270,7 @@ void FeedsView::addNewCategory() {
return; return;
} }
QPointer<FormStandardCategoryDetails> form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
form_pointer.data()->exec(NULL); form_pointer.data()->exec(NULL);
@ -281,7 +281,7 @@ void FeedsView::addNewCategory() {
} }
void FeedsView::editCategory(FeedsModelCategory *category) { void FeedsView::editCategory(FeedsModelCategory *category) {
QPointer<FormStandardCategoryDetails> form_pointer = new FormStandardCategoryDetails(m_sourceModel, this); QPointer<FormCategoryDetails> form_pointer = new FormCategoryDetails(m_sourceModel, this);
form_pointer.data()->exec(category); form_pointer.data()->exec(category);
@ -309,7 +309,7 @@ void FeedsView::addNewFeed() {
return; return;
} }
QPointer<FormStandardFeedDetails> form_pointer = new FormStandardFeedDetails(m_sourceModel, this); QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
form_pointer.data()->exec(NULL); form_pointer.data()->exec(NULL);
@ -320,7 +320,7 @@ void FeedsView::addNewFeed() {
} }
void FeedsView::editFeed(FeedsModelFeed *feed) { void FeedsView::editFeed(FeedsModelFeed *feed) {
QPointer<FormStandardFeedDetails> form_pointer = new FormStandardFeedDetails(m_sourceModel, this); QPointer<FormFeedDetails> form_pointer = new FormFeedDetails(m_sourceModel, this);
form_pointer.data()->exec(feed); form_pointer.data()->exec(feed);

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>. // along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "gui/formstandardcategorydetails.h" #include "gui/formcategorydetails.h"
#include "definitions/definitions.h" #include "definitions/definitions.h"
#include "core/feedsmodelrootitem.h" #include "core/feedsmodelrootitem.h"
@ -37,7 +37,7 @@
#include <QFileDialog> #include <QFileDialog>
FormStandardCategoryDetails::FormStandardCategoryDetails(FeedsModel *model, FormCategoryDetails::FormCategoryDetails(FeedsModel *model,
QWidget *parent) QWidget *parent)
: QDialog(parent), : QDialog(parent),
m_editableCategory(NULL), m_editableCategory(NULL),
@ -50,11 +50,11 @@ FormStandardCategoryDetails::FormStandardCategoryDetails(FeedsModel *model,
onDescriptionChanged(QString()); onDescriptionChanged(QString());
} }
FormStandardCategoryDetails::~FormStandardCategoryDetails() { FormCategoryDetails::~FormCategoryDetails() {
qDebug("Destroying FormCategoryDetails instance."); qDebug("Destroying FormCategoryDetails instance.");
} }
void FormStandardCategoryDetails::createConnections() { void FormCategoryDetails::createConnections() {
// General connections. // General connections.
connect(m_ui->m_buttonBox, SIGNAL(accepted()), connect(m_ui->m_buttonBox, SIGNAL(accepted()),
this, SLOT(apply())); this, SLOT(apply()));
@ -69,7 +69,7 @@ void FormStandardCategoryDetails::createConnections() {
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon())); 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_editableCategory = editable_category;
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_category->parent()))); 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()); m_ui->m_btnIcon->setIcon(editable_category->icon());
} }
int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) { int FormCategoryDetails::exec(FeedsModelCategory *input_category) {
// Load categories. // Load categories.
loadCategories(m_feedsModel->allCategories().values(), loadCategories(m_feedsModel->allCategories().values(),
m_feedsModel->rootItem(), m_feedsModel->rootItem(),
@ -86,7 +86,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) {
if (input_category == NULL) { if (input_category == NULL) {
// User is adding new category. // 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 // Make sure that "default" icon is used as the default option for new
// categories. // categories.
@ -94,7 +94,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) {
} }
else { else {
// User is editing existing category. // User is editing existing category.
setWindowTitle(tr("Edit existing standard category")); setWindowTitle(tr("Edit existing category"));
setEditableCategory(input_category); setEditableCategory(input_category);
} }
@ -102,7 +102,7 @@ int FormStandardCategoryDetails::exec(FeedsModelCategory *input_category) {
return QDialog::exec(); return QDialog::exec();
} }
void FormStandardCategoryDetails::apply() { void FormCategoryDetails::apply() {
FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>()); FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
FeedsModelCategory *new_category = new FeedsModelCategory(); 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) { if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) {
m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); m_ui->m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Category name is ok.")); 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()) { if (new_description.simplified().isEmpty()) {
m_ui->m_txtDescription->setStatus(LineEditWithStatus::Warning, tr("Description is empty.")); 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()); m_ui->m_btnIcon->setIcon(QIcon());
} }
void FormStandardCategoryDetails::onLoadIconFromFile() { void FormCategoryDetails::onLoadIconFromFile() {
QFileDialog dialog(this, tr("Select icon file for the category"), QFileDialog dialog(this, tr("Select icon file for the category"),
QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)")); QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
dialog.setFileMode(QFileDialog::ExistingFile); 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")); m_ui->m_btnIcon->setIcon(IconFactory::instance()->fromTheme("folder-category"));
} }
void FormStandardCategoryDetails::initialize() { void FormCategoryDetails::initialize() {
m_ui = new Ui::FormStandardCategoryDetails(); m_ui = new Ui::FormCategoryDetails();
m_ui->setupUi(this); m_ui->setupUi(this);
// Set text boxes. // Set text boxes.
@ -245,7 +245,7 @@ void FormStandardCategoryDetails::initialize() {
m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason); m_ui->m_txtTitle->lineEdit()->setFocus(Qt::TabFocusReason);
} }
void FormStandardCategoryDetails::loadCategories(const QList<FeedsModelCategory*> categories, void FormCategoryDetails::loadCategories(const QList<FeedsModelCategory*> categories,
FeedsModelRootItem *root_item, FeedsModelRootItem *root_item,
FeedsModelCategory *input_category) { FeedsModelCategory *input_category) {
m_ui->m_cmbParentCategory->addItem(root_item->icon(), m_ui->m_cmbParentCategory->addItem(root_item->icon(),

View File

@ -18,13 +18,13 @@
#ifndef FORMCATEGORYDETAILS_H #ifndef FORMCATEGORYDETAILS_H
#define FORMCATEGORYDETAILS_H #define FORMCATEGORYDETAILS_H
#include "ui_formstandardcategorydetails.h" #include "ui_formcategorydetails.h"
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class FormStandardCategoryDetails; class FormCategoryDetails;
} }
class FeedsModelCategory; class FeedsModelCategory;
@ -34,13 +34,13 @@ class FeedsModelRootItem;
class QMenu; class QMenu;
class QAction; class QAction;
class FormStandardCategoryDetails : public QDialog { class FormCategoryDetails : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
// Constructors and destructors. // Constructors and destructors.
explicit FormStandardCategoryDetails(FeedsModel *model, QWidget *parent = 0); explicit FormCategoryDetails(FeedsModel *model, QWidget *parent = 0);
virtual ~FormStandardCategoryDetails(); virtual ~FormCategoryDetails();
public slots: public slots:
// Executes add/edit standard category dialog. // Executes add/edit standard category dialog.
@ -77,7 +77,7 @@ class FormStandardCategoryDetails : public QDialog {
FeedsModelCategory *input_category); FeedsModelCategory *input_category);
private: private:
Ui::FormStandardCategoryDetails *m_ui; Ui::FormCategoryDetails *m_ui;
FeedsModelCategory *m_editableCategory; FeedsModelCategory *m_editableCategory;
FeedsModel *m_feedsModel; FeedsModel *m_feedsModel;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>FormStandardCategoryDetails</class> <class>FormCategoryDetails</class>
<widget class="QDialog" name="FormStandardCategoryDetails"> <widget class="QDialog" name="FormCategoryDetails">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -153,7 +153,7 @@
<connection> <connection>
<sender>m_buttonBox</sender> <sender>m_buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>FormStandardCategoryDetails</receiver> <receiver>FormCategoryDetails</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>. // along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "gui/formstandardfeeddetails.h" #include "gui/formfeeddetails.h"
#include "definitions/definitions.h" #include "definitions/definitions.h"
#include "core/feedsmodel.h" #include "core/feedsmodel.h"
@ -37,7 +37,7 @@
#include <QNetworkReply> #include <QNetworkReply>
FormStandardFeedDetails::FormStandardFeedDetails(FeedsModel *model, QWidget *parent) FormFeedDetails::FormFeedDetails(FeedsModel *model, QWidget *parent)
: QDialog(parent), : QDialog(parent),
m_editableFeed(NULL), m_editableFeed(NULL),
m_feedsModel(model) { m_feedsModel(model) {
@ -52,18 +52,18 @@ FormStandardFeedDetails::FormStandardFeedDetails(FeedsModel *model, QWidget *par
onPasswordChanged(QString()); onPasswordChanged(QString());
} }
FormStandardFeedDetails::~FormStandardFeedDetails() { FormFeedDetails::~FormFeedDetails() {
delete m_ui; delete m_ui;
} }
int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) { int FormFeedDetails::exec(FeedsModelFeed *input_feed) {
// Load categories. // Load categories.
loadCategories(m_feedsModel->allCategories().values(), loadCategories(m_feedsModel->allCategories().values(),
m_feedsModel->rootItem()); m_feedsModel->rootItem());
if (input_feed == NULL) { if (input_feed == NULL) {
// User is adding new category. // 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 // Make sure that "default" icon is used as the default option for new
// feed. // feed.
@ -77,7 +77,7 @@ int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) {
} }
else { else {
// User is editing existing category. // User is editing existing category.
setWindowTitle(tr("Edit existing standard feed")); setWindowTitle(tr("Edit existing feed"));
setEditableFeed(input_feed); setEditableFeed(input_feed);
} }
@ -85,7 +85,7 @@ int FormStandardFeedDetails::exec(FeedsModelFeed *input_feed) {
return QDialog::exec(); 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) { if (new_title.simplified().size() >= MIN_CATEGORY_NAME_LENGTH) {
m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Feed name is ok.")); m_ui->m_txtTitle->setStatus(LineEditWithStatus::Ok, tr("Feed name is ok."));
} }
@ -96,7 +96,7 @@ void FormStandardFeedDetails::onTitleChanged(const QString &new_title){
checkOkButtonEnabled(); checkOkButtonEnabled();
} }
void FormStandardFeedDetails::onDescriptionChanged(const QString &new_description) { void FormFeedDetails::onDescriptionChanged(const QString &new_description) {
if (new_description.simplified().isEmpty()) { if (new_description.simplified().isEmpty()) {
m_ui->m_txtDescription->setStatus(LineEditWithStatus::Warning, tr("Description is empty.")); 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)) { if (QRegExp(URL_REGEXP).exactMatch(new_url)) {
// New url is well-formed. // New url is well-formed.
m_ui->m_txtUrl->setStatus(LineEditWithStatus::Ok, tr("The url is ok.")); m_ui->m_txtUrl->setStatus(LineEditWithStatus::Ok, tr("The url is ok."));
@ -122,7 +122,7 @@ void FormStandardFeedDetails::onUrlChanged(const QString &new_url) {
checkOkButtonEnabled(); 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(); bool is_username_ok = !m_ui->m_gbAuthentication->isChecked() || !new_username.simplified().isEmpty();
m_ui->m_txtUsername->setStatus(is_username_ok ? m_ui->m_txtUsername->setStatus(is_username_ok ?
@ -133,7 +133,7 @@ void FormStandardFeedDetails::onUsernameChanged(const QString &new_username) {
tr("Username is empty.")); 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(); bool is_password_ok = !m_ui->m_gbAuthentication->isChecked() || !new_password.simplified().isEmpty();
m_ui->m_txtPassword->setStatus(is_password_ok ? m_ui->m_txtPassword->setStatus(is_password_ok ?
@ -144,12 +144,12 @@ void FormStandardFeedDetails::onPasswordChanged(const QString &new_password) {
tr("Password is empty.")); tr("Password is empty."));
} }
void FormStandardFeedDetails::onAuthenticationSwitched() { void FormFeedDetails::onAuthenticationSwitched() {
onUsernameChanged(m_ui->m_txtUsername->lineEdit()->text()); onUsernameChanged(m_ui->m_txtUsername->lineEdit()->text());
onPasswordChanged(m_ui->m_txtPassword->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<FeedsModelFeed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(new_index).toInt()); FeedsModelFeed::AutoUpdateType auto_update_type = static_cast<FeedsModelFeed::AutoUpdateType>(m_ui->m_cmbAutoUpdateType->itemData(new_index).toInt());
switch (auto_update_type) { 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 title_status = m_ui->m_txtTitle->status();
LineEditWithStatus::StatusType url_status = m_ui->m_txtUrl->status(); LineEditWithStatus::StatusType url_status = m_ui->m_txtUrl->status();
@ -173,11 +173,11 @@ void FormStandardFeedDetails::checkOkButtonEnabled() {
url_status == LineEditWithStatus::Warning)); url_status == LineEditWithStatus::Warning));
} }
void FormStandardFeedDetails::onNoIconSelected() { void FormFeedDetails::onNoIconSelected() {
m_ui->m_btnIcon->setIcon(QIcon()); m_ui->m_btnIcon->setIcon(QIcon());
} }
void FormStandardFeedDetails::onLoadIconFromFile() { void FormFeedDetails::onLoadIconFromFile() {
QFileDialog dialog(this, tr("Select icon file for the feed"), QFileDialog dialog(this, tr("Select icon file for the feed"),
QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)")); QDir::homePath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
dialog.setFileMode(QFileDialog::ExistingFile); 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")); m_ui->m_btnIcon->setIcon(IconFactory::instance()->fromTheme("folder-feed"));
} }
void FormStandardFeedDetails::apply() { void FormFeedDetails::apply() {
FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>()); FeedsModelRootItem *parent = static_cast<FeedsModelRootItem*>(m_ui->m_cmbParentCategory->itemData(m_ui->m_cmbParentCategory->currentIndex()).value<void*>());
FeedsModelFeed::Type type = static_cast<FeedsModelFeed::Type>(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value<int>()); FeedsModelFeed::Type type = static_cast<FeedsModelFeed::Type>(m_ui->m_cmbType->itemData(m_ui->m_cmbType->currentIndex()).value<int>());
FeedsModelFeed *new_feed = new FeedsModelFeed(); FeedsModelFeed *new_feed = new FeedsModelFeed();
@ -260,7 +260,7 @@ void FormStandardFeedDetails::apply() {
} }
} }
void FormStandardFeedDetails::guessFeed() { void FormFeedDetails::guessFeed() {
QPair<FeedsModelFeed*, QNetworkReply::NetworkError> result = FeedsModelFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(), QPair<FeedsModelFeed*, QNetworkReply::NetworkError> result = FeedsModelFeed::guessFeed(m_ui->m_txtUrl->lineEdit()->text(),
m_ui->m_txtUsername->lineEdit()->text(), m_ui->m_txtUsername->lineEdit()->text(),
m_ui->m_txtPassword->lineEdit()->text()); m_ui->m_txtPassword->lineEdit()->text());
@ -304,7 +304,7 @@ void FormStandardFeedDetails::guessFeed() {
} }
} }
void FormStandardFeedDetails::createConnections() { void FormFeedDetails::createConnections() {
// General connections. // General connections.
connect(m_ui->m_buttonBox, SIGNAL(accepted()), connect(m_ui->m_buttonBox, SIGNAL(accepted()),
this, SLOT(apply())); this, SLOT(apply()));
@ -331,7 +331,7 @@ void FormStandardFeedDetails::createConnections() {
connect(m_actionUseDefaultIcon, SIGNAL(triggered()), this, SLOT(onUseDefaultIcon())); 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_editableFeed = editable_feed;
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) editable_feed->parent()))); 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()); m_ui->m_spinAutoUpdateInterval->setValue(editable_feed->autoUpdateInitialInterval());
} }
void FormStandardFeedDetails::initialize() { void FormFeedDetails::initialize() {
m_ui = new Ui::FormStandardFeedDetails(); m_ui = new Ui::FormFeedDetails();
m_ui->setupUi(this); m_ui->setupUi(this);
// Set flags and attributes. // Set flags and attributes.
@ -446,7 +446,7 @@ void FormStandardFeedDetails::initialize() {
m_ui->m_txtUrl->lineEdit()->setFocus(Qt::TabFocusReason); m_ui->m_txtUrl->lineEdit()->setFocus(Qt::TabFocusReason);
} }
void FormStandardFeedDetails::loadCategories(const QList<FeedsModelCategory*> categories, void FormFeedDetails::loadCategories(const QList<FeedsModelCategory*> categories,
FeedsModelRootItem *root_item) { FeedsModelRootItem *root_item) {
m_ui->m_cmbParentCategory->addItem(root_item->icon(), m_ui->m_cmbParentCategory->addItem(root_item->icon(),
root_item->title(), root_item->title(),

View File

@ -20,11 +20,11 @@
#include <QDialog> #include <QDialog>
#include "ui_formstandardfeeddetails.h" #include "ui_formfeeddetails.h"
namespace Ui { namespace Ui {
class FormStandardFeedDetails; class FormFeedDetails;
} }
class FeedsModel; class FeedsModel;
@ -32,13 +32,13 @@ class FeedsModelFeed;
class FeedsModelCategory; class FeedsModelCategory;
class FeedsModelRootItem; class FeedsModelRootItem;
class FormStandardFeedDetails : public QDialog { class FormFeedDetails : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
// Constructors and destructors. // Constructors and destructors.
explicit FormStandardFeedDetails(FeedsModel *model, QWidget *parent = 0); explicit FormFeedDetails(FeedsModel *model, QWidget *parent = 0);
virtual ~FormStandardFeedDetails(); virtual ~FormFeedDetails();
public slots: public slots:
// Executes add/edit standard feed dialog. // Executes add/edit standard feed dialog.
@ -81,7 +81,7 @@ class FormStandardFeedDetails : public QDialog {
FeedsModelRootItem *root_item); FeedsModelRootItem *root_item);
private: private:
Ui::FormStandardFeedDetails *m_ui; Ui::FormFeedDetails *m_ui;
FeedsModelFeed *m_editableFeed; FeedsModelFeed *m_editableFeed;
FeedsModel *m_feedsModel; FeedsModel *m_feedsModel;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>FormStandardFeedDetails</class> <class>FormFeedDetails</class>
<widget class="QDialog" name="FormStandardFeedDetails"> <widget class="QDialog" name="FormFeedDetails">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -310,7 +310,7 @@
<connection> <connection>
<sender>m_buttonBox</sender> <sender>m_buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>FormStandardFeedDetails</receiver> <receiver>FormFeedDetails</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@ -332,7 +332,7 @@ Authors of this application are NOT responsible for lost data.</string>
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="m_tabIconSkin"> <widget class="QWidget" name="m_tabIconSkin">
<attribute name="title"> <attribute name="title">
@ -1286,18 +1286,18 @@ Authors of this application are NOT responsible for lost data.</string>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>LabelWithStatus</class>
<extends>QWidget</extends>
<header>labelwithstatus.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>LineEditWithStatus</class> <class>LineEditWithStatus</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>lineeditwithstatus.h</header> <header>lineeditwithstatus.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>LabelWithStatus</class>
<extends>QWidget</extends>
<header>labelwithstatus.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>DynamicShortcutsWidget</class> <class>DynamicShortcutsWidget</class>
<extends>QWidget</extends> <extends>QWidget</extends>

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#include "gui/messagessearchlineedit.h" #include "gui/messagessearchlineedit.h"

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#ifndef MESSAGESEARCHLINEEDIT_H #ifndef MESSAGESEARCHLINEEDIT_H
#define MESSAGESEARCHLINEEDIT_H #define MESSAGESEARCHLINEEDIT_H

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#include "gui/messagestoolbar.h" #include "gui/messagestoolbar.h"
#include "definitions/definitions.h" #include "definitions/definitions.h"
@ -13,47 +30,9 @@
MessagesToolBar::MessagesToolBar(const QString &title, QWidget *parent) MessagesToolBar::MessagesToolBar(const QString &title, QWidget *parent)
: BaseToolBar(title, parent), : BaseToolBar(title, parent) {
m_txtSearchMessages(new MessagesSearchLineEdit(this)) { initializeSearchBox();
initializeHighlighter();
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*)));
} }
MessagesToolBar::~MessagesToolBar() { MessagesToolBar::~MessagesToolBar() {
@ -62,7 +41,7 @@ MessagesToolBar::~MessagesToolBar() {
QHash<QString, QAction*> MessagesToolBar::availableActions() const { QHash<QString, QAction*> MessagesToolBar::availableActions() const {
QHash<QString, QAction*> available_actions = FormMain::instance()->allActions(); QHash<QString, QAction*> available_actions = FormMain::instance()->allActions();
available_actions.insert(SEACRH_MESSAGES_ACTION_NAME, m_actionSearchMessages); 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; return available_actions;
} }
@ -99,9 +78,9 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) {
// Add search box. // Add search box.
addAction(m_actionSearchMessages); addAction(m_actionSearchMessages);
} }
else if (action_name == FILTER_ACTION_NAME) { else if (action_name == HIGHLIGHTER_ACTION_NAME) {
// Add filter button. // Add filter button.
addAction(m_actionFilterMessages); addAction(m_actionMessageHighlighter);
} }
else if (action_name == SPACER_ACTION_NAME) { else if (action_name == SPACER_ACTION_NAME) {
// Add new spacer. // Add new spacer.
@ -109,24 +88,64 @@ void MessagesToolBar::loadChangeableActions(const QStringList& actions) {
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
QAction *action = addWidget(spacer); 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("type", SPACER_ACTION_NAME);
action->setProperty("name", tr("Toolbar spacer")); action->setProperty("name", tr("Toolbar spacer"));
} }
} }
} }
void MessagesToolBar::handleMessageFilterChange(QAction *action) { void MessagesToolBar::handleMessageHighlighterChange(QAction *action) {
m_btnFilterMessages->setIcon(action->icon()); m_btnMessageHighlighter->setIcon(action->icon());
m_btnFilterMessages->setToolTip(action->text()); m_btnMessageHighlighter->setToolTip(action->text());
emit messageFilterChanged(action->data().value<MessagesModel::DisplayFilter>()); emit messageFilterChanged(action->data().value<MessagesModel::DisplayFilter>());
} }
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() { void MessagesToolBar::loadChangeableActions() {
QStringList action_names = Settings::instance()->value(APP_CFG_GUI, QStringList action_names = Settings::instance()->value(APP_CFG_GUI,
"messages_toolbar", "messages_toolbar",
"m_actionMarkSelectedMessagesAsRead,m_actionMarkSelectedMessagesAsUnread,m_actionSwitchImportanceOfSelectedMessages,spacer,search").toString().split(',', "m_actionMarkSelectedMessagesAsRead,m_actionMarkSelectedMessagesAsUnread,m_actionSwitchImportanceOfSelectedMessages,separator,highlighter,spacer,search").toString().split(',',
QString::SkipEmptyParts); QString::SkipEmptyParts);
loadChangeableActions(action_names); loadChangeableActions(action_names);

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#ifndef NEWSTOOLBAR_H #ifndef NEWSTOOLBAR_H
#define NEWSTOOLBAR_H #define NEWSTOOLBAR_H
@ -44,12 +61,17 @@ class MessagesToolBar : public BaseToolBar {
void messageFilterChanged(MessagesModel::DisplayFilter filter); void messageFilterChanged(MessagesModel::DisplayFilter filter);
private slots: private slots:
void handleMessageFilterChange(QAction *action); // Called when highlighter gets changed.
void handleMessageHighlighterChange(QAction *action);
private: private:
QWidgetAction *m_actionFilterMessages; void initializeSearchBox();
QToolButton *m_btnFilterMessages; void initializeHighlighter();
QMenu *m_menuFilterMessages;
private:
QWidgetAction *m_actionMessageHighlighter;
QToolButton *m_btnMessageHighlighter;
QMenu *m_menuMessageHighlighter;
QWidgetAction *m_actionSearchMessages; QWidgetAction *m_actionSearchMessages;
MessagesSearchLineEdit *m_txtSearchMessages; MessagesSearchLineEdit *m_txtSearchMessages;

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#include "gui/toolbareditor.h" #include "gui/toolbareditor.h"
#include "gui/basetoolbar.h" #include "gui/basetoolbar.h"
@ -86,7 +103,7 @@ void ToolBarEditor::insertSpacer() {
int current_row = m_ui->m_listActivatedActions->currentRow(); int current_row = m_ui->m_listActivatedActions->currentRow();
QListWidgetItem *item = new QListWidgetItem(tr("Toolbar spacer")); 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); item->setData(Qt::UserRole, SPACER_ACTION_NAME);
if (current_row >= 0) { if (current_row >= 0) {

View File

@ -1,3 +1,20 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#ifndef TOOLBAREDITOR_H #ifndef TOOLBAREDITOR_H
#define TOOLBAREDITOR_H #define TOOLBAREDITOR_H

View File

@ -72,12 +72,18 @@
<property name="horizontalScrollMode"> <property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum> <enum>QAbstractItemView::ScrollPerPixel</enum>
</property> </property>
<property name="isWrapping" stdset="0">
<bool>false</bool>
</property>
<property name="resizeMode"> <property name="resizeMode">
<enum>QListView::Adjust</enum> <enum>QListView::Adjust</enum>
</property> </property>
<property name="uniformItemSizes"> <property name="uniformItemSizes">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
@ -143,12 +149,18 @@
<property name="horizontalScrollMode"> <property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum> <enum>QAbstractItemView::ScrollPerPixel</enum>
</property> </property>
<property name="isWrapping" stdset="0">
<bool>false</bool>
</property>
<property name="resizeMode"> <property name="resizeMode">
<enum>QListView::Adjust</enum> <enum>QListView::Adjust</enum>
</property> </property>
<property name="uniformItemSizes"> <property name="uniformItemSizes">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -149,6 +149,7 @@ void WebBrowser::initializeLayout() {
} }
void WebBrowser::onLoadingStarted() { void WebBrowser::onLoadingStarted() {
// TODO: Do not display this when navigating to "about:blank".
m_loadingProgress->setValue(0); m_loadingProgress->setValue(0);
m_loadingProgress->show(); m_loadingProgress->show();
} }
@ -156,7 +157,7 @@ void WebBrowser::onLoadingStarted() {
void WebBrowser::onLoadingProgress(int progress) { void WebBrowser::onLoadingProgress(int progress) {
m_loadingProgress->setValue(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()->bytesReceived() / 1000).
arg(m_webView->page()->totalBytes() / 1000)); arg(m_webView->page()->totalBytes() / 1000));
} }