|
|
@ -78,6 +78,7 @@ |
|
|
|
// display the content of a new when clicked on it
|
|
|
|
// display the content of a new when clicked on it
|
|
|
|
void RSSImp::on_listNews_clicked() { |
|
|
|
void RSSImp::on_listNews_clicked() { |
|
|
|
listNews->item(listNews->currentRow())->setData(Qt::ForegroundRole, QVariant(QColor("grey"))); |
|
|
|
listNews->item(listNews->currentRow())->setData(Qt::ForegroundRole, QVariant(QColor("grey"))); |
|
|
|
|
|
|
|
listNews->item(listNews->currentRow())->setData(Qt::DecorationRole, QVariant(QIcon(":/Icons/sphere.png"))); |
|
|
|
refreshTextBrowser(); |
|
|
|
refreshTextBrowser(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -176,7 +177,17 @@ |
|
|
|
for(unsigned short i=0; i<nbstream; i++) { |
|
|
|
for(unsigned short i=0; i<nbstream; i++) { |
|
|
|
QTreeWidgetItem* stream = new QTreeWidgetItem(listStreams); |
|
|
|
QTreeWidgetItem* stream = new QTreeWidgetItem(listStreams); |
|
|
|
QTreeWidgetItem* description = new QTreeWidgetItem(stream); |
|
|
|
QTreeWidgetItem* description = new QTreeWidgetItem(stream); |
|
|
|
|
|
|
|
QTreeWidgetItem* url = new QTreeWidgetItem(stream); |
|
|
|
|
|
|
|
QTreeWidgetItem* time = new QTreeWidgetItem(stream); |
|
|
|
description->setText(0, tr("no description avalaible")); |
|
|
|
description->setText(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); |
|
|
|
updateStreamName(i, NEWS); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -189,8 +200,14 @@ |
|
|
|
unsigned short currentStreamSize = currentstream->getListSize(); |
|
|
|
unsigned short currentStreamSize = currentstream->getListSize(); |
|
|
|
for(unsigned short i=0; i<currentStreamSize; ++i) { |
|
|
|
for(unsigned short i=0; i<currentStreamSize; ++i) { |
|
|
|
new QListWidgetItem(currentstream->getItem(i)->getTitle(), listNews); |
|
|
|
new QListWidgetItem(currentstream->getItem(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::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) |
|
|
|
if(i%2==0) |
|
|
|
listNews->item(i)->setData(Qt::BackgroundRole, QVariant(QColor(0, 255, 255, 20))); |
|
|
|
listNews->item(i)->setData(Qt::BackgroundRole, QVariant(QColor(0, 255, 255, 20))); |
|
|
|
} |
|
|
|
} |
|
|
@ -242,15 +259,26 @@ |
|
|
|
refreshNewsList(); |
|
|
|
refreshNewsList(); |
|
|
|
} |
|
|
|
} |
|
|
|
listStreams->topLevelItem(i)->setData(0,Qt::DecorationRole, QVariant(QIcon(rssmanager.getStream(i)->getIconPath()))); |
|
|
|
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(){ |
|
|
|
RSSImp::RSSImp() : QWidget(){ |
|
|
|
setupUi(this); |
|
|
|
setupUi(this); |
|
|
|
|
|
|
|
// icons of bottom buttons
|
|
|
|
addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/add.png"))); |
|
|
|
addStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/add.png"))); |
|
|
|
delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/remove.png"))); |
|
|
|
delStream_button->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/remove.png"))); |
|
|
|
refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/exec.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(listStreams, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayRSSListMenu(const QPoint&))); |
|
|
|
connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteStream())); |
|
|
|
connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteStream())); |
|
|
|
connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream())); |
|
|
|
connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream())); |
|
|
|