mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
Merge pull request #1192 from PhenomRetroShare/Add_WarningMaxFlatViewFile
Add a warning in ToolTip if Max files reach in flat view mode Dir Tree.
This commit is contained in:
commit
b587ac8835
4 changed files with 30 additions and 3 deletions
|
@ -163,6 +163,7 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
|||
|
||||
tree_model = _tree_model ;
|
||||
flat_model = _flat_model ;
|
||||
connect(flat_model, SIGNAL(layoutChanged()), this, SLOT(updateDirTreeView()) );
|
||||
|
||||
tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this);
|
||||
tree_proxyModel->setSourceModel(tree_model);
|
||||
|
@ -1325,6 +1326,21 @@ void SharedFilesDialog::startFilter()
|
|||
FilterItems();
|
||||
}
|
||||
|
||||
void SharedFilesDialog::updateDirTreeView()
|
||||
{
|
||||
if (model == flat_model)
|
||||
{
|
||||
size_t maxSize = 0;
|
||||
FlatStyle_RDM* flat = dynamic_cast<FlatStyle_RDM*>(flat_model);
|
||||
if (flat && flat->isMaxRefsTableSize(&maxSize))
|
||||
{
|
||||
ui.dirTreeView->setToolTip(tr("Warning: You reach max (%1) files in flat list. No more will be added.").arg(maxSize));
|
||||
return;
|
||||
}
|
||||
}
|
||||
ui.dirTreeView->setToolTip("");
|
||||
}
|
||||
|
||||
// This macro make the search expand all items that contain the searched text.
|
||||
// A bug however, makes RS expand everything when nothing is selected, which is a pain.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue