Diffstat (limited to 'noncore/unsupported/filebrowser/filebrowser.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/filebrowser/filebrowser.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp index 9439bb8..384d7da 100644 --- a/noncore/unsupported/filebrowser/filebrowser.cpp +++ b/noncore/unsupported/filebrowser/filebrowser.cpp @@ -19,9 +19,9 @@ **********************************************************************/ #include "inlineedit.h" #include "filebrowser.h" - +#include "filePermissions.h" #include <qpe/resource.h> #include <qpe/global.h> #include <qpe/mimetype.h> #include <qpe/applnk.h> @@ -653,8 +653,9 @@ void FileView::showFileMenu() m->insertItem( Resource::loadPixmap("copy"), tr( "Copy" ), this, SLOT( copy() ) ); m->insertItem( Resource::loadPixmap("paste"), tr( "Paste" ), this, SLOT( paste() ) ); + m->insertItem( tr( "change permissions" ), this, SLOT( chPerm() ) ); m->insertItem( tr( "Delete" ), this, SLOT( del() ) ); m->insertSeparator(); m->insertItem( tr( "Select all" ), this, SLOT( selectAll() ) ); m->insertItem( tr( "Deselect all" ), this, SLOT( deselectAll() ) ); @@ -847,4 +848,33 @@ void FileBrowser::updateSorting() sortDate(); else sortType(); } + +void FileView::chPerm() { + FileItem * i; + QStringList fl; + QString cmd; + int err; + + if((i = (FileItem *) firstChild()) == 0) return; + + while( i ){ + if( i->isSelected() ){ + fl += i->getFilePath(); + } + i = (FileItem *) i->nextSibling(); + } + if( fl.count() < 1 ) return; + if( QMessageBox::warning( this, tr("Change permissions"), tr("Are you sure?"), + tr("Yes"), tr("No") ) == 0) { + for ( QStringList::Iterator it = fl.begin(); it != fl.end(); ++it ) { + filePermissions *filePerm; + filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(*it)); + filePerm->exec(); + if( filePerm) + delete filePerm; + break; + } + updateDir(); + } +} |