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

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

View File

@ -67,6 +67,9 @@ class TransfersDialog : public MainPage
void copyLink(); void copyLink();
void pasteLink(); void pasteLink();
void rootdecorated();
void rootisnotdecorated();
signals: signals:
void playFiles(QStringList files); void playFiles(QStringList files);
@ -94,6 +97,8 @@ class TransfersDialog : public MainPage
QAction* clearcompletedAct; QAction* clearcompletedAct;
QAction* copylinkAct; QAction* copylinkAct;
QAction* pastelinkAct; QAction* pastelinkAct;
QAction* rootisnotdecoratedAct;
QAction* rootisdecoratedAct;
QTreeView *downloadList; QTreeView *downloadList;