Browse Source

- Improved refresh icon

- Added tooltips on rss buttons
- Fixed a compiling warning
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
43bced2e04
  1. BIN
      src/Icons/exec.png
  2. BIN
      src/Icons/loading.gif
  3. 1
      src/icons.qrc
  4. 18
      src/rss.h
  5. 9
      src/rss.ui
  6. 8
      src/rss_imp.cpp

BIN
src/Icons/exec.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/Icons/loading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

1
src/icons.qrc

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
<file>Icons/refresh.png</file>
<file>Icons/add_folder.png</file>
<file>Icons/loading.png</file>
<file>Icons/exec.png</file>
<file>Icons/flags/portugal.png</file>
<file>Icons/flags/france.png</file>
<file>Icons/flags/ukraine.png</file>

18
src/rss.h

@ -156,7 +156,7 @@ class RssStream : public QObject{ @@ -156,7 +156,7 @@ class RssStream : public QObject{
emit refreshFinished(url, NEWS);
}
void displayIcon(const QString&, const QString& file_path, int return_code, const QString&) {
void displayIcon(const QString&, const QString& file_path, int, const QString&) {
/*if(QFile::exists(iconPath) && iconPath!=":/Icons/rss.png") {
QFile::remove(iconPath);
}
@ -166,7 +166,7 @@ class RssStream : public QObject{ @@ -166,7 +166,7 @@ class RssStream : public QObject{
//iconPath = ":/Icons/rss.png";
//iconPath = "/tmp/favicon.gif";
if(return_code){
// Download failed
qDebug("(download failure) "+iconPath.toUtf8());
@ -180,7 +180,7 @@ class RssStream : public QObject{ @@ -180,7 +180,7 @@ class RssStream : public QObject{
openIcon();
emit refreshFinished(url, ICON);*/
qDebug("******************Icone downloaded"+file_path.toUtf8());
}
}
public:
RssStream(const QString& _url) {
@ -192,7 +192,7 @@ class RssStream : public QObject{ @@ -192,7 +192,7 @@ class RssStream : public QObject{
connect(downloaderRss, SIGNAL(downloadFinished(const QString&, const QString&, int, const QString&)), this, SLOT(processDownloadedFile(const QString&, const QString&, int, const QString&)));
downloaderRss->downloadUrl(url);
// XXX: remove it when gif can be displayed
iconPath = ":/Icons/rss.png";
iconPath = ":/Icons/rss.png";
//getIcon();
lastRefresh.start();
}
@ -256,7 +256,7 @@ class RssStream : public QObject{ @@ -256,7 +256,7 @@ class RssStream : public QObject{
QString getIconPath() const{
return iconPath;
}
}
RssItem* getItem(unsigned int index) const{
return listItem.at(index);
@ -310,7 +310,7 @@ class RssStream : public QObject{ @@ -310,7 +310,7 @@ class RssStream : public QObject{
for(unsigned short i=0; i<listsize; i++) {
listItem.removeLast();
}
while(!channel.isNull()) {
// we are reading the rss'main info
if (channel.tagName() == "channel") {
@ -356,7 +356,7 @@ class RssStream : public QObject{ @@ -356,7 +356,7 @@ class RssStream : public QObject{
while(getListSize()>STREAM_MAX_ITEM) {
listItem.removeAt(STREAM_MAX_ITEM);
}
}
// existing and opening test after download
@ -411,7 +411,7 @@ class RssStream : public QObject{ @@ -411,7 +411,7 @@ class RssStream : public QObject{
// global class, manage the whole rss stream
class RssManager : public QObject{
Q_OBJECT
private :
QList<RssStream*> streamList;
QStringList streamListUrl;
@ -423,7 +423,7 @@ class RssManager : public QObject{ @@ -423,7 +423,7 @@ class RssManager : public QObject{
void streamNeedRefresh(const QString& _url, const unsigned short& type) {
emit(streamNeedRefresh(hasStream(_url), type));
}
public :
RssManager(){
loadStreamList();

9
src/rss.ui

@ -90,6 +90,9 @@ @@ -90,6 +90,9 @@
<height>22</height>
</size>
</property>
<property name="toolTip" >
<string>Delete selected streams</string>
</property>
<property name="text" >
<string/>
</property>
@ -109,6 +112,9 @@ @@ -109,6 +112,9 @@
<height>22</height>
</size>
</property>
<property name="toolTip" >
<string>Refresh RSS streams</string>
</property>
<property name="text" >
<string/>
</property>
@ -128,6 +134,9 @@ @@ -128,6 +134,9 @@
<height>22</height>
</size>
</property>
<property name="toolTip" >
<string>Add a new RSS stream</string>
</property>
<property name="text" >
<string/>
</property>

8
src/rss_imp.cpp

@ -211,7 +211,7 @@ @@ -211,7 +211,7 @@
}
// when news are refreshed, update all informations
if(type == NEWS) {
//qDebug("###################"+rssmanager.getStream(i)->getIconPath().toUtf8());
//qDebug("###################"+rssmanager.getStream(i)->getIconPath().toUtf8());
unsigned short nbitem = rssmanager.getStream(i)->getListSize();
listStreams->item(i)->setText(rssmanager.getStream(i)->getAlias().toUtf8()+" ("+QString::number(nbitem,10).toUtf8()+")");
if(nbitem==0)
@ -220,14 +220,14 @@ @@ -220,14 +220,14 @@
listStreams->item(i)->setData(Qt::ForegroundRole, QVariant(QColor("orange")));
else
listStreams->item(i)->setData(Qt::ForegroundRole, QVariant(QColor("green")));
if(!rssmanager.getStream(i)->isRead())
listStreams->item(i)->setData(Qt::BackgroundRole, QVariant(QColor(0, 255, 0, 20)));
if(listStreams->currentRow()==i) {
listNews->clear();
refreshNewsList();
}
listStreams->item(i)->setData(Qt::DecorationRole, QVariant(QIcon(rssmanager.getStream(i)->getIconPath())));
listStreams->item(i)->setData(Qt::DecorationRole, QVariant(QIcon(rssmanager.getStream(i)->getIconPath())));
}
}
@ -235,7 +235,7 @@ @@ -235,7 +235,7 @@
setupUi(this);
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/refresh.png")));
refreshAll_button->setIcon(QIcon(QString::fromUtf8(":/Icons/exec.png")));
connect(listStreams, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFinishedListMenu(const QPoint&)));
connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteStream()));
connect(actionRename, SIGNAL(triggered()), this, SLOT(renameStream()));

Loading…
Cancel
Save