-rw-r--r-- | library/fileselector.cpp | 20 | ||||
-rw-r--r-- | library/fileselector.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/library/fileselector.cpp b/library/fileselector.cpp index 382012f..7ff09b4 100644 --- a/library/fileselector.cpp +++ b/library/fileselector.cpp @@ -315,16 +315,17 @@ FileSelector::FileSelector( const QString &f, QWidget *parent, const char *name, connect( view, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint &, int ) ), this, SLOT( fileClicked( int, QListViewItem *, const QPoint &, int ) ) ); connect( view, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint &, int ) ), this, SLOT( filePressed( int, QListViewItem *, const QPoint &, int ) ) ); connect( view, SIGNAL( returnPressed( QListViewItem * ) ), this, SLOT( fileClicked( QListViewItem * ) ) ); QHBox *hb = new QHBox( this ); + d->typeCombo = new TypeCombo( hb ); connect( d->typeCombo, SIGNAL(selected(const QString&)), this, SLOT(typeSelected(const QString&)) ); QWhatsThis::add( d->typeCombo, tr("Show documents of this type") ); Categories c; c.load(categoryFileName()); QArray<int> vl( 0 ); @@ -491,16 +492,35 @@ void FileSelector::setCloseVisible( bool b ) { if ( b ) d->toolbar->show(); else d->toolbar->hide(); } /*! + +*/ +void FileSelector::setTypeComboVisible( bool b ) { + if ( b ) + d->typeCombo->show(); + else + d->typeCombo->hide(); +} +/*! + +*/ +void FileSelector::setCategorySelectVisible( bool b ) { + if ( b ) + d->catSelect->show(); + else + d->catSelect->hide(); +} + +/*! Rereads the list of documents. */ void FileSelector::reread() { d->files.clear(); Global::findDocuments(&d->files, filter); d->typeCombo->reread( d->files, filter ); updateView(); diff --git a/library/fileselector.h b/library/fileselector.h index f1c9eb1..e3ae891 100644 --- a/library/fileselector.h +++ b/library/fileselector.h @@ -49,16 +49,18 @@ class FileSelector : public QVBox { Q_OBJECT public: FileSelector( const QString &mimefilter, QWidget *parent, const char *name=0, bool newVisible = TRUE, bool closeVisible = TRUE ); ~FileSelector(); void setNewVisible( bool b ); void setCloseVisible( bool b ); + void setTypeComboVisible( bool b = TRUE ); + void setCategorySelectVisible( bool b = TRUE ); void reread(); int fileCount(); DocLnk selectedDocument() const { const DocLnk* rp = ((FileSelector*)this)->selected(); if (!rp) { DocLnk r; return r; |