mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-20 21:04:50 -04:00
fixed minor bugs in previous commit
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ImprovedGUI@6109 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
174226eb21
commit
abfa8195a4
2 changed files with 64 additions and 20 deletions
|
@ -157,10 +157,6 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
||||||
|
|
||||||
header->setStretchLastSection(false);
|
header->setStretchLastSection(false);
|
||||||
|
|
||||||
// Setup the current view model.
|
|
||||||
//
|
|
||||||
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
|
||||||
|
|
||||||
/* Set Multi Selection */
|
/* Set Multi Selection */
|
||||||
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
|
@ -196,6 +192,10 @@ LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
// Setup the current view model.
|
||||||
|
//
|
||||||
|
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||||
|
@ -209,6 +209,10 @@ RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
// Setup the current view model.
|
||||||
|
//
|
||||||
|
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::hideEvent(QHideEvent *)
|
void SharedFilesDialog::hideEvent(QHideEvent *)
|
||||||
|
@ -305,31 +309,19 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
||||||
if(model!=NULL)
|
if(model!=NULL)
|
||||||
model->setVisible(false) ;
|
model->setVisible(false) ;
|
||||||
|
|
||||||
if(c == 0)
|
if(c==0)
|
||||||
{
|
{
|
||||||
model = tree_model ;
|
model = tree_model ;
|
||||||
proxyModel = tree_proxyModel ;
|
proxyModel = tree_proxyModel ;
|
||||||
ui.dirTreeView->setColumnHidden(3,true) ;
|
|
||||||
ui.dirTreeView->setColumnHidden(4,true) ;
|
|
||||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
|
||||||
ui.filterLabel->hide();
|
|
||||||
ui.filterPatternLineEdit->hide();
|
|
||||||
ui.filterStartButton->hide();
|
|
||||||
ui.filterClearButton->hide();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
model = flat_model ;
|
model = flat_model ;
|
||||||
proxyModel = flat_proxyModel ;
|
proxyModel = flat_proxyModel ;
|
||||||
ui.dirTreeView->setColumnHidden(3,false) ;
|
|
||||||
ui.dirTreeView->setColumnHidden(4,false) ;
|
|
||||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
|
||||||
ui.filterLabel->show();
|
|
||||||
ui.filterPatternLineEdit->show();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showProperColumns() ;
|
||||||
|
|
||||||
if(isVisible())
|
if(isVisible())
|
||||||
{
|
{
|
||||||
model->setVisible(true) ;
|
model->setVisible(true) ;
|
||||||
|
@ -350,6 +342,53 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
||||||
FilterItems();
|
FilterItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocalSharedFilesDialog::showProperColumns()
|
||||||
|
{
|
||||||
|
if(model == tree_model)
|
||||||
|
{
|
||||||
|
ui.dirTreeView->setColumnHidden(3,false) ;
|
||||||
|
ui.dirTreeView->setColumnHidden(4,false) ;
|
||||||
|
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||||
|
ui.filterLabel->hide();
|
||||||
|
ui.filterPatternLineEdit->hide();
|
||||||
|
ui.filterStartButton->hide();
|
||||||
|
ui.filterClearButton->hide();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.dirTreeView->setColumnHidden(3,true) ;
|
||||||
|
ui.dirTreeView->setColumnHidden(4,false) ;
|
||||||
|
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||||
|
ui.filterLabel->show();
|
||||||
|
ui.filterPatternLineEdit->show();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void RemoteSharedFilesDialog::showProperColumns()
|
||||||
|
{
|
||||||
|
if(model == tree_model)
|
||||||
|
{
|
||||||
|
ui.dirTreeView->setColumnHidden(3,true) ;
|
||||||
|
ui.dirTreeView->setColumnHidden(4,true) ;
|
||||||
|
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||||
|
ui.filterLabel->hide();
|
||||||
|
ui.filterPatternLineEdit->hide();
|
||||||
|
ui.filterStartButton->hide();
|
||||||
|
ui.filterClearButton->hide();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.dirTreeView->setColumnHidden(3,false) ;
|
||||||
|
ui.dirTreeView->setColumnHidden(4,false) ;
|
||||||
|
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||||
|
ui.filterLabel->show();
|
||||||
|
ui.filterPatternLineEdit->show();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LocalSharedFilesDialog::checkUpdate()
|
void LocalSharedFilesDialog::checkUpdate()
|
||||||
{
|
{
|
||||||
/* update */
|
/* update */
|
||||||
|
|
|
@ -44,9 +44,12 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QTreeView *directoryView() ;
|
QTreeView *directoryView() ;
|
||||||
|
virtual void showProperColumns() = 0 ;
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
virtual void spawnCustomPopupMenu(QPoint point) = 0;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
virtual void spawnCustomPopupMenu(QPoint point) = 0;
|
|
||||||
|
|
||||||
/* For handling the model updates */
|
/* For handling the model updates */
|
||||||
void preModDirectories() ;
|
void preModDirectories() ;
|
||||||
|
@ -143,6 +146,7 @@ class LocalSharedFilesDialog : public SharedFilesDialog
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void processSettings(bool bLoad) ;
|
virtual void processSettings(bool bLoad) ;
|
||||||
|
virtual void showProperColumns() ;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void createCollectionFile();
|
void createCollectionFile();
|
||||||
|
@ -169,6 +173,7 @@ class RemoteSharedFilesDialog : public SharedFilesDialog
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void processSettings(bool bLoad) ;
|
virtual void processSettings(bool bLoad) ;
|
||||||
|
virtual void showProperColumns() ;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void downloadRemoteSelected();
|
void downloadRemoteSelected();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue