diff --git a/src/Icons/description.png b/src/Icons/description.png new file mode 100644 index 000000000..30b4262a6 Binary files /dev/null and b/src/Icons/description.png differ diff --git a/src/Icons/sphere.png b/src/Icons/sphere.png new file mode 100644 index 000000000..8cb92a115 Binary files /dev/null and b/src/Icons/sphere.png differ diff --git a/src/Icons/sphere2.png b/src/Icons/sphere2.png new file mode 100644 index 000000000..e5a8a2779 Binary files /dev/null and b/src/Icons/sphere2.png differ diff --git a/src/Icons/time.png b/src/Icons/time.png new file mode 100644 index 000000000..27389e3ab Binary files /dev/null and b/src/Icons/time.png differ diff --git a/src/Icons/url.png b/src/Icons/url.png new file mode 100644 index 000000000..17b552b0e Binary files /dev/null and b/src/Icons/url.png differ diff --git a/src/icons.qrc b/src/icons.qrc index 2db423761..f5f1117df 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -20,14 +20,19 @@ Icons/splash.png Icons/home.png Icons/uparrow.png - Icons/rss.png Icons/downarrow.png Icons/connection.png - Icons/add_file.png Icons/refresh.png + Icons/rss.png Icons/add_folder.png + Icons/add_file.png Icons/loading.png Icons/exec.png + Icons/sphere.png + Icons/url.png + Icons/time.png + Icons/description.png + Icons/sphere2.png Icons/flags/portugal.png Icons/flags/france.png Icons/flags/ukraine.png diff --git a/src/rss.h b/src/rss.h index e33b72ff3..e2d16401b 100644 --- a/src/rss.h +++ b/src/rss.h @@ -274,6 +274,10 @@ class RssStream : public QObject{ return lastRefresh.elapsed(); } + QString getLastRefresh() const{ + return QString::number(lastRefresh.hour())+"h"+QString::number(lastRefresh.minute())+"m"; + } + bool isRead() const { return read; } diff --git a/src/rss_imp.cpp b/src/rss_imp.cpp index 8b2d8209e..2f7b8d9e3 100644 --- a/src/rss_imp.cpp +++ b/src/rss_imp.cpp @@ -71,13 +71,14 @@ rssmanager.getStream(getNumStreamSelected())->setRead(); // update the color of the stream, is it old ? updateStreamName(getNumStreamSelected(), LATENCY); - refreshNewsList(); + refreshNewsList(); } } // display the content of a new when clicked on it void RSSImp::on_listNews_clicked() { listNews->item(listNews->currentRow())->setData(Qt::ForegroundRole, QVariant(QColor("grey"))); + listNews->item(listNews->currentRow())->setData(Qt::DecorationRole, QVariant(QIcon(":/Icons/sphere.png"))); refreshTextBrowser(); } @@ -176,7 +177,17 @@ for(unsigned short i=0; isetText(0, tr("no description avalaible")); + url->setText(0, rssmanager.getStream(i)->getUrl()); + time->setText(0, tr("no refresh")); + description->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/description.png"))); + url->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/url.png"))); + time->setData(0,Qt::DecorationRole, QVariant(QIcon(":/Icons/time.png"))); + description->setData(0,Qt::ForegroundRole, QVariant(QColor("grey"))); + url->setData(0,Qt::ForegroundRole, QVariant(QColor("grey"))); + time->setData(0,Qt::ForegroundRole, QVariant(QColor("grey"))); updateStreamName(i, NEWS); } } @@ -189,8 +200,14 @@ unsigned short currentStreamSize = currentstream->getListSize(); for(unsigned short i=0; igetItem(i)->getTitle(), listNews); - if(currentstream->getItem(i)->isRead()) + if(currentstream->getItem(i)->isRead()){ listNews->item(i)->setData(Qt::ForegroundRole, QVariant(QColor("grey"))); + listNews->item(i)->setData(Qt::DecorationRole, QVariant(QIcon(":/Icons/sphere.png"))); + } + else { + listNews->item(i)->setData(Qt::DecorationRole, QVariant(QIcon(":/Icons/sphere2.png"))); + listNews->item(i)->setData(Qt::ForegroundRole, QVariant(QColor("blue"))); + } if(i%2==0) listNews->item(i)->setData(Qt::BackgroundRole, QVariant(QColor(0, 255, 255, 20))); } @@ -242,15 +259,26 @@ refreshNewsList(); } listStreams->topLevelItem(i)->setData(0,Qt::DecorationRole, QVariant(QIcon(rssmanager.getStream(i)->getIconPath()))); - listStreams->topLevelItem(i)->child(0)->setText(0, rssmanager.getStream(i)->getDescription()); + // update description and display last refresh + if(rssmanager.getStream(i)->getDescription()!="") + listStreams->topLevelItem(i)->child(DESCRIPTION_CHILD)->setText(0, rssmanager.getStream(i)->getDescription()); + listStreams->topLevelItem(i)->child(TIME_CHILD)->setText(0, rssmanager.getStream(i)->getLastRefresh()); } } RSSImp::RSSImp() : QWidget(){ setupUi(this); + // icons of bottom buttons addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/add.png"))); delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/remove.png"))); refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/exec.png"))); + // icons of right-click menu + actionDelete->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/remove.png"))); + actionRename->setIcon(QIcon(QString::fromUtf8(":/Icons/log.png"))); + actionRefresh->setIcon(QIcon(QString::fromUtf8(":/Icons/refresh.png"))); + actionCreate->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/add.png"))); + actionRefreshAll->setIcon(QIcon(QString::fromUtf8(":/Icons/refresh.png"))); + connect(listStreams, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayRSSListMenu(const QPoint&))); connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteStream())); connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream())); diff --git a/src/rss_imp.h b/src/rss_imp.h index 4aed3b36c..2912f47ce 100644 --- a/src/rss_imp.h +++ b/src/rss_imp.h @@ -28,6 +28,10 @@ #include "rss.h" #include "GUI.h" +#define DESCRIPTION_CHILD 0 +#define URL_CHILD 1 +#define TIME_CHILD 2 + class RSSImp : public QWidget, public Ui::RSS{ Q_OBJECT