added view functionality to can set root decorated or not decorated, people which dont wants a + for the tree.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1278 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-05-27 18:20:08 +00:00
parent 57f86fdb00
commit 0a0816cb77
2 changed files with 30 additions and 1 deletions

View File

@ -207,7 +207,17 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
clearcompletedAct = new QAction(QIcon(IMAGE_CLEARCOMPLETED), tr( "Clear Completed" ), this );
connect( clearcompletedAct , SIGNAL( triggered() ), this, SLOT( clearcompleted() ) );
rootisnotdecoratedAct = new QAction(QIcon(), tr( "Set Root is not Decorated" ), this );
connect( rootisnotdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootisnotdecorated() ) );
rootisdecoratedAct = new QAction(QIcon(), tr( "Set Root is Decorated" ), this );
connect( rootisdecoratedAct , SIGNAL( triggered() ), this, SLOT( rootdecorated() ) );
QMenu *viewMenu = new QMenu( tr("View"), this );
viewMenu->addAction(rootisnotdecoratedAct);
viewMenu->addAction(rootisdecoratedAct);
contextMnu.clear();
if (addPlayOption)
{
@ -221,7 +231,10 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
contextMnu.addAction( pastelinkAct);
contextMnu.addSeparator();
contextMnu.addAction( clearcompletedAct);
contextMnu.addSeparator();
contextMnu.addMenu( viewMenu);
contextMnu.exec( mevent->globalPos() );
}
void TransfersDialog::playSelectedTransfer()
@ -822,6 +835,17 @@ void TransfersDialog::clearcompleted()
rsFiles->FileClearCompleted();
}
void TransfersDialog::rootdecorated()
{
ui.downloadList->setRootIsDecorated(true);
}
void TransfersDialog::rootisnotdecorated()
{
ui.downloadList->setRootIsDecorated(false);
}
double TransfersDialog::getProgress(int row, QStandardItemModel *model)
{
return model->data(model->index(row, PROGRESS), Qt::DisplayRole).toDouble();

View File

@ -66,6 +66,9 @@ class TransfersDialog : public MainPage
void copyLink();
void pasteLink();
void rootdecorated();
void rootisnotdecorated();
signals:
void playFiles(QStringList files);
@ -94,6 +97,8 @@ class TransfersDialog : public MainPage
QAction* clearcompletedAct;
QAction* copylinkAct;
QAction* pastelinkAct;
QAction* rootisnotdecoratedAct;
QAction* rootisdecoratedAct;
QTreeView *downloadList;
@ -104,7 +109,7 @@ class TransfersDialog : public MainPage
Ui::TransfersDialog ui;
public slots:
int addItem(QString symbol, QString name, QString coreID, qlonglong size, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining);
int addItem(QString symbol, QString name, QString coreID, qlonglong size, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining);
bool addPeerToItem(int row, QString symbol, QString name, QString coreID, qlonglong fileSize, double progress, double dlspeed, QString sources, QString status, qlonglong completed, qlonglong remaining);
void delItem(int row);