summaryrefslogtreecommitdiff
path: root/noncore/apps
Unidiff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp137
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro2
2 files changed, 84 insertions, 55 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index a000e9b..ebd7fc3 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -8,24 +8,28 @@
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties 13#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
14 14
15#include "advancedfm.h" 15#include "advancedfm.h"
16#include "inputDialog.h" 16#include "inputDialog.h"
17#include "filePermissions.h" 17#include "filePermissions.h"
18#include "output.h" 18#include "output.h"
19 19
20#include <opie/ofileselector.h>
21#include <opie/ofiledialog.h>
22
23
20#include <qpe/lnkproperties.h> 24#include <qpe/lnkproperties.h>
21#include <qpe/filemanager.h> 25#include <qpe/filemanager.h>
22#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
23#include <qpe/qpemenubar.h> 27#include <qpe/qpemenubar.h>
24#include <qpe/qpetoolbar.h> 28#include <qpe/qpetoolbar.h>
25#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
26#include <qpe/resource.h> 30#include <qpe/resource.h>
27#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
28#include <qpe/config.h> 32#include <qpe/config.h>
29#include <qpe/mimetype.h> 33#include <qpe/mimetype.h>
30#include <qpe/applnk.h> 34#include <qpe/applnk.h>
31#include <qpe/ir.h> 35#include <qpe/ir.h>
@@ -80,25 +84,25 @@ AdvancedFm::AdvancedFm( )
80 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 84 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
81 85
82 QPEMenuBar *menuBar = new QPEMenuBar(this); 86 QPEMenuBar *menuBar = new QPEMenuBar(this);
83// fileMenu = new QPopupMenu( this ); 87// fileMenu = new QPopupMenu( this );
84 fileMenu = new QPopupMenu( this ); 88 fileMenu = new QPopupMenu( this );
85 viewMenu = new QPopupMenu( this ); 89 viewMenu = new QPopupMenu( this );
86 90
87 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); 91 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 );
88 92
89 menuBar->insertItem( tr( "File" ), fileMenu); 93 menuBar->insertItem( tr( "File" ), fileMenu);
90 menuBar->insertItem( tr( "View" ), viewMenu); 94 menuBar->insertItem( tr( "View" ), viewMenu);
91 95
92 qpeDirButton= new QPushButton(Resource::loadIconSet("go"),"",this,"QPEButton"); 96 qpeDirButton= new QPushButton(Resource::loadIconSet("launcher/opielogo16x16"),"",this,"QPEButton");
93 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 97 qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
94 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); 98 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
95 qpeDirButton->setFlat(TRUE); 99 qpeDirButton->setFlat(TRUE);
96 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); 100 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
97 101
98 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); 102 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
99 cfButton ->setFixedSize( QSize( 20, 20 ) ); 103 cfButton ->setFixedSize( QSize( 20, 20 ) );
100 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); 104 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) );
101 cfButton->setFlat(TRUE); 105 cfButton->setFlat(TRUE);
102 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); 106 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
103 107
104 sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton"); 108 sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton");
@@ -182,24 +186,25 @@ AdvancedFm::AdvancedFm( )
182 Local_View->setSelectionMode(QListView::Extended); 186 Local_View->setSelectionMode(QListView::Extended);
183 187
184 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 188 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
185 189
186 190
187 191
188 tabLayout->addWidget( Local_View, 0, 0 ); 192 tabLayout->addWidget( Local_View, 0, 0 );
189 193
190 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 194 connect( Local_View, SIGNAL( clicked( QListViewItem*)),
191 this,SLOT( localListClicked(QListViewItem *)) ); 195 this,SLOT( localListClicked(QListViewItem *)) );
192 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 196 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
193 this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); 197 this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) );
198
194 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); 199 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
195 200
196 TabWidget->insertTab( tab, tr("1")); 201 TabWidget->insertTab( tab, tr("1"));
197 202
198 tab_2 = new QWidget( TabWidget, "tab_2" ); 203 tab_2 = new QWidget( TabWidget, "tab_2" );
199 tabLayout_2 = new QGridLayout( tab_2 ); 204 tabLayout_2 = new QGridLayout( tab_2 );
200 tabLayout_2->setSpacing( 2); 205 tabLayout_2->setSpacing( 2);
201 tabLayout_2->setMargin( 2); 206 tabLayout_2->setMargin( 2);
202 207
203 Remote_View = new QListView( tab_2, "Remote_View" ); 208 Remote_View = new QListView( tab_2, "Remote_View" );
204 Remote_View->addColumn( tr("File"),130); 209 Remote_View->addColumn( tr("File"),130);
205 Remote_View->addColumn( tr("Size"),-1); 210 Remote_View->addColumn( tr("Size"),-1);
@@ -207,59 +212,73 @@ AdvancedFm::AdvancedFm( )
207 Remote_View->addColumn( tr("Date"),-1); 212 Remote_View->addColumn( tr("Date"),-1);
208 Remote_View->setColumnAlignment(2,QListView::AlignRight); 213 Remote_View->setColumnAlignment(2,QListView::AlignRight);
209 Remote_View->setAllColumnsShowFocus(TRUE); 214 Remote_View->setAllColumnsShowFocus(TRUE);
210 Remote_View->setMultiSelection( TRUE ); 215 Remote_View->setMultiSelection( TRUE );
211 Remote_View->setSelectionMode(QListView::Extended); 216 Remote_View->setSelectionMode(QListView::Extended);
212 217
213 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 218 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
214 219
215 connect( Remote_View, SIGNAL( clicked( QListViewItem*)), 220 connect( Remote_View, SIGNAL( clicked( QListViewItem*)),
216 this,SLOT( remoteListClicked(QListViewItem *)) ); 221 this,SLOT( remoteListClicked(QListViewItem *)) );
217 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 222 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
218 this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 223 this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) );
219 connect( Remote_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); 224// connect( Remote_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
220 225
221 tabLayout_2->addWidget( Remote_View, 0, 0 ); 226 tabLayout_2->addWidget( Remote_View, 0, 0 );
222 227
223 TabWidget->insertTab( tab_2, tr( "2")); 228 TabWidget->insertTab( tab_2, tr( "2"));
224 229
225 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 230 connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
226 this,SLOT(tabChanged(QWidget*))); 231 this,SLOT(tabChanged(QWidget*)));
227 232
228// tab_3 = new QWidget( TabWidget, "tab_3" ); 233 tab_3 = new QWidget( TabWidget, "tab_3" );
229// tabLayout_3 = new QGridLayout( tab_3 ); 234 tabLayout_3 = new QGridLayout( tab_3 );
230// tabLayout_3->setSpacing( 2); 235 tabLayout_3->setSpacing( 2);
231// tabLayout_3->setMargin( 2); 236 tabLayout_3->setMargin( 2);
237
238
239// OFileDialog fileDialog;
240// fileDialog;
241// fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy
242// fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow");
243// OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/");
232 244
233// OFileSelector *fileSelector; 245QListView *fileTree;
234// fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); 246 fileTree = new QListView( tab_3, "tree" );
235// tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 );
236 247
237// TabWidget->insertTab( tab_3, tr( "Files" ) ); 248
249 tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 );
238 250
251 TabWidget->insertTab( tab_3, tr( "Remote" ) );
252///////////////
253
254////////////////////
255
256
239 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 257 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
240 currentDir.setPath( QDir::currentDirPath()); 258 currentDir.setPath( QDir::currentDirPath());
241 259
242 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 260 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
243 currentRemoteDir.setPath( QDir::currentDirPath()); 261 currentRemoteDir.setPath( QDir::currentDirPath());
244 262
245 b = TRUE; 263 b = TRUE;
246 264
247 filterStr="*"; 265 filterStr="*";
248 b=FALSE; 266 b=FALSE;
249 267
250 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); 268 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) );
251 269
252 populateLocalView(); 270 populateLocalView();
253 populateRemoteView(); 271 populateRemoteView();
272 currentPathCombo->setFocus();
254} 273}
255 274
256AdvancedFm::~AdvancedFm() 275AdvancedFm::~AdvancedFm()
257{ 276{
258} 277}
259 278
260void AdvancedFm::cleanUp() 279void AdvancedFm::cleanUp()
261{ 280{
262 QString sfile=QDir::homeDirPath(); 281 QString sfile=QDir::homeDirPath();
263 if(sfile.right(1) != "/") 282 if(sfile.right(1) != "/")
264 sfile+="/._temp"; 283 sfile+="/._temp";
265 else 284 else
@@ -538,27 +557,27 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem)
538 populateLocalView(); 557 populateLocalView();
539 } else { 558 } else {
540 currentDir.cdUp(); 559 currentDir.cdUp();
541 populateLocalView(); 560 populateLocalView();
542 } 561 }
543 if(QDir(strItem).exists()){ 562 if(QDir(strItem).exists()){
544 currentDir.cd(strItem, TRUE); 563 currentDir.cd(strItem, TRUE);
545 populateLocalView(); 564 populateLocalView();
546 } 565 }
547 } else { 566 } else {
548 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 567 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
549 if( QFile::exists(strItem ) ) { 568 if( QFile::exists(strItem ) ) {
550 qDebug("clicked item "+strItem); 569// qDebug("clicked item "+strItem);
551 DocLnk doc( strItem, FALSE ); 570// DocLnk doc( strItem, FALSE );
552 doc.execute(); 571// doc.execute();
553 // Local_View->clearSelection(); 572 // Local_View->clearSelection();
554 } 573 }
555 } //end not symlink 574 } //end not symlink
556 chdir(strItem.latin1()); 575 chdir(strItem.latin1());
557 } 576 }
558 } 577 }
559} 578}
560 579
561void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) 580void AdvancedFm::remoteListClicked(QListViewItem *selectedItem)
562{ 581{
563 if(selectedItem) { 582 if(selectedItem) {
564 QString strItem=selectedItem->text(0); 583 QString strItem=selectedItem->text(0);
@@ -579,27 +598,27 @@ void AdvancedFm::remoteListClicked(QListViewItem *selectedItem)
579 populateRemoteView(); 598 populateRemoteView();
580 } else { 599 } else {
581 currentRemoteDir.cdUp(); 600 currentRemoteDir.cdUp();
582 populateRemoteView(); 601 populateRemoteView();
583 } 602 }
584 if(QDir(strItem).exists()){ 603 if(QDir(strItem).exists()){
585 currentRemoteDir.cd(strItem, TRUE); 604 currentRemoteDir.cd(strItem, TRUE);
586 populateRemoteView(); 605 populateRemoteView();
587 } 606 }
588 } else { 607 } else {
589 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); 608 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem);
590 if( QFile::exists(strItem ) ) { 609 if( QFile::exists(strItem ) ) {
591 qDebug("clicked item "+strItem); 610// qDebug("clicked item "+strItem);
592 DocLnk doc( strItem, FALSE ); 611// DocLnk doc( strItem, FALSE );
593 doc.execute(); 612// doc.execute();
594 // Remote_View->clearSelection(); 613 // Remote_View->clearSelection();
595 } 614 }
596 } //end not symlink 615 } //end not symlink
597 chdir(strItem.latin1()); 616 chdir(strItem.latin1());
598 } 617 }
599 } 618 }
600} 619}
601 620
602void AdvancedFm::doLocalCd() 621void AdvancedFm::doLocalCd()
603{ 622{
604 localListClicked( Local_View->currentItem()); 623 localListClicked( Local_View->currentItem());
605} 624}
@@ -639,41 +658,44 @@ void AdvancedFm::showRemoteHidden()
639 658
640 } else { 659 } else {
641 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 660 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
642// localMenu->setItemChecked(localMenu->idAt(0),FALSE); 661// localMenu->setItemChecked(localMenu->idAt(0),FALSE);
643// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 662// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
644 b=FALSE; 663 b=FALSE;
645 } 664 }
646 populateRemoteView(); 665 populateRemoteView();
647} 666}
648 667
649void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 668void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
650{ 669{
651 switch (mouse) { 670qDebug("list pressed");
671 switch (mouse) {
652 case 1: 672 case 1:
653 break; 673 break;
654 case 2: 674 case 2:
655 menuTimer.start( 500, TRUE ); 675 menuTimer.start( 750, TRUE );
676 qDebug("Start menu timer\n");
656 break; 677 break;
657 }; 678 };
658} 679}
659 680
660void AdvancedFm::remoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) 681void AdvancedFm::remoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
661{ 682{
662 683
663 switch (mouse) { 684 switch (mouse) {
664 case 1: 685 case 1:
665 break; 686 break;
666 case 2: 687 case 2:
667 menuTimer.start( 500, TRUE ); 688 menuTimer.start( 750, TRUE );
689 qDebug("Start menu timer");
668 break; 690 break;
669 }; 691 };
670} 692}
671 693
672void AdvancedFm::runThis() { 694void AdvancedFm::runThis() {
673// QFileInfo *fi; 695// QFileInfo *fi;
674 QString fs; 696 QString fs;
675 if (TabWidget->currentPageIndex() == 0) { 697 if (TabWidget->currentPageIndex() == 0) {
676 QString curFile = Local_View->currentItem()->text(0); 698 QString curFile = Local_View->currentItem()->text(0);
677 if(curFile != "../") { 699 if(curFile != "../") {
678 700
679 fs= getFileSystemType((const QString &) currentDir.canonicalPath()); 701 fs= getFileSystemType((const QString &) currentDir.canonicalPath());
@@ -1452,24 +1474,25 @@ void AdvancedFm::del() {
1452 remoteDelete(); 1474 remoteDelete();
1453} 1475}
1454 1476
1455void AdvancedFm::doAbout() { 1477void AdvancedFm::doAbout() {
1456 QMessageBox::message("AdvancedFm","Advanced FileManager\n" 1478 QMessageBox::message("AdvancedFm","Advanced FileManager\n"
1457 "is copyright 2002 by\n" 1479 "is copyright 2002 by\n"
1458 "L.J.Potter<llornkcor@handhelds.org>\n" 1480 "L.J.Potter<llornkcor@handhelds.org>\n"
1459 "and is licensed by the GPL"); 1481 "and is licensed by the GPL");
1460} 1482}
1461 1483
1462void AdvancedFm::keyReleaseEvent( QKeyEvent *e) 1484void AdvancedFm::keyReleaseEvent( QKeyEvent *e)
1463{ 1485{
1486 if( TabWidget->hasFocus())
1464 switch ( e->key() ) { 1487 switch ( e->key() ) {
1465 case Key_Delete: 1488 case Key_Delete:
1466 del(); 1489 del();
1467 break; 1490 break;
1468 case Key_H: 1491 case Key_H:
1469 showHidden(); 1492 showHidden();
1470 break; 1493 break;
1471 case Key_E: 1494 case Key_E:
1472 runThis(); 1495 runThis();
1473 break; 1496 break;
1474 case Key_C: 1497 case Key_C:
1475 copy(); 1498 copy();
@@ -1659,95 +1682,101 @@ void AdvancedFm::fileBeamFinished( Ir *ir) {
1659 1682
1660// QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 1683// QList<QListViewItem> * getSelectedItems( QListView * Local_View );
1661// QListViewItemIterator it( Local_View ); 1684// QListViewItemIterator it( Local_View );
1662// for ( ; it.current(); ++it ) { 1685// for ( ; it.current(); ++it ) {
1663// if ( it.current()->isSelected() ) { 1686// if ( it.current()->isSelected() ) {
1664// QString strItem = it.current()->text(0); 1687// QString strItem = it.current()->text(0);
1665// QString localFile = currentDir.canonicalPath()+"/"+strItem; 1688// QString localFile = currentDir.canonicalPath()+"/"+strItem;
1666// QFileInfo fi(localFile); 1689// QFileInfo fi(localFile);
1667// } 1690// }
1668// } 1691// }
1669 1692
1670void AdvancedFm::showFileMenu() { 1693void AdvancedFm::showFileMenu() {
1694
1671 QString curApp; 1695 QString curApp;
1672 bool isLocalView = false; 1696 bool isLocalView = false;
1673 if (TabWidget->currentPageIndex() == 0) { 1697 if (TabWidget->currentPageIndex() == 0) {
1674 isLocalView = TRUE; 1698 isLocalView = TRUE;
1675 curApp = Local_View->currentItem()->text(0); 1699 curApp = Local_View->currentItem()->text(0);
1676 } else { 1700 } else {
1677 curApp = Remote_View->currentItem()->text(0); 1701 curApp = Remote_View->currentItem()->text(0);
1678 } 1702 }
1679 1703
1680 MimeType mt( curApp ); 1704 MimeType mt( curApp );
1681 const AppLnk* app = mt.application(); 1705 const AppLnk* app = mt.application();
1682 QFile fi(curApp); 1706 QFile fi(curApp);
1683 1707
1684 QPopupMenu m; 1708// QPopupMenu m;
1685 m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 1709 QPopupMenu *m = new QPopupMenu(0);
1686 m.insertSeparator(); 1710
1711 m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
1712 m->insertSeparator();
1687 if ( QFileInfo(fi).isDir() ) { 1713 if ( QFileInfo(fi).isDir() ) {
1688 m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); 1714 m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
1689 } else { 1715 } else {
1690 1716
1691 if ( app ) 1717 if ( app )
1692 m.insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( runThis() ) ); 1718 m->insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( runThis() ) );
1693 else if( QFileInfo(fi).isExecutable() ) 1719 else if( QFileInfo(fi).isExecutable() )
1694 m.insertItem( tr( "Execute" ), this, SLOT( runThis() ) ); 1720 m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) );
1695 1721
1696 m.insertItem( /*Resource::loadPixmap( "txt" ),*/ tr( "Open as text" ),this, SLOT( runText() ) ); 1722 m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) );
1697 } 1723 }
1698 m.insertSeparator(); 1724 m->insertSeparator();
1699 1725
1700 1726
1701 if(isLocalView) 1727 if(isLocalView)
1702 m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 1728 m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
1703 else 1729 else
1704 m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); 1730 m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
1705 1731
1706 m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); 1732 m->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
1707 m.insertSeparator(); 1733 m->insertSeparator();
1708 1734
1709 if(isLocalView) 1735 if(isLocalView)
1710 m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); 1736 m->insertItem( tr( "Rename" ), this, SLOT( localRename() ));
1711 else 1737 else
1712 m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 1738 m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
1713 1739
1714 m.insertItem( tr( "Copy" ), this, SLOT( copy() )); 1740 m->insertItem( tr( "Copy" ), this, SLOT( copy() ));
1715 m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); 1741 m->insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
1716 m.insertItem( tr( "Move" ), this, SLOT( move() )); 1742 m->insertItem( tr( "Move" ), this, SLOT( move() ));
1717 m.insertSeparator(); 1743 m->insertSeparator();
1718 1744
1719 if(isLocalView) 1745 if(isLocalView)
1720 m.insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); 1746 m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() ));
1721 else 1747 else
1722 m.insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); 1748 m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() ));
1723 1749
1724 m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); 1750 m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
1725 m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); 1751 m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
1726 m.insertSeparator(); 1752 m->insertSeparator();
1727 1753
1728 if(isLocalView) 1754 if(isLocalView)
1729 m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 1755 m->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
1730 else 1756 else
1731 m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 1757 m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
1732 1758
1733 m.insertSeparator(); 1759 m->insertSeparator();
1734 m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); 1760 m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
1735 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings 1761 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings
1736 m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 1762 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
1737 m.setCheckable(TRUE); 1763 m->setCheckable(TRUE);
1738 if (!b) 1764 if (!b)
1739 m.setItemChecked(m.idAt(0),TRUE); 1765 m->setItemChecked(m->idAt(0),TRUE);
1740 else 1766 else
1741 m.setItemChecked(m.idAt(0),FALSE); 1767 m->setItemChecked(m->idAt(0),FALSE);
1742 if(Ir::supported()) 1768 if(Ir::supported())
1743 m.insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); 1769 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
1744 m.exec( QCursor::pos() ); 1770 m->setFocus();
1771 m->exec( QCursor::pos() );
1772 if(m) delete m;
1745} 1773}
1746 1774
1747 1775
1748void AdvancedFm::cancelMenuTimer() 1776void AdvancedFm::cancelMenuTimer()
1749{ 1777{
1750qDebug("cancel menu timer"); 1778
1779 qDebug("selectionChanged: cancel menu timer");
1751 if( menuTimer.isActive() ) 1780 if( menuTimer.isActive() )
1752 menuTimer.stop(); 1781 menuTimer.stop();
1753} 1782}
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro
index 25fb782..299f870 100644
--- a/noncore/apps/advancedfm/advancedfm.pro
+++ b/noncore/apps/advancedfm/advancedfm.pro
@@ -1,11 +1,11 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h 3HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h
4SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp
5TARGET = advancedfm 5TARGET = advancedfm
6REQUIRES=medium-config 6REQUIRES=medium-config
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9DESTDIR = $(OPIEDIR)/bin 9DESTDIR = $(OPIEDIR)/bin
10LIBS += -lqpe 10LIBS += -lqpe -lopie
11 11