author | llornkcor <llornkcor> | 2002-04-28 13:20:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-28 13:20:23 (UTC) |
commit | 495103fd36f52dad3a564b924326519c9f52ccaf (patch) (unidiff) | |
tree | 22a26ab944ee236c5df7cc2fe8f394fee7b91236 | |
parent | ee6fdf8783f7a2fa91792e2f0ce0f8350f8cac0d (diff) | |
download | opie-495103fd36f52dad3a564b924326519c9f52ccaf.zip opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.gz opie-495103fd36f52dad3a564b924326519c9f52ccaf.tar.bz2 |
added qpeDir icon, added ability to execute with 'open'
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 91 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 3 |
2 files changed, 69 insertions, 25 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( ) | |||
86 | 86 | ||
87 | qpeDirButton= new QPushButton(Resource::loadIconSet("go"),"",this,"QPEButton"); | ||
88 | qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); | ||
89 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); | ||
90 | qpeDirButton->setFlat(TRUE); | ||
91 | layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); | ||
92 | |||
87 | cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); | 93 | cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); |
@@ -90,3 +96,3 @@ AdvancedFm::AdvancedFm( ) | |||
90 | cfButton->setFlat(TRUE); | 96 | cfButton->setFlat(TRUE); |
91 | layout->addMultiCellWidget( cfButton , 0, 0, 2, 2); | 97 | layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); |
92 | 98 | ||
@@ -96,3 +102,3 @@ AdvancedFm::AdvancedFm( ) | |||
96 | sdButton->setFlat(TRUE); | 102 | sdButton->setFlat(TRUE); |
97 | layout->addMultiCellWidget( sdButton , 0, 0, 3, 3); | 103 | layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); |
98 | 104 | ||
@@ -102,3 +108,3 @@ AdvancedFm::AdvancedFm( ) | |||
102 | cdUpButton ->setFlat(TRUE); | 108 | cdUpButton ->setFlat(TRUE); |
103 | layout->addMultiCellWidget( cdUpButton , 0, 0, 4, 4); | 109 | layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); |
104 | 110 | ||
@@ -108,3 +114,3 @@ AdvancedFm::AdvancedFm( ) | |||
108 | docButton->setFlat(TRUE); | 114 | docButton->setFlat(TRUE); |
109 | layout->addMultiCellWidget( docButton, 0, 0, 5, 5); | 115 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6); |
110 | 116 | ||
@@ -114,3 +120,3 @@ AdvancedFm::AdvancedFm( ) | |||
114 | homeButton->setFlat(TRUE); | 120 | homeButton->setFlat(TRUE); |
115 | layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); | 121 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); |
116 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 122 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
@@ -137,3 +143,3 @@ AdvancedFm::AdvancedFm( ) | |||
137 | TabWidget = new QTabWidget( this, "TabWidget" ); | 143 | TabWidget = new QTabWidget( this, "TabWidget" ); |
138 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); | 144 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 7); |
139 | 145 | ||
@@ -215,3 +221,3 @@ AdvancedFm::AdvancedFm( ) | |||
215 | currentPathCombo->setEditable(TRUE); | 221 | currentPathCombo->setEditable(TRUE); |
216 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); | 222 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7); |
217 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 223 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
@@ -226,3 +232,3 @@ AdvancedFm::AdvancedFm( ) | |||
226 | 232 | ||
227 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); | 233 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 7); |
228 | 234 | ||
@@ -308,3 +314,2 @@ void AdvancedFm::populateLocalView() | |||
308 | item= new QListViewItem( Local_View, fileL, fileS , fileDate); | 314 | item= new QListViewItem( Local_View, fileL, fileS , fileDate); |
309 | |||
310 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 315 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
@@ -316,4 +321,11 @@ void AdvancedFm::populateLocalView() | |||
316 | } else { | 321 | } else { |
317 | if( !fi->isReadable() ) | 322 | if(fi->isExecutable()) { |
323 | pm = Resource::loadPixmap( "exec"); | ||
324 | item->setPixmap( 0,pm); | ||
325 | } | ||
326 | else if( !fi->isReadable() ) { | ||
318 | pm = Resource::loadPixmap( "locked" ); | 327 | pm = Resource::loadPixmap( "locked" ); |
328 | item->setPixmap( 0,pm); | ||
329 | |||
330 | } | ||
319 | else { | 331 | else { |
@@ -425,5 +437,10 @@ void AdvancedFm::populateRemoteView() | |||
425 | } else { | 437 | } else { |
426 | if( !fi->isReadable() ) | 438 | if(fi->isExecutable()) { |
439 | pm = Resource::loadPixmap( "exec"); | ||
440 | item->setPixmap( 0,pm); | ||
441 | } | ||
442 | else if( !fi->isReadable() ) { | ||
427 | pm = Resource::loadPixmap( "locked" ); | 443 | pm = Resource::loadPixmap( "locked" ); |
428 | else { | 444 | item->setPixmap( 0,pm); |
445 | } else { | ||
429 | MimeType mt(fi->filePath()); | 446 | MimeType mt(fi->filePath()); |
@@ -700,9 +717,15 @@ void AdvancedFm::runThis() { | |||
700 | QString curFile = Local_View->currentItem()->text(0); | 717 | QString curFile = Local_View->currentItem()->text(0); |
701 | curFile = currentDir.canonicalPath()+"/"+curFile; | 718 | QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile); |
702 | DocLnk nf(curFile); | 719 | if(fileInfo.isExecutable()) { |
703 | QString execStr = nf.exec(); | 720 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
704 | qDebug( execStr); | 721 | e << curFile; |
705 | if( execStr.isEmpty() ) { | ||
706 | } else { | 722 | } else { |
707 | nf.execute(); | 723 | curFile = currentDir.canonicalPath()+"/"+curFile; |
724 | DocLnk nf(curFile); | ||
725 | QString execStr = nf.exec(); | ||
726 | qDebug( execStr); | ||
727 | if( execStr.isEmpty() ) { | ||
728 | } else { | ||
729 | nf.execute(); | ||
730 | } | ||
708 | } | 731 | } |
@@ -711,9 +734,15 @@ void AdvancedFm::runThis() { | |||
711 | QString curFile = Remote_View->currentItem()->text(0); | 734 | QString curFile = Remote_View->currentItem()->text(0); |
712 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; | 735 | QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+curFile); |
713 | DocLnk nf(curFile); | 736 | if(fileInfo.isExecutable()) { |
714 | QString execStr = nf.exec(); | 737 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
715 | qDebug(execStr); | 738 | e << curFile; |
716 | if( execStr.isEmpty() ) { | ||
717 | } else { | 739 | } else { |
718 | nf.execute(); | 740 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; |
741 | DocLnk nf(curFile); | ||
742 | QString execStr = nf.exec(); | ||
743 | qDebug(execStr); | ||
744 | if( execStr.isEmpty() ) { | ||
745 | } else { | ||
746 | nf.execute(); | ||
747 | } | ||
719 | } | 748 | } |
@@ -1480 +1509,15 @@ void AdvancedFm::mkSym() { | |||
1480 | } | 1509 | } |
1510 | |||
1511 | void AdvancedFm::QPEButtonPushed() { | ||
1512 | QString current = QPEApplication::qpeDir(); | ||
1513 | chdir( current.latin1() ); | ||
1514 | if (TabWidget->currentPageIndex() == 0) { | ||
1515 | currentDir.cd( current, TRUE); | ||
1516 | populateLocalView(); | ||
1517 | } else { | ||
1518 | currentRemoteDir.cd( current, TRUE); | ||
1519 | populateRemoteView(); | ||
1520 | } | ||
1521 | update(); | ||
1522 | |||
1523 | } | ||
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: | |||
54 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; | 54 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; |
55 | QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton; | 55 | QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
56 | QDir currentDir, currentRemoteDir; | 56 | QDir currentDir, currentRemoteDir; |
@@ -110,2 +110,3 @@ protected slots: | |||
110 | void CFButtonPushed(); | 110 | void CFButtonPushed(); |
111 | void QPEButtonPushed(); | ||
111 | void upDir(); | 112 | void upDir(); |