added rating icons to show on first columns too

update settings with latest changes from Preferences

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1543 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-08-17 20:19:02 +00:00
parent 6972bc1cb8
commit 43b6505512
8 changed files with 186 additions and 145 deletions

View file

@ -54,21 +54,22 @@
#define IMAGE_GOOD ":/images/filerating4.png"
#define IMAGE_OK ":/images/filerating3.png"
#define IMAGE_SUX ":/images/filerating2.png"
#define IMAGE_BADLINK ":/images/filerating1.png"
#define IMAGE_DOWNLOAD ":/images/download16.png"
#define IMAGE_BADLINK ":/images/filerating1.png"
#define IMAGE_NOCOMMENTRATING ":/images/filerating0.png"
#define IMAGE_DOWNLOAD ":/images/download16.png"
/******
* #define LINKS_DEBUG 1
*****/
/** Constructor */
LinksDialog::LinksDialog(QWidget *parent)
/** Constructor */
LinksDialog::LinksDialog(QWidget *parent)
: MainPage(parent)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
connect( ui.linkTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( linkTreeWidgetCostumPopupMenu( QPoint ) ) );
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
connect( ui.linkTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( linkTreeWidgetCostumPopupMenu( QPoint ) ) );
/* link combos */
@ -143,10 +144,10 @@ void LinksDialog::checkUpdate()
void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
voteupAct = new QAction(QIcon(IMAGE_EXPORTFRIEND), tr( "Share Link Anonymously" ), this );
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
voteupAct = new QAction(QIcon(IMAGE_EXPORTFRIEND), tr( "Share Link Anonymously" ), this );
connect( voteupAct , SIGNAL( triggered() ), this, SLOT( voteup_anon() ) );
@ -172,14 +173,14 @@ void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point )
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this);
connect(downloadAct, SIGNAL(triggered()), this, SLOT(downloadSelected()));
contextMnu.clear();
contextMnu.clear();
contextMnu.addAction(voteupAct);
contextMnu.addSeparator();
contextMnu.addMenu(voteMenu);
contextMnu.addSeparator();
contextMnu.addAction(downloadAct);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec( mevent->globalPos() );
}
void LinksDialog::changedSortRank( int index )
@ -411,30 +412,35 @@ void LinksDialog::updateLinks()
{
peerScore = "[+2] ";
child -> setIcon(0,(QIcon(IMAGE_GREAT)));
item -> setIcon(0,(QIcon(IMAGE_GREAT)));
//peerScore = "[+2 Great Link] ";
}
else if (cit->score == 1)
{
peerScore = "[+1] ";
child -> setIcon(0,(QIcon(IMAGE_GOOD)));
item -> setIcon(0,(QIcon(IMAGE_GOOD)));
//peerScore = "[+1 Good] ";
}
else if (cit->score == 0)
{
peerScore = "[+0] ";
child -> setIcon(0,(QIcon(IMAGE_OK)));
item -> setIcon(0,(QIcon(IMAGE_OK)));
//peerScore = "[+0 Okay] ";
}
else if (cit->score == -1)
{
peerScore = "[-1] ";
child -> setIcon(0,(QIcon(IMAGE_SUX)));
item -> setIcon(0,(QIcon(IMAGE_SUX)));
//peerScore = "[-1 Not Worth It] ";
}
else //if (cit->score < -1)
{
peerScore = "[-2 BAD] ";
child -> setIcon(0,(QIcon(IMAGE_BADLINK)));
item -> setIcon(0,(QIcon(IMAGE_BADLINK)));
//peerScore = "[-2 BAD Link] ";
}