Added many initial implementations.
This commit is contained in:
parent
7825f6150a
commit
5e470be83c
@ -13,10 +13,16 @@
|
|||||||
# "-DCMAKE_INSTALL_PREFIX=/usr"
|
# "-DCMAKE_INSTALL_PREFIX=/usr"
|
||||||
# Installation path, replace with something like "C:\rssguard" on Windows.
|
# Installation path, replace with something like "C:\rssguard" on Windows.
|
||||||
#
|
#
|
||||||
# "-DUSE_QT_5=ON"
|
# "-DUSE_QT_5=OFF"
|
||||||
# Specifies which major Qt version to use. Qt 4 and Qt 5 are supported.
|
# Specifies which major Qt version to use. Qt 4 and Qt 5 are supported.
|
||||||
# If "OFF" is passed as an argument, then Qt 4 is used. Default is "OFF".
|
# If "OFF" is passed as an argument, then Qt 4 is used. Default is "OFF".
|
||||||
#
|
#
|
||||||
|
# "-DBUNDLE_ICON_THEMES=ON"
|
||||||
|
# If "ON", then custom icons theme(s) will be bundled with application
|
||||||
|
# installation. If "OFF", then no icon theme(s) will be available for
|
||||||
|
# the application and application will run in iconless mode.
|
||||||
|
# Default and recommended value is "ON".
|
||||||
|
#
|
||||||
# Other information:
|
# Other information:
|
||||||
# - supports Windows, Linux, OS/2 (eComStation),
|
# - supports Windows, Linux, OS/2 (eComStation),
|
||||||
# - Qt 4.7.3 and higher is required,
|
# - Qt 4.7.3 and higher is required,
|
||||||
@ -35,7 +41,7 @@ cmake_minimum_required(VERSION 2.8.11)
|
|||||||
project(rssguard)
|
project(rssguard)
|
||||||
set(APP_NAME "RSS Guard")
|
set(APP_NAME "RSS Guard")
|
||||||
set(APP_LOW_NAME "rssguard")
|
set(APP_LOW_NAME "rssguard")
|
||||||
set(APP_VERSION "2.0.0-prealpha-3")
|
set(APP_VERSION "2.0.0-prealpha-4")
|
||||||
set(FILE_VERSION "2,0,0,0")
|
set(FILE_VERSION "2,0,0,0")
|
||||||
set(APP_AUTHOR "Martin Rotter")
|
set(APP_AUTHOR "Martin Rotter")
|
||||||
set(APP_URL "http://rssguard.sf.net")
|
set(APP_URL "http://rssguard.sf.net")
|
||||||
@ -77,6 +83,7 @@ message(STATUS "[${APP_LOW_NAME}] Obtaining revision number.")
|
|||||||
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
if(GIT_FOUND)
|
if(GIT_FOUND)
|
||||||
|
# TODO: https://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines#Git
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||||
@ -262,6 +269,11 @@ set(APP_SOURCES
|
|||||||
src/core/messagesproxymodel.cpp
|
src/core/messagesproxymodel.cpp
|
||||||
src/core/feedsmodel.cpp
|
src/core/feedsmodel.cpp
|
||||||
src/core/feedsproxymodel.cpp
|
src/core/feedsproxymodel.cpp
|
||||||
|
src/core/basefeedsmodelitem.cpp
|
||||||
|
src/core/basefeedsmodelcategory.cpp
|
||||||
|
src/core/feedsmodelrootitem.cpp
|
||||||
|
src/core/feedsmodelnonrootitem.cpp
|
||||||
|
src/core/feedsmodelfeed.cpp
|
||||||
|
|
||||||
# Basic application sources.
|
# Basic application sources.
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
|
@ -11,10 +11,14 @@ DROP TABLE IF EXISTS Categories;
|
|||||||
-- !
|
-- !
|
||||||
CREATE TABLE IF NOT EXISTS Categories (
|
CREATE TABLE IF NOT EXISTS Categories (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
|
parent_id INTEGER NOT NULL,
|
||||||
title TEXT NOT NULL UNIQUE CHECK (title != ''),
|
title TEXT NOT NULL UNIQUE CHECK (title != ''),
|
||||||
description TEXT,
|
description TEXT,
|
||||||
date_created TEXT NOT NULL CHECK (date_created != ''),
|
date_created TEXT NOT NULL CHECK (date_created != ''),
|
||||||
icon BLOB
|
icon BLOB,
|
||||||
|
type INTEGER NOT NULL,
|
||||||
|
|
||||||
|
FOREIGN KEY (parent_id) REFERENCES Categories (id)
|
||||||
);
|
);
|
||||||
-- !
|
-- !
|
||||||
DROP TABLE IF EXISTS Feeds;
|
DROP TABLE IF EXISTS Feeds;
|
||||||
|
10
src/core/basefeedsmodelcategory.cpp
Normal file
10
src/core/basefeedsmodelcategory.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "core/basefeedsmodelcategory.h"
|
||||||
|
|
||||||
|
|
||||||
|
BaseFeedsModelCategory::BaseFeedsModelCategory(BaseFeedsModelItem *parent_item)
|
||||||
|
: FeedsModelNonRootItem(parent_item) {
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseFeedsModelCategory::~BaseFeedsModelCategory() {
|
||||||
|
qDebug("Destroying BaseFeedsModelCategory instance.");
|
||||||
|
}
|
18
src/core/basefeedsmodelcategory.h
Normal file
18
src/core/basefeedsmodelcategory.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef FEEDSMODELCLASSICCATEGORY_H
|
||||||
|
#define FEEDSMODELCLASSICCATEGORY_H
|
||||||
|
|
||||||
|
#include "core/feedsmodelnonrootitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Base class for all categories contained in FeedsModel.
|
||||||
|
// NOTE: This class is derived to create PARTICULAR category types.
|
||||||
|
class BaseFeedsModelCategory : public FeedsModelNonRootItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Constructors and destructors
|
||||||
|
explicit BaseFeedsModelCategory(BaseFeedsModelItem *parent_item);
|
||||||
|
virtual ~BaseFeedsModelCategory();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FEEDSMODELCLASSICCATEGORY_H
|
11
src/core/basefeedsmodelitem.cpp
Normal file
11
src/core/basefeedsmodelitem.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "core/basefeedsmodelitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
BaseFeedsModelItem::BaseFeedsModelItem() {
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseFeedsModelItem::~BaseFeedsModelItem() {
|
||||||
|
qDebug("Destroying BaseFeedsModelItem instance.");
|
||||||
|
}
|
26
src/core/basefeedsmodelitem.h
Normal file
26
src/core/basefeedsmodelitem.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef BASEFEEDSMODELITEM_H
|
||||||
|
#define BASEFEEDSMODELITEM_H
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
|
|
||||||
|
// Base class for all items contained in FeedsModel.
|
||||||
|
class BaseFeedsModelItem {
|
||||||
|
public:
|
||||||
|
// Constructors and destructors.
|
||||||
|
explicit BaseFeedsModelItem();
|
||||||
|
virtual ~BaseFeedsModelItem();
|
||||||
|
|
||||||
|
// Returns parent item of this item.
|
||||||
|
// NOTE: Model ROOT item has NULL parent.
|
||||||
|
virtual BaseFeedsModelItem *parent() = 0;
|
||||||
|
virtual int childCount() const = 0;
|
||||||
|
virtual int columnCount() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QIcon m_icon;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BASEFEEDSMODELITEM_H
|
@ -3,3 +3,7 @@
|
|||||||
|
|
||||||
FeedsModel::FeedsModel(QObject *parent) : QAbstractItemModel(parent) {
|
FeedsModel::FeedsModel(QObject *parent) : QAbstractItemModel(parent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FeedsModel::~FeedsModel() {
|
||||||
|
qDebug("Destroying FeedsModel instance.");
|
||||||
|
}
|
||||||
|
@ -9,6 +9,7 @@ class FeedsModel : public QAbstractItemModel {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FeedsModel(QObject *parent = 0);
|
explicit FeedsModel(QObject *parent = 0);
|
||||||
|
virtual ~FeedsModel();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
10
src/core/feedsmodelfeed.cpp
Normal file
10
src/core/feedsmodelfeed.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "core/feedsmodelfeed.h"
|
||||||
|
|
||||||
|
|
||||||
|
FeedsModelFeed::FeedsModelFeed(BaseFeedsModelItem *parent_item)
|
||||||
|
:FeedsModelNonRootItem(parent_item) {
|
||||||
|
}
|
||||||
|
|
||||||
|
FeedsModelFeed::~FeedsModelFeed() {
|
||||||
|
qDebug("Destroying FeedsModelFeed instance.");
|
||||||
|
}
|
17
src/core/feedsmodelfeed.h
Normal file
17
src/core/feedsmodelfeed.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef FEEDSMODELFEED_H
|
||||||
|
#define FEEDSMODELFEED_H
|
||||||
|
|
||||||
|
#include "core/feedsmodelnonrootitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Represents BASE class for feeds contained in FeedsModel.
|
||||||
|
// NOTE: This class is derived to create PARTICULAR feed types.
|
||||||
|
class FeedsModelFeed : public FeedsModelNonRootItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Constructors and destructors.
|
||||||
|
explicit FeedsModelFeed(BaseFeedsModelItem *parent_item);
|
||||||
|
virtual ~FeedsModelFeed();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FEEDSMODELFEED_H
|
14
src/core/feedsmodelnonrootitem.cpp
Normal file
14
src/core/feedsmodelnonrootitem.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "core/feedsmodelnonrootitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
FeedsModelNonRootItem::FeedsModelNonRootItem(BaseFeedsModelItem *parent_item)
|
||||||
|
: FeedsModelRootItem(), m_parentItem(parent_item) {
|
||||||
|
}
|
||||||
|
|
||||||
|
FeedsModelNonRootItem::~FeedsModelNonRootItem() {
|
||||||
|
qDebug("Destroying FeedsModelNonRootItem instance.");
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseFeedsModelItem *FeedsModelNonRootItem::parent() {
|
||||||
|
return m_parentItem;
|
||||||
|
}
|
22
src/core/feedsmodelnonrootitem.h
Normal file
22
src/core/feedsmodelnonrootitem.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#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(BaseFeedsModelItem *parent_item);
|
||||||
|
virtual ~FeedsModelNonRootItem();
|
||||||
|
|
||||||
|
BaseFeedsModelItem *parent();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
BaseFeedsModelItem *m_parentItem;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FEEDSMODELNONROOTITEM_H
|
23
src/core/feedsmodelrootitem.cpp
Normal file
23
src/core/feedsmodelrootitem.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include "core/feedsmodelrootitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
FeedsModelRootItem::FeedsModelRootItem()
|
||||||
|
: BaseFeedsModelItem() {
|
||||||
|
}
|
||||||
|
|
||||||
|
FeedsModelRootItem::~FeedsModelRootItem() {
|
||||||
|
qDebug("Destroying FeedsModelRootItem instance.");
|
||||||
|
qDeleteAll(m_childItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseFeedsModelItem *FeedsModelRootItem::parent() {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FeedsModelRootItem::columnCount() const {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FeedsModelRootItem::childCount() const {
|
||||||
|
return m_childItems.count();
|
||||||
|
}
|
25
src/core/feedsmodelrootitem.h
Normal file
25
src/core/feedsmodelrootitem.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef FEEDMODELROOTITEM_H
|
||||||
|
#define FEEDMODELROOTITEM_H
|
||||||
|
|
||||||
|
#include "core/basefeedsmodelitem.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Represents ROOT item of FeedsModel.
|
||||||
|
// NOTE: This class is derived to add functionality for
|
||||||
|
// all non-root items of FeedsModel.
|
||||||
|
class FeedsModelRootItem : public BaseFeedsModelItem {
|
||||||
|
public:
|
||||||
|
// Constructors and destructors.
|
||||||
|
explicit FeedsModelRootItem();
|
||||||
|
virtual ~FeedsModelRootItem();
|
||||||
|
|
||||||
|
BaseFeedsModelItem *parent();
|
||||||
|
int childCount() const;
|
||||||
|
int columnCount() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QList<BaseFeedsModelItem*> m_childItems;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FEEDMODELROOTITEM_H
|
@ -4,3 +4,7 @@
|
|||||||
FeedsProxyModel::FeedsProxyModel(QObject *parent)
|
FeedsProxyModel::FeedsProxyModel(QObject *parent)
|
||||||
: QSortFilterProxyModel(parent) {
|
: QSortFilterProxyModel(parent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FeedsProxyModel::~FeedsProxyModel() {
|
||||||
|
qDebug("Destroying FeedsProxyModel instance");
|
||||||
|
}
|
||||||
|
@ -9,6 +9,7 @@ class FeedsProxyModel : public QSortFilterProxyModel {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FeedsProxyModel(QObject *parent = 0);
|
explicit FeedsProxyModel(QObject *parent = 0);
|
||||||
|
virtual ~FeedsProxyModel();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -126,13 +126,7 @@ void FormSettings::changeBrowserProgressColor() {
|
|||||||
void FormSettings::loadFeedsMessages() {
|
void FormSettings::loadFeedsMessages() {
|
||||||
Settings *settings = Settings::getInstance();
|
Settings *settings = Settings::getInstance();
|
||||||
|
|
||||||
// TODO: dodělat
|
m_ui->m_cmbExternalBrowserPreset->addItem(tr("Opera 12 or older)", "-nosession %1"));
|
||||||
m_ui->m_cmbExternalBrowserPreset->addItem("Chromium", "aa %1");
|
|
||||||
m_ui->m_cmbExternalBrowserPreset->addItem("Mozilla Firefox", "aa %1");
|
|
||||||
m_ui->m_cmbExternalBrowserPreset->addItem("Safari", "aa %1");
|
|
||||||
m_ui->m_cmbExternalBrowserPreset->addItem("Microsoft Internet Explorer", "aa %1");
|
|
||||||
m_ui->m_cmbExternalBrowserPreset->addItem("Opera 12 or older", "-nosession %1");
|
|
||||||
|
|
||||||
m_ui->m_txtExternalBrowserExecutable->setText(settings->value(APP_CFG_MESSAGES,
|
m_ui->m_txtExternalBrowserExecutable->setText(settings->value(APP_CFG_MESSAGES,
|
||||||
"external_browser_executable").toString());
|
"external_browser_executable").toString());
|
||||||
m_ui->m_txtExternalBrowserArguments->setText(settings->value(APP_CFG_MESSAGES,
|
m_ui->m_txtExternalBrowserArguments->setText(settings->value(APP_CFG_MESSAGES,
|
||||||
|
@ -715,7 +715,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="m_cmbExternalBrowserPreset">
|
<widget class="QComboBox" name="m_cmbExternalBrowserPreset">
|
||||||
<property name="sizeAdjustPolicy">
|
<property name="sizeAdjustPolicy">
|
||||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
<enum>QComboBox::AdjustToContents</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -23,6 +23,24 @@ TabBar::TabType TabBar::tabType(int index) {
|
|||||||
return static_cast<TabBar::TabType>(tabData(index).value<int>());
|
return static_cast<TabBar::TabType>(tabData(index).value<int>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabBar::wheelEvent(QWheelEvent *event) {
|
||||||
|
int current_index = currentIndex();
|
||||||
|
int number_of_tabs = count();
|
||||||
|
|
||||||
|
// Make sure rotating works.
|
||||||
|
if (number_of_tabs > 1) {
|
||||||
|
if (event->delta() > 0 && current_index == 0) {
|
||||||
|
setCurrentIndex(number_of_tabs - 1);
|
||||||
|
}
|
||||||
|
else if (event->delta() < 0 && current_index == number_of_tabs - 1) {
|
||||||
|
setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
QTabBar::wheelEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TabBar::mousePressEvent(QMouseEvent *event) {
|
void TabBar::mousePressEvent(QMouseEvent *event) {
|
||||||
QTabBar::mousePressEvent(event);
|
QTabBar::mousePressEvent(event);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ class TabBar : public QTabBar {
|
|||||||
// Reimplementations.
|
// Reimplementations.
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
void wheelEvent(QWheelEvent *event);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Emmited if empty space on tab bar is double clicked.
|
// Emmited if empty space on tab bar is double clicked.
|
||||||
|
@ -172,11 +172,14 @@ void WebBrowser::clear() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::navigateToMessage(const Message &message) {
|
void WebBrowser::navigateToMessage(const Message &message) {
|
||||||
|
|
||||||
m_webView->setHtml(SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title,
|
m_webView->setHtml(SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title,
|
||||||
tr("Written by ") + message.m_author,
|
tr("Written by ") + message.m_author,
|
||||||
message.m_url,
|
message.m_url,
|
||||||
message.m_contents,
|
message.m_contents,
|
||||||
message.m_updated.toString(Qt::DefaultLocaleLongDate)));
|
message.m_updated.toString(Qt::DefaultLocaleLongDate)));
|
||||||
|
emit iconChanged(m_index,
|
||||||
|
IconThemeFactory::getInstance()->fromTheme("mail-mark-read"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebBrowser::updateZoomGui() {
|
void WebBrowser::updateZoomGui() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user