1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-03-13 05:41:17 +00:00

- Improved refresh icon

- Added tooltips on rss buttons
- Fixed a compiling warning
This commit is contained in:
Christophe Dumez 2007-04-15 14:53:38 +00:00
parent 65468d7826
commit 43bced2e04
6 changed files with 23 additions and 13 deletions

BIN
src/Icons/exec.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

View File

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

View File

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

View File

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

View File

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