author | llornkcor <llornkcor> | 2002-03-20 00:50:29 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-20 00:50:29 (UTC) |
commit | 090ac02da739600c577ed6396e04ed0e121f7890 (patch) (side-by-side diff) | |
tree | b994655686701aa5482e98a455141eb1757cc952 | |
parent | 5f6144b48cac5cc058ee06461e865ce03cda00f1 (diff) | |
download | opie-090ac02da739600c577ed6396e04ed0e121f7890.zip opie-090ac02da739600c577ed6396e04ed0e121f7890.tar.gz opie-090ac02da739600c577ed6396e04ed0e121f7890.tar.bz2 |
added hidden file option.
-rw-r--r-- | noncore/unsupported/filebrowser/filebrowser.cpp | 39 | ||||
-rw-r--r-- | noncore/unsupported/filebrowser/filebrowser.h | 6 |
2 files changed, 39 insertions, 6 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp index 41e7634..d9aabfd 100644 --- a/noncore/unsupported/filebrowser/filebrowser.cpp +++ b/noncore/unsupported/filebrowser/filebrowser.cpp @@ -178,2 +178,4 @@ FileView::FileView( const QString & dir, QWidget * parent, + showingHidden=FALSE; + setMultiSelection( TRUE ); @@ -208,2 +210,5 @@ void FileView::updateDir() { + setCaption( "Boogie on boogieboy"); + //qDebug("Caption should be "+currentDir); + generateDir( currentDir ); @@ -230,5 +235,9 @@ void FileView::generateDir( const QString & dir ) + if( !showingHidden) d.setFilter( QDir::Dirs | QDir::Files ); - d.setSorting( QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | - QDir::Reversed ); + else + d.setFilter( QDir::Dirs | QDir::Files |QDir::Hidden | QDir::All); + + d.setSorting( QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed ); + @@ -240,3 +249,3 @@ void FileView::generateDir( const QString & dir ) while( (fi = it.current()) ){ - if( (fi->fileName() == ".") || (fi->fileName() == "..") ){ + if( (fi->fileName() == ".") || (fi->fileName() == "..") ){ ++it; @@ -247,3 +256,2 @@ void FileView::generateDir( const QString & dir ) } - emit dirChanged(); @@ -657,2 +665,3 @@ void FileView::showFileMenu() m->insertItem( Resource::loadPixmap("copy"), + tr( "Copy" ), this, SLOT( copy() ) ); @@ -661,3 +670,3 @@ void FileView::showFileMenu() m->insertItem( tr( "Change Permissions" ), this, SLOT( chPerm() ) ); - m->insertItem( tr( "Delete" ), this, SLOT( del() ) ); + m->insertItem(Resource::loadPixmap( "close" ), tr( "Delete" ), this, SLOT( del() ) ); m->insertSeparator(); @@ -713,2 +722,6 @@ void FileBrowser::init(const QString & dir) sortMenu->insertItem( tr( "Ascending" ), this, SLOT( updateSorting() ) ); + sortMenu->insertSeparator(); + sortMenu->insertItem( tr( "Show Hidden "), this, SLOT( showHidden() ) ); + fileView->showingHidden=FALSE; + sortMenu->setItemChecked( sortMenu->idAt( 5 ), TRUE ); @@ -749,2 +762,3 @@ void FileBrowser::init(const QString & dir) +// dirLabel = new QLabel(this, "DirLabel"); @@ -766,2 +780,6 @@ void FileBrowser::pcmciaMessage( const QCString &msg, const QByteArray &) +void FileBrowser::changeCaption(const QString & dir) { + setCaption( dir); +} + void FileBrowser::dirSelected( int id ) @@ -856,2 +874,13 @@ void FileBrowser::updateSorting() +void FileBrowser::showHidden() { + if(! fileView->showingHidden) { + fileView->showingHidden=TRUE; + sortMenu->setItemChecked( sortMenu->idAt( 7),TRUE); + } else { + fileView->showingHidden=FALSE; + sortMenu->setItemChecked( sortMenu->idAt( 7),FALSE); + } + fileView->updateDir(); +} + void FileView::chPerm() { diff --git a/noncore/unsupported/filebrowser/filebrowser.h b/noncore/unsupported/filebrowser/filebrowser.h index c214dbe..54856a0 100644 --- a/noncore/unsupported/filebrowser/filebrowser.h +++ b/noncore/unsupported/filebrowser/filebrowser.h @@ -28,3 +28,3 @@ #include <qstringlist.h> - +class QLabel; class InlineEdit; @@ -60,2 +60,3 @@ public: QStringList history() const { return dirHistory; } + bool showingHidden; @@ -116,2 +117,4 @@ public: const char * name = 0, WFlags f = 0 ); +public slots: + void changeCaption(const QString &); private: @@ -138,2 +141,3 @@ private slots: void dirSelected( int id ); + void showHidden(); }; |