Add expand all/collapse all on download list (Patch from Phenom)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6485 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-07-06 15:48:40 +00:00
parent dc29793da6
commit 71413bc325
3 changed files with 35 additions and 0 deletions

View file

@ -86,6 +86,8 @@
#define IMAGE_PRIORITYHIGH ":/images/priorityhigh.png"
#define IMAGE_PRIORITYAUTO ":/images/priorityauto.png"
#define IMAGE_SEARCH ":/images/filefind.png"
#define IMAGE_EXPAND ":/images/edit_add24.png"
#define IMAGE_COLLAPSE ":/images/edit_remove24.png"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -414,6 +416,10 @@ TransfersDialog::TransfersDialog(QWidget *parent)
connect(renameFileAct, SIGNAL(triggered()), this, SLOT(renameFile()));
specifyDestinationDirectoryAct = new QAction(QIcon(IMAGE_SEARCH),tr("Specify..."),this) ;
connect(specifyDestinationDirectoryAct,SIGNAL(triggered()),this,SLOT(chooseDestinationDirectory())) ;
expandAllAct= new QAction(QIcon(IMAGE_EXPAND),tr("Expand all"),this);
connect(expandAllAct,SIGNAL(triggered()),this,SLOT(expandAll())) ;
collapseAllAct= new QAction(QIcon(IMAGE_COLLAPSE),tr("Collapse all"),this);
connect(collapseAllAct,SIGNAL(triggered()),this,SLOT(collapseAll())) ;
// load settings
processSettings(true);
@ -678,6 +684,13 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
contextMnu.addSeparator();
if (DLListModel->rowCount()>0 ) {
contextMnu.addAction( expandAllAct ) ;
contextMnu.addAction( collapseAllAct ) ;
}
contextMnu.addSeparator();//-----------------------------------------------
contextMnu.addAction( toggleShowCacheTransfersAct ) ;
toggleShowCacheTransfersAct->setChecked(_show_cache_transfers) ;
contextMnu.addAction( openCollectionAct ) ;
@ -1756,3 +1769,12 @@ void TransfersDialog::openCollection()
Collection.downloadFiles();
}
}
void TransfersDialog::expandAll()
{
ui.downloadList->expandAll();
}
void TransfersDialog::collapseAll()
{
ui.downloadList->collapseAll();
}