summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-28 13:20:23 (UTC)
committer llornkcor <llornkcor>2002-04-28 13:20:23 (UTC)
commit495103fd36f52dad3a564b924326519c9f52ccaf (patch) (side-by-side diff)
tree22a26ab944ee236c5df7cc2fe8f394fee7b91236
parentee6fdf8783f7a2fa91792e2f0ce0f8350f8cac0d (diff)
downloadopie-495103fd36f52dad3a564b924326519c9f52ccaf.zip
opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.gz
opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.bz2
added qpeDir icon, added ability to execute with 'open'
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp67
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
2 files changed, 57 insertions, 13 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index bb932c5..ab31c91 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -86,2 +86,8 @@ AdvancedFm::AdvancedFm( )
+ qpeDirButton= new QPushButton(Resource::loadIconSet("go"),"",this,"QPEButton");
+ qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
+ connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
+ qpeDirButton->setFlat(TRUE);
+ layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
+
cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
@@ -90,3 +96,3 @@ AdvancedFm::AdvancedFm( )
cfButton->setFlat(TRUE);
- layout->addMultiCellWidget( cfButton , 0, 0, 2, 2);
+ layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
@@ -96,3 +102,3 @@ AdvancedFm::AdvancedFm( )
sdButton->setFlat(TRUE);
- layout->addMultiCellWidget( sdButton , 0, 0, 3, 3);
+ layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
@@ -102,3 +108,3 @@ AdvancedFm::AdvancedFm( )
cdUpButton ->setFlat(TRUE);
- layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4);
+ layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
@@ -108,3 +114,3 @@ AdvancedFm::AdvancedFm( )
docButton->setFlat(TRUE);
- layout->addMultiCellWidget( docButton, 0, 0, 5, 5);
+ layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
@@ -114,3 +120,3 @@ AdvancedFm::AdvancedFm( )
homeButton->setFlat(TRUE);
- layout->addMultiCellWidget( homeButton, 0, 0, 6, 6);
+ layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
@@ -137,3 +143,3 @@ AdvancedFm::AdvancedFm( )
TabWidget = new QTabWidget( this, "TabWidget" );
- layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6);
+ layout->addMultiCellWidget( TabWidget, 1, 1, 0, 7);
@@ -215,3 +221,3 @@ AdvancedFm::AdvancedFm( )
currentPathCombo->setEditable(TRUE);
- layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6);
+ layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
@@ -226,3 +232,3 @@ AdvancedFm::AdvancedFm( )
- layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6);
+ layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7);
@@ -308,3 +314,2 @@ void AdvancedFm::populateLocalView()
item= new QListViewItem( Local_View, fileL, fileS , fileDate);
-
if(isDir || fileL.find("/",0,TRUE) != -1) {
@@ -316,4 +321,11 @@ void AdvancedFm::populateLocalView()
} else {
- if( !fi->isReadable() )
+ if(fi->isExecutable()) {
+ pm = Resource::loadPixmap( "exec");
+ item->setPixmap( 0,pm);
+ }
+ else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
+ item->setPixmap( 0,pm);
+
+ }
else {
@@ -425,5 +437,10 @@ void AdvancedFm::populateRemoteView()
} else {
- if( !fi->isReadable() )
+ if(fi->isExecutable()) {
+ pm = Resource::loadPixmap( "exec");
+ item->setPixmap( 0,pm);
+ }
+ else if( !fi->isReadable() ) {
pm = Resource::loadPixmap( "locked" );
- else {
+ item->setPixmap( 0,pm);
+ } else {
MimeType mt(fi->filePath());
@@ -700,2 +717,7 @@ void AdvancedFm::runThis() {
QString curFile = Local_View->currentItem()->text(0);
+ QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile);
+ if(fileInfo.isExecutable()) {
+ QCopEnvelope e("QPE/System", "execute(QString)" );
+ e << curFile;
+ } else {
curFile = currentDir.canonicalPath()+"/"+curFile;
@@ -708,2 +730,3 @@ void AdvancedFm::runThis() {
}
+ }
// MimeType mt( curFile);
@@ -711,2 +734,7 @@ void AdvancedFm::runThis() {
QString curFile = Remote_View->currentItem()->text(0);
+ QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile);
+ if(fileInfo.isExecutable()) {
+ QCopEnvelope e("QPE/System", "execute(QString)" );
+ e << curFile;
+ } else {
curFile = currentRemoteDir.canonicalPath()+"/"+curFile;
@@ -719,2 +747,3 @@ void AdvancedFm::runThis() {
}
+ }
// MimeType mt( curFile);
@@ -1480 +1509,15 @@ void AdvancedFm::mkSym() {
}
+
+void AdvancedFm::QPEButtonPushed() {
+ QString current = QPEApplication::qpeDir();
+ chdir( current.latin1() );
+ if (TabWidget->currentPageIndex() == 0) {
+ currentDir.cd( current, TRUE);
+ populateLocalView();
+ } else {
+ currentRemoteDir.cd( current, TRUE);
+ populateRemoteView();
+ }
+ update();
+
+}
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index c00713f..5c2719e 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -54,3 +54,3 @@ public:
QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
- QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton;
+ QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
QDir currentDir, currentRemoteDir;
@@ -110,2 +110,3 @@ protected slots:
void CFButtonPushed();
+ void QPEButtonPushed();
void upDir();