Progresss.....

This commit is contained in:
Martin Rotter 2013-12-12 10:10:17 +01:00
parent 93e1fb0ef7
commit 5742c60051
23 changed files with 142 additions and 103 deletions

View file

@ -271,7 +271,6 @@ set(APP_SOURCES
src/core/feedsproxymodel.cpp src/core/feedsproxymodel.cpp
src/core/feedsmodelcategory.cpp src/core/feedsmodelcategory.cpp
src/core/feedsmodelrootitem.cpp src/core/feedsmodelrootitem.cpp
src/core/feedsmodelnonrootitem.cpp
src/core/feedsmodelfeed.cpp src/core/feedsmodelfeed.cpp
src/core/feedsmodelstandardcategory.cpp src/core/feedsmodelstandardcategory.cpp
src/core/feedsmodelstandardfeed.cpp src/core/feedsmodelstandardfeed.cpp

View file

@ -32,6 +32,7 @@ CREATE TABLE IF NOT EXISTS Feeds (
category INTEGER NOT NULL CHECK (category >= -1), category INTEGER NOT NULL CHECK (category >= -1),
encoding TEXT NOT NULL CHECK (encoding != ''), encoding TEXT NOT NULL CHECK (encoding != ''),
url TEXT NOT NULL UNIQUE CHECK (url != ''), url TEXT NOT NULL UNIQUE CHECK (url != ''),
language TEXT,
type INTEGER NOT NULL type INTEGER NOT NULL
); );
-- ! -- !

View file

@ -48,9 +48,9 @@ void Debugging::debugHandler(QtMsgType type,
break; break;
} }
#else #else
Q_UNUSED(type); Q_UNUSED(type)
Q_UNUSED(placement); Q_UNUSED(placement)
Q_UNUSED(message); Q_UNUSED(message)
#endif #endif
} }
#else #else
@ -73,8 +73,8 @@ void Debugging::debugHandler(QtMsgType type, const char *message) {
break; break;
} }
#else #else
Q_UNUSED(type); Q_UNUSED(type)
Q_UNUSED(message); Q_UNUSED(message)
#endif #endif
} }
#endif #endif

View file

@ -1,17 +1,28 @@
#include "core/feedsmodel.h" #include "core/feedsmodel.h"
#include "core/feedsmodelrootitem.h" #include "core/feedsmodelstandardcategory.h"
#include "core/feedsmodelnonrootitem.h" #include "core/feedsmodelstandardfeed.h"
#include "core/feedsmodelfeed.h"
#include "core/feedsmodelcategory.h"
FeedsModel::FeedsModel(QObject *parent) : QAbstractItemModel(parent) { FeedsModel::FeedsModel(QObject *parent) : QAbstractItemModel(parent) {
m_rootItem = new FeedsModelRootItem(); m_rootItem = new FeedsModelRootItem(NULL);
FeedsModelCategory *cat = new FeedsModelCategory(m_rootItem); FeedsModelStandardCategory *cat1 = new FeedsModelStandardCategory(m_rootItem);
cat->m_childItems.append(new FeedsModelFeed(cat)); FeedsModelStandardCategory *cat2 = new FeedsModelStandardCategory(cat1);
m_rootItem->m_childItems.append(cat); FeedsModelStandardFeed *feed1 = new FeedsModelStandardFeed(cat1);
FeedsModelStandardFeed *feed2 = new FeedsModelStandardFeed(cat1);
FeedsModelStandardFeed *feed3 = new FeedsModelStandardFeed(m_rootItem);
FeedsModelStandardFeed *feed4 = new FeedsModelStandardFeed(cat2);
FeedsModelStandardFeed *feed5 = new FeedsModelStandardFeed(cat2);
cat1->appendChild(feed1);
cat1->appendChild(feed2);
cat1->appendChild(cat2);
cat2->appendChild(feed4);
cat2->appendChild(feed5);
m_rootItem->appendChild(cat1);
m_rootItem->appendChild(feed3);
} }
FeedsModel::~FeedsModel() { FeedsModel::~FeedsModel() {

View file

@ -2,7 +2,7 @@
FeedsModelCategory::FeedsModelCategory(FeedsModelRootItem *parent_item) FeedsModelCategory::FeedsModelCategory(FeedsModelRootItem *parent_item)
: FeedsModelNonRootItem(parent_item) { : FeedsModelRootItem(parent_item) {
} }
FeedsModelCategory::~FeedsModelCategory() { FeedsModelCategory::~FeedsModelCategory() {

View file

@ -1,12 +1,12 @@
#ifndef FEEDSMODELCLASSICCATEGORY_H #ifndef FEEDSMODELCLASSICCATEGORY_H
#define FEEDSMODELCLASSICCATEGORY_H #define FEEDSMODELCLASSICCATEGORY_H
#include "core/feedsmodelnonrootitem.h" #include "core/feedsmodelrootitem.h"
// Base class for all categories contained in FeedsModel. // Base class for all categories contained in FeedsModel.
// NOTE: This class should be derived to create PARTICULAR category types. // NOTE: This class should be derived to create PARTICULAR category types.
class FeedsModelCategory : public FeedsModelNonRootItem { class FeedsModelCategory : public FeedsModelRootItem {
public: public:
// Constructors and destructors // Constructors and destructors
explicit FeedsModelCategory(FeedsModelRootItem *parent_item); explicit FeedsModelCategory(FeedsModelRootItem *parent_item);

View file

@ -2,7 +2,7 @@
FeedsModelFeed::FeedsModelFeed(FeedsModelRootItem *parent_item) FeedsModelFeed::FeedsModelFeed(FeedsModelRootItem *parent_item)
:FeedsModelNonRootItem(parent_item) { : FeedsModelRootItem(parent_item) {
} }
FeedsModelFeed::~FeedsModelFeed() { FeedsModelFeed::~FeedsModelFeed() {

View file

@ -1,12 +1,12 @@
#ifndef FEEDSMODELFEED_H #ifndef FEEDSMODELFEED_H
#define FEEDSMODELFEED_H #define FEEDSMODELFEED_H
#include "core/feedsmodelnonrootitem.h" #include "core/feedsmodelrootitem.h"
// Represents BASE class for feeds contained in FeedsModel. // Represents BASE class for feeds contained in FeedsModel.
// NOTE: This class should be derived to create PARTICULAR feed types. // NOTE: This class should be derived to create PARTICULAR feed types.
class FeedsModelFeed : public FeedsModelNonRootItem class FeedsModelFeed : public FeedsModelRootItem
{ {
public: public:
// Constructors and destructors. // Constructors and destructors.

View file

@ -1,23 +0,0 @@
#include "core/feedsmodelnonrootitem.h"
FeedsModelNonRootItem::FeedsModelNonRootItem(FeedsModelRootItem *parent_item)
: FeedsModelRootItem(), m_parentItem(parent_item) {
}
FeedsModelNonRootItem::~FeedsModelNonRootItem() {
qDebug("Destroying FeedsModelNonRootItem instance.");
}
FeedsModelRootItem *FeedsModelNonRootItem::parent() {
return m_parentItem;
}
int FeedsModelNonRootItem::row() const {
if (m_parentItem) {
return static_cast<FeedsModelRootItem*>(m_parentItem)->m_childItems.indexOf((FeedsModelRootItem*) this);
}
else {
return 0;
}
}

View file

@ -1,23 +0,0 @@
#ifndef FEEDSMODELNONROOTITEM_H
#define FEEDSMODELNONROOTITEM_H
#include "core/feedsmodelrootitem.h"
// Base class for non-root items of FeedsModel.
// NOTE: This class add member for pointer to parent item (which is not needed
// for root item).
class FeedsModelNonRootItem : public FeedsModelRootItem {
public:
// Constructors and destructors.
explicit FeedsModelNonRootItem(FeedsModelRootItem *parent_item);
virtual ~FeedsModelNonRootItem();
FeedsModelRootItem *parent();
int row() const;
protected:
FeedsModelRootItem *m_parentItem;
};
#endif // FEEDSMODELNONROOTITEM_H

View file

@ -3,7 +3,8 @@
#include "core/feedsmodelrootitem.h" #include "core/feedsmodelrootitem.h"
FeedsModelRootItem::FeedsModelRootItem() { FeedsModelRootItem::FeedsModelRootItem(FeedsModelRootItem *parent_item)
: m_parentItem(parent_item) {
} }
FeedsModelRootItem::~FeedsModelRootItem() { FeedsModelRootItem::~FeedsModelRootItem() {
@ -12,11 +13,15 @@ FeedsModelRootItem::~FeedsModelRootItem() {
} }
FeedsModelRootItem *FeedsModelRootItem::parent() { FeedsModelRootItem *FeedsModelRootItem::parent() {
return NULL; return m_parentItem;
} }
FeedsModelRootItem *FeedsModelRootItem::child(int row) { FeedsModelRootItem *FeedsModelRootItem::child(int row) {
return m_childItems.at(0); return m_childItems.value(row);
}
void FeedsModelRootItem::appendChild(FeedsModelRootItem *child) {
m_childItems.append(child);
} }
int FeedsModelRootItem::columnCount() const { int FeedsModelRootItem::columnCount() const {
@ -24,17 +29,21 @@ int FeedsModelRootItem::columnCount() const {
} }
int FeedsModelRootItem::row() const { int FeedsModelRootItem::row() const {
if (m_parentItem) {
return m_parentItem->m_childItems.indexOf(const_cast<FeedsModelRootItem*>(this));
}
else {
return 0; return 0;
} }
}
int FeedsModelRootItem::childCount() const { int FeedsModelRootItem::childCount() const {
return m_childItems.count(); return m_childItems.count();
} }
QVariant FeedsModelRootItem::data(int column, int role) const { QVariant FeedsModelRootItem::data(int column, int role) const {
if (role == Qt::DisplayRole) { Q_UNUSED(column)
return "aaa"; Q_UNUSED(role)
}
return QVariant(); return QVariant();
} }

View file

@ -13,11 +13,12 @@ class FeedsModelRootItem {
public: public:
// Constructors and destructors. // Constructors and destructors.
explicit FeedsModelRootItem(); explicit FeedsModelRootItem(FeedsModelRootItem *parent_item);
virtual ~FeedsModelRootItem(); virtual ~FeedsModelRootItem();
virtual FeedsModelRootItem *parent(); virtual FeedsModelRootItem *parent();
virtual FeedsModelRootItem *child(int row); virtual FeedsModelRootItem *child(int row);
virtual void appendChild(FeedsModelRootItem *child);
virtual int childCount() const; virtual int childCount() const;
virtual int columnCount() const; virtual int columnCount() const;
virtual int row() const; virtual int row() const;
@ -26,6 +27,7 @@ class FeedsModelRootItem {
protected: protected:
QIcon m_icon; QIcon m_icon;
QList<FeedsModelRootItem*> m_childItems; QList<FeedsModelRootItem*> m_childItems;
FeedsModelRootItem *m_parentItem;
}; };

View file

@ -1,3 +1,5 @@
#include <QVariant>
#include "core/feedsmodelstandardcategory.h" #include "core/feedsmodelstandardcategory.h"
@ -8,3 +10,12 @@ FeedsModelStandardCategory::FeedsModelStandardCategory(FeedsModelRootItem *paren
FeedsModelStandardCategory::~FeedsModelStandardCategory() { FeedsModelStandardCategory::~FeedsModelStandardCategory() {
qDebug("Destroying FeedsModelStandardCategory instance."); qDebug("Destroying FeedsModelStandardCategory instance.");
} }
QVariant FeedsModelStandardCategory::data(int column, int role) const {
if (role == Qt::DisplayRole) {
return "aaa";
}
else {
return QVariant();
}
}

View file

@ -14,6 +14,9 @@ class FeedsModelStandardCategory : public FeedsModelCategory {
// Constructors and destructors. // Constructors and destructors.
explicit FeedsModelStandardCategory(FeedsModelRootItem *parent_item); explicit FeedsModelStandardCategory(FeedsModelRootItem *parent_item);
virtual ~FeedsModelStandardCategory(); virtual ~FeedsModelStandardCategory();
QVariant data(int column, int role) const;
}; };
#endif // FEEDSMODELSTANDARDCATEGORY_H #endif // FEEDSMODELSTANDARDCATEGORY_H

View file

@ -1,3 +1,5 @@
#include <QVariant>
#include "feedsmodelstandardfeed.h" #include "feedsmodelstandardfeed.h"
@ -8,3 +10,12 @@ FeedsModelStandardFeed::FeedsModelStandardFeed(FeedsModelRootItem *parent_item)
FeedsModelStandardFeed::~FeedsModelStandardFeed() { FeedsModelStandardFeed::~FeedsModelStandardFeed() {
qDebug("Destroying FeedsModelStandardFeed instance."); qDebug("Destroying FeedsModelStandardFeed instance.");
} }
QVariant FeedsModelStandardFeed::data(int column, int role) const {
if (role == Qt::DisplayRole) {
return "bbb";
}
else {
return QVariant();
}
}

View file

@ -11,6 +11,9 @@ class FeedsModelStandardFeed : public FeedsModelFeed {
// Constructors and destructors. // Constructors and destructors.
explicit FeedsModelStandardFeed(FeedsModelRootItem *parent_item); explicit FeedsModelStandardFeed(FeedsModelRootItem *parent_item);
virtual ~FeedsModelStandardFeed(); virtual ~FeedsModelStandardFeed();
QVariant data(int column, int role) const;
}; };
#endif // FEEDSMODELSTANDARDFEED_H #endif // FEEDSMODELSTANDARDFEED_H

View file

@ -102,7 +102,7 @@ void MessagesModel::setupHeaderData() {
} }
Qt::ItemFlags MessagesModel::flags(const QModelIndex &idx) const { Qt::ItemFlags MessagesModel::flags(const QModelIndex &idx) const {
Q_UNUSED(idx); Q_UNUSED(idx)
if (m_isInEditingMode) { if (m_isInEditingMode) {
// NOTE: Editing of model must be temporarily enabled here. // NOTE: Editing of model must be temporarily enabled here.
@ -319,7 +319,7 @@ bool MessagesModel::setAllMessagesRead(int read) {
QVariant MessagesModel::headerData(int section, QVariant MessagesModel::headerData(int section,
Qt::Orientation orientation, Qt::Orientation orientation,
int role) const { int role) const {
Q_UNUSED(orientation); Q_UNUSED(orientation)
switch (role) { switch (role) {
case Qt::DisplayRole: case Qt::DisplayRole:

View file

@ -65,23 +65,11 @@ void FeedMessageViewer::initialize() {
m_toolBar->setAllowedAreas(Qt::TopToolBarArea); m_toolBar->setAllowedAreas(Qt::TopToolBarArea);
m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); m_toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
QToolButton *update_button = new QToolButton(m_toolBar);
update_button->setPopupMode(QToolButton::InstantPopup);
update_button->setIcon(IconThemeFactory::getInstance()->fromTheme("view-refresh"));
update_button->setText(tr("Update selected/all feeds"));
update_button->setToolTip(tr("Select which feeds you want to update."));
QMenu *update_menu = new QMenu(tr("Feed update menu"), update_button);
update_menu->addAction(FormMain::getInstance()->m_ui->m_actionUpdateAllFeeds);
update_menu->addAction(FormMain::getInstance()->m_ui->m_actionUpdateSelectedFeeds);
update_button->setMenu(update_menu);
QWidgetAction *update_action = new QWidgetAction(m_toolBar);
update_action->setDefaultWidget(update_button);
// Add everything to toolbar. // Add everything to toolbar.
m_toolBar->addAction(update_action); m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionUpdateAllFeeds);
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionUpdateSelectedFeeds);
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionAddNewFeed);
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionEditSelectedFeed);
m_toolBar->addSeparator(); m_toolBar->addSeparator();
m_toolBar->addAction(FormMain::getInstance()->m_ui->m_actionMarkAllMessagesAsRead); 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_actionMarkAllMessagesAsUnread);

View file

@ -11,6 +11,7 @@ class FeedsView : public QTreeView {
Q_OBJECT Q_OBJECT
public: public:
// Constructors and destructors.
explicit FeedsView(QWidget *parent = 0); explicit FeedsView(QWidget *parent = 0);
virtual ~FeedsView(); virtual ~FeedsView();

View file

@ -147,7 +147,7 @@ void FormMain::display() {
} }
void FormMain::onCommitData(QSessionManager &manager) { void FormMain::onCommitData(QSessionManager &manager) {
Q_UNUSED(manager); Q_UNUSED(manager)
qDebug("OS asked application to commit its data."); qDebug("OS asked application to commit its data.");
} }

View file

@ -101,6 +101,7 @@
<addaction name="m_actionUpdateSelectedFeeds"/> <addaction name="m_actionUpdateSelectedFeeds"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="m_actionAddNewFeed"/> <addaction name="m_actionAddNewFeed"/>
<addaction name="m_actionAddNewCategory"/>
<addaction name="m_actionEditSelectedFeed"/> <addaction name="m_actionEditSelectedFeed"/>
<addaction name="m_actionDeleteSelectedFeeds"/> <addaction name="m_actionDeleteSelectedFeeds"/>
<addaction name="separator"/> <addaction name="separator"/>
@ -136,7 +137,7 @@
<string>Import stuff.</string> <string>Import stuff.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+I</string> <string notr="true">Ctrl+Shift+I</string>
</property> </property>
</action> </action>
<action name="m_actionExport"> <action name="m_actionExport">
@ -147,7 +148,7 @@
<string>Export stuff.</string> <string>Export stuff.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+E</string> <string notr="true">Ctrl+Shift+E</string>
</property> </property>
</action> </action>
<action name="m_actionQuit"> <action name="m_actionQuit">
@ -158,7 +159,7 @@
<string>Quit the application.</string> <string>Quit the application.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+Q</string> <string notr="true">Ctrl+Shift+Q</string>
</property> </property>
</action> </action>
<action name="m_actionSettings"> <action name="m_actionSettings">
@ -169,7 +170,7 @@
<string>Display settings of the application.</string> <string>Display settings of the application.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+S</string> <string notr="true">Ctrl+Shift+S</string>
</property> </property>
</action> </action>
<action name="m_actionAboutGuard"> <action name="m_actionAboutGuard">
@ -180,7 +181,7 @@
<string>About RSS Guard.</string> <string>About RSS Guard.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+A</string> <string notr="true">Ctrl+Shift+A</string>
</property> </property>
</action> </action>
<action name="m_actionFullscreen"> <action name="m_actionFullscreen">
@ -194,7 +195,7 @@
<string>Switch fullscreen mode.</string> <string>Switch fullscreen mode.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+F</string> <string notr="true">Ctrl+Shift+F</string>
</property> </property>
</action> </action>
<action name="m_actionAddBrowser"> <action name="m_actionAddBrowser">
@ -205,7 +206,7 @@
<string>Add new web browser tab.</string> <string>Add new web browser tab.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+T</string> <string notr="true">Ctrl+Shift+T</string>
</property> </property>
</action> </action>
<action name="m_actionCloseAllTabs"> <action name="m_actionCloseAllTabs">
@ -227,7 +228,7 @@
<string>Close current web browser tab.</string> <string>Close current web browser tab.</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+C</string> <string notr="true">Ctrl+Shift+C</string>
</property> </property>
</action> </action>
<action name="m_actionNoActions"> <action name="m_actionNoActions">
@ -251,6 +252,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Update all feeds.</string> <string>Update all feeds.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionUpdateSelectedFeeds"> <action name="m_actionUpdateSelectedFeeds">
<property name="text"> <property name="text">
@ -259,6 +263,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Update selected feeds/categories.</string> <string>Update selected feeds/categories.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionEditSelectedFeed"> <action name="m_actionEditSelectedFeed">
<property name="text"> <property name="text">
@ -267,6 +274,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Edit selected feed/category.</string> <string>Edit selected feed/category.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionDeleteSelectedFeeds"> <action name="m_actionDeleteSelectedFeeds">
<property name="text"> <property name="text">
@ -275,6 +285,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Delete selected feeds/categories.</string> <string>Delete selected feeds/categories.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionMarkSelectedMessagesAsRead"> <action name="m_actionMarkSelectedMessagesAsRead">
<property name="text"> <property name="text">
@ -316,6 +329,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Mark selected feed(s)/category(ies) as read.</string> <string>Mark selected feed(s)/category(ies) as read.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionMarkAllMessagesAsRead"> <action name="m_actionMarkAllMessagesAsRead">
<property name="text"> <property name="text">
@ -324,6 +340,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Mark all messages read.</string> <string>Mark all messages read.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionMarkAllMessagesAsUnread"> <action name="m_actionMarkAllMessagesAsUnread">
<property name="text"> <property name="text">
@ -332,6 +351,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Mark all messages unread.</string> <string>Mark all messages unread.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionDeleteSelectedMessages"> <action name="m_actionDeleteSelectedMessages">
<property name="text"> <property name="text">
@ -340,6 +362,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Delete selected messages.</string> <string>Delete selected messages.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionDeleteAllMessages"> <action name="m_actionDeleteAllMessages">
<property name="text"> <property name="text">
@ -348,6 +373,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Delete all messages.</string> <string>Delete all messages.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionAddNewFeed"> <action name="m_actionAddNewFeed">
<property name="text"> <property name="text">
@ -356,6 +384,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Add new feed.</string> <string>Add new feed.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionOpenSelectedSourceArticlesExternally"> <action name="m_actionOpenSelectedSourceArticlesExternally">
<property name="text"> <property name="text">
@ -364,6 +395,9 @@
<property name="toolTip"> <property name="toolTip">
<string>Open selected source articles in external browser.</string> <string>Open selected source articles in external browser.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
<action name="m_actionOpenSelectedMessagesInternally"> <action name="m_actionOpenSelectedMessagesInternally">
<property name="text"> <property name="text">
@ -383,6 +417,17 @@
<property name="toolTip"> <property name="toolTip">
<string>Open selected source messages in internal browser.</string> <string>Open selected source messages in internal browser.</string>
</property> </property>
<property name="shortcut">
<string notr="true"/>
</property>
</action>
<action name="m_actionAddNewCategory">
<property name="text">
<string>Add new &amp;category</string>
</property>
<property name="shortcut">
<string notr="true"/>
</property>
</action> </action>
</widget> </widget>
<customwidgets> <customwidgets>

View file

@ -109,7 +109,7 @@ void FormSettings::changeDefaultBrowserArguments(int index) {
void FormSettings::onSkinSelected(QTreeWidgetItem *current, void FormSettings::onSkinSelected(QTreeWidgetItem *current,
QTreeWidgetItem *previous) { QTreeWidgetItem *previous) {
Q_UNUSED(previous); Q_UNUSED(previous)
if (current != NULL) { if (current != NULL) {
Skin skin = current->data(0, Qt::UserRole).value<Skin>(); Skin skin = current->data(0, Qt::UserRole).value<Skin>();

View file

@ -59,10 +59,11 @@ void LocationLineEdit::paintEvent(QPaintEvent *event) {
QPalette current_palette = palette(); QPalette current_palette = palette();
QColor loadingColor = settings->value(APP_CFG_BROWSER, QColor loadingColor = settings->value(APP_CFG_BROWSER,
"browser_progress_color", "browser_progress_color",
QColor(0, 255, 0, 100)).value<QColor>(); QColor(0, 100, 0, 100)).value<QColor>();
QLinearGradient gradient(0, 0, width(), 0); QLinearGradient gradient(0, 0, width(), 0);
qreal percentage_border = m_progress / 100.0; qreal percentage_border = m_progress / 100.0;
// TODO: Use better gradient here, something fancy.
gradient.setColorAt(0, loadingColor); gradient.setColorAt(0, loadingColor);
gradient.setColorAt(percentage_border - 0.01, loadingColor); gradient.setColorAt(percentage_border - 0.01, loadingColor);
gradient.setColorAt(percentage_border - 0.008, loadingColor.lighter(130)); gradient.setColorAt(percentage_border - 0.008, loadingColor.lighter(130));