mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
Fixed Q_ASSERT in SharedFilesDialog on Windows.
Load and save the view type (flat or tree) in SharedFilesDialog. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4127 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
85aad4c75b
commit
c21e13e68d
@ -115,7 +115,6 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
||||
this, SLOT( checkForRemoteDirRequest( QTreeWidgetItem * ) ) );
|
||||
*/
|
||||
|
||||
|
||||
tree_model = new TreeStyle_RDM(true);
|
||||
flat_model = new FlatStyle_RDM(true);
|
||||
|
||||
@ -155,13 +154,6 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
||||
connect(ui.filterPatternLineEdit, SIGNAL(returnPressed()), this, SLOT(startFilter()));
|
||||
connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged()));
|
||||
|
||||
// load settings
|
||||
processSettings(true);
|
||||
|
||||
ui.remoteDirTreeView->setColumnHidden(3,false) ;
|
||||
ui.remoteDirTreeView->setColumnHidden(4,true) ;
|
||||
ui.localDirTreeView->setColumnHidden(4,true) ;
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * l_header = ui.localDirTreeView->header () ;
|
||||
// l_header->setResizeMode (0, QHeaderView::Interactive);
|
||||
@ -176,29 +168,32 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
||||
l_header->resizeSection ( 3, 100 );
|
||||
// l_header->resizeSection ( 4, 100 );
|
||||
|
||||
l_header->setStretchLastSection(false);
|
||||
// l_header->setHighlightSections(false);
|
||||
|
||||
// Setup the current view model.
|
||||
//
|
||||
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * r_header = ui.remoteDirTreeView->header () ;
|
||||
|
||||
r_header->setResizeMode (0, QHeaderView::Interactive);
|
||||
r_header->setStretchLastSection(false);
|
||||
l_header->setStretchLastSection(false);
|
||||
|
||||
// r_header->setResizeMode (1, QHeaderView::Fixed);
|
||||
// // r_header->setResizeMode (2, QHeaderView::Interactive);
|
||||
// r_header->setResizeMode (3, QHeaderView::Fixed);
|
||||
// // r_header->setResizeMode (4, QHeaderView::Interactive);
|
||||
|
||||
|
||||
r_header->resizeSection ( 0, 490 );
|
||||
r_header->resizeSection ( 1, 70 );
|
||||
r_header->resizeSection ( 2, 80 );
|
||||
r_header->resizeSection ( 3, 100 );
|
||||
r_header->resizeSection ( 4, 80 );
|
||||
|
||||
// l_header->setHighlightSections(false);
|
||||
// r_header->setHighlightSections(false);
|
||||
|
||||
|
||||
/* Set Multi Selection */
|
||||
ui.remoteDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
ui.localDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
@ -208,9 +203,13 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
|
||||
// ui.filterPatternLineEdit->hide();
|
||||
//#endif
|
||||
|
||||
// Setup the current view model.
|
||||
//
|
||||
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
||||
// load settings
|
||||
processSettings(true);
|
||||
|
||||
// Hide columns after loading the settings
|
||||
ui.remoteDirTreeView->setColumnHidden(3,false) ;
|
||||
ui.remoteDirTreeView->setColumnHidden(4,true) ;
|
||||
ui.localDirTreeView->setColumnHidden(4,true) ;
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
@ -255,6 +254,9 @@ void SharedFilesDialog::processSettings(bool bLoad)
|
||||
|
||||
// state of splitter
|
||||
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
||||
|
||||
// view type
|
||||
ui.viewType_CB->setCurrentIndex(Settings->value("ViewType").toInt());
|
||||
} else {
|
||||
// save settings
|
||||
|
||||
@ -264,6 +266,9 @@ void SharedFilesDialog::processSettings(bool bLoad)
|
||||
|
||||
// state of splitter
|
||||
Settings->setValue("Splitter", ui.splitter->saveState());
|
||||
|
||||
// view type
|
||||
Settings->setValue("ViewType", ui.viewType_CB->currentIndex());
|
||||
}
|
||||
|
||||
Settings->endGroup();
|
||||
|
Loading…
Reference in New Issue
Block a user