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

View File

@ -90,6 +90,9 @@ private slots:
void setDestinationDirectory(); void setDestinationDirectory();
void chooseDestinationDirectory(); void chooseDestinationDirectory();
void expandAll();
void collapseAll();
// void rootdecorated(); // void rootdecorated();
// void rootisnotdecorated(); // void rootisnotdecorated();
@ -174,6 +177,8 @@ private:
QAction *openCollectionAct; QAction *openCollectionAct;
QAction *renameFileAct; QAction *renameFileAct;
QAction *specifyDestinationDirectoryAct; QAction *specifyDestinationDirectoryAct;
QAction *expandAllAct;
QAction *collapseAllAct;
bool m_bProcessSettings; bool m_bProcessSettings;
void processSettings(bool bLoad); void processSettings(bool bLoad);

View File

@ -12794,6 +12794,14 @@ Try to be patient!</source>
<source>File Never Seen</source> <source>File Never Seen</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Expand all</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Collapse all</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>TreeStyle_RDM</name> <name>TreeStyle_RDM</name>