summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp5
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp6
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp10
4 files changed, 15 insertions, 7 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 7fba0af..d7bad51 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,61 +1,60 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
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
14#include "advancedfm.h" 13#include "advancedfm.h"
15 14
16// #include <opie/ofileselector.h> 15// #include <opie/ofileselector.h>
17// #include <opie/ofiledialog.h> 16// #include <opie/ofiledialog.h>
18 17
19#include <qpe/filemanager.h> 18#include <qpe/filemanager.h>
20#include <qpe/qcopenvelope_qws.h> 19#include <qpe/qcopenvelope_qws.h>
21#include <qpe/qpemenubar.h> 20#include <qpe/qpemenubar.h>
22#include <qpe/qpetoolbar.h> 21#include <qpe/qpetoolbar.h>
23#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
24#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
25#include <qpe/config.h> 24#include <qpe/config.h>
26#include <qpe/mimetype.h> 25#include <qpe/mimetype.h>
27#include <qpe/applnk.h> 26#include <qpe/applnk.h>
28#include <qpe/ir.h> 27#include <qpe/ir.h>
29#include <qpe/resource.h> 28#include <qpe/resource.h>
30 29
31#include <qtabwidget.h> 30#include <qtabwidget.h>
32#include <qtextstream.h> 31#include <qtextstream.h>
33#include <qpushbutton.h> 32#include <qpushbutton.h>
34#include <qdatetime.h> 33#include <qdatetime.h>
35#include <qdir.h> 34#include <qdir.h>
36#include <qfile.h> 35#include <qfile.h>
37#include <qstring.h> 36#include <qstring.h>
38#include <qcombobox.h> 37#include <qcombobox.h>
39#include <qpopupmenu.h> 38#include <qpopupmenu.h>
40#include <qlistview.h> 39#include <qlistview.h>
41#include <qmainwindow.h> 40#include <qmainwindow.h>
42#include <qlabel.h> 41#include <qlabel.h>
43#include <qprogressbar.h> 42#include <qprogressbar.h>
44#include <qspinbox.h> 43#include <qspinbox.h>
45#include <qwidget.h> 44#include <qwidget.h>
46#include <qlayout.h> 45#include <qlayout.h>
47#include <qimage.h> 46#include <qimage.h>
48#include <qpixmap.h> 47#include <qpixmap.h>
49#include <qmessagebox.h> 48#include <qmessagebox.h>
50#include <qlineedit.h> 49#include <qlineedit.h>
51#include <qregexp.h> 50#include <qregexp.h>
52 51
53#include <unistd.h> 52#include <unistd.h>
54#include <stdlib.h> 53#include <stdlib.h>
55#include <sys/stat.h> 54#include <sys/stat.h>
56#include <dirent.h> 55#include <dirent.h>
57#include <stdio.h> 56#include <stdio.h>
58#include <time.h> 57#include <time.h>
59#include <fcntl.h> 58#include <fcntl.h>
60#include <mntent.h> 59#include <mntent.h>
61#include <string.h> 60#include <string.h>
@@ -350,109 +349,109 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) {
350void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { 349void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) {
351 350
352 if(selectedItem) { 351 if(selectedItem) {
353 QString strItem=selectedItem->text(0); 352 QString strItem=selectedItem->text(0);
354 QString strSize=selectedItem->text(1); 353 QString strSize=selectedItem->text(1);
355 strSize=strSize.stripWhiteSpace(); 354 strSize=strSize.stripWhiteSpace();
356 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 355 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
357 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 356 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
358 currentRemoteDir.cd(strItem2, TRUE); 357 currentRemoteDir.cd(strItem2, TRUE);
359 populateRemoteView(); 358 populateRemoteView();
360 } else { // not a symlink 359 } else { // not a symlink
361 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { 360 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) {
362 if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { 361 if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) {
363 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); 362 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem);
364 currentRemoteDir.cd(strItem,FALSE); 363 currentRemoteDir.cd(strItem,FALSE);
365 populateRemoteView(); 364 populateRemoteView();
366 Remote_View->ensureItemVisible(Remote_View->firstChild()); 365 Remote_View->ensureItemVisible(Remote_View->firstChild());
367 } else { 366 } else {
368 currentRemoteDir.cdUp(); 367 currentRemoteDir.cdUp();
369 populateRemoteView(); 368 populateRemoteView();
370 Remote_View->ensureItemVisible(Remote_View->firstChild()); 369 Remote_View->ensureItemVisible(Remote_View->firstChild());
371 } 370 }
372 if(QDir(strItem).exists()){ 371 if(QDir(strItem).exists()){
373 currentRemoteDir.cd(strItem, TRUE); 372 currentRemoteDir.cd(strItem, TRUE);
374 populateRemoteView(); 373 populateRemoteView();
375 Remote_View->ensureItemVisible(Remote_View->firstChild()); 374 Remote_View->ensureItemVisible(Remote_View->firstChild());
376 } 375 }
377 } else { 376 } else {
378 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); 377 strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem);
379 if( QFile::exists(strItem ) ) { 378 if( QFile::exists(strItem ) ) {
380 // qDebug("clicked item "+strItem); 379 // qDebug("clicked item "+strItem);
381 // DocLnk doc( strItem, FALSE ); 380 // DocLnk doc( strItem, FALSE );
382 // doc.execute(); 381 // doc.execute();
383 // Remote_View->clearSelection(); 382 // Remote_View->clearSelection();
384 } 383 }
385 } //end not symlink 384 } //end not symlink
386 chdir(strItem.latin1()); 385 chdir(strItem.latin1());
387 } 386 }
388 } 387 }
389} 388}
390 389
391 390
392void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { 391void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) {
393// qDebug("list pressed"); 392// qDebug("list pressed");
394 switch (mouse) { 393 switch (mouse) {
395 case 1: 394 case 1:
396 break; 395 break;
397 case 2: 396 case 2:
398 menuTimer.start( 750, TRUE ); 397 menuTimer.start( 500, TRUE );
399 qDebug("Start menu timer\n"); 398 qDebug("Start menu timer\n");
400 break; 399 break;
401 }; 400 };
402} 401}
403 402
404void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) { 403void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) {
405 404
406 switch (mouse) { 405 switch (mouse) {
407 case 1: 406 case 1:
408 break; 407 break;
409 case 2: 408 case 2:
410 menuTimer.start( 750, TRUE ); 409 menuTimer.start( 500, TRUE );
411 qDebug("Start menu timer"); 410 qDebug("Start menu timer");
412 break; 411 break;
413 }; 412 };
414} 413}
415 414
416 415
417void AdvancedFm::switchToLocalTab() { 416void AdvancedFm::switchToLocalTab() {
418 TabWidget->setCurrentPage(0); 417 TabWidget->setCurrentPage(0);
419 Local_View->setFocus(); 418 Local_View->setFocus();
420} 419}
421 420
422void AdvancedFm::switchToRemoteTab() { 421void AdvancedFm::switchToRemoteTab() {
423 TabWidget->setCurrentPage(1); 422 TabWidget->setCurrentPage(1);
424 Remote_View->setFocus(); 423 Remote_View->setFocus();
425} 424}
426 425
427void AdvancedFm::readConfig() { 426void AdvancedFm::readConfig() {
428 Config cfg("AdvancedFm"); 427 Config cfg("AdvancedFm");
429} 428}
430 429
431void AdvancedFm::writeConfig() { 430void AdvancedFm::writeConfig() {
432 Config cfg("AdvancedFm"); 431 Config cfg("AdvancedFm");
433} 432}
434 433
435void AdvancedFm::currentPathComboChanged() { 434void AdvancedFm::currentPathComboChanged() {
436 if (TabWidget->currentPageIndex() == 0) { 435 if (TabWidget->currentPageIndex() == 0) {
437 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 436 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
438 currentDir.setPath( currentPathCombo->lineEdit()->text() ); 437 currentDir.setPath( currentPathCombo->lineEdit()->text() );
439 populateLocalView(); 438 populateLocalView();
440 } else { 439 } else {
441 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 440 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
442 } 441 }
443 } 442 }
444 if (TabWidget->currentPageIndex() == 0) { 443 if (TabWidget->currentPageIndex() == 0) {
445 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 444 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
446 currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() ); 445 currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() );
447 populateRemoteView(); 446 populateRemoteView();
448 } else { 447 } else {
449 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 448 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
450 } 449 }
451 } 450 }
452} 451}
453 452
454void AdvancedFm::fillCombo(const QString &currentPath) { 453void AdvancedFm::fillCombo(const QString &currentPath) {
455 454
456 if (TabWidget->currentPageIndex() == 0) { 455 if (TabWidget->currentPageIndex() == 0) {
457 currentPathCombo->lineEdit()->setText( currentPath); 456 currentPathCombo->lineEdit()->setText( currentPath);
458 if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { 457 if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 12ad474..f846c66 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -1,62 +1,63 @@
1/*************************************************************************** 1/***************************************************************************
2 advancedfm.h 2 advancedfm.h
3 ------------------- 3 -------------------
4** Created: Sat Mar 9 23:33:09 2002 4** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
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#ifndef ADVANCEDFM_H 12#ifndef ADVANCEDFM_H
13#define ADVANCEDFM_H 13#define ADVANCEDFM_H
14#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties 14#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
15#define QT_QWS_OPIE
15 16
16#include <qpe/ir.h> 17#include <qpe/ir.h>
17 18
18#include <qvariant.h> 19#include <qvariant.h>
19#include <qdialog.h> 20#include <qdialog.h>
20#include <qmainwindow.h> 21#include <qmainwindow.h>
21#include <qstringlist.h> 22#include <qstringlist.h>
22#include <qdir.h> 23#include <qdir.h>
23#include <qstring.h> 24#include <qstring.h>
24#include <qpoint.h> 25#include <qpoint.h>
25#include <qtimer.h> 26#include <qtimer.h>
26 27
27class QVBoxLayout; 28class QVBoxLayout;
28class QHBoxLayout; 29class QHBoxLayout;
29class QGridLayout; 30class QGridLayout;
30class QComboBox; 31class QComboBox;
31class QListView; 32class QListView;
32class QListviewItem; 33class QListviewItem;
33class QLabel; 34class QLabel;
34class QProgressBar; 35class QProgressBar;
35class QSpinBox; 36class QSpinBox;
36class QTabWidget; 37class QTabWidget;
37class QWidget; 38class QWidget;
38class QPEToolBar; 39class QPEToolBar;
39class QPEMenuBar; 40class QPEMenuBar;
40class QPopupMenu; 41class QPopupMenu;
41class QFile; 42class QFile;
42class QListViewItem; 43class QListViewItem;
43class QLineEdit; 44class QLineEdit;
44//class QPushButton; 45//class QPushButton;
45class QToolButton; 46class QToolButton;
46class Ir; 47class Ir;
47 48
48class AdvancedFm : public QMainWindow 49class AdvancedFm : public QMainWindow
49{ 50{
50 Q_OBJECT 51 Q_OBJECT
51public: 52public:
52 AdvancedFm(); 53 AdvancedFm();
53 ~AdvancedFm(); 54 ~AdvancedFm();
54 55
55 QTabWidget *TabWidget; 56 QTabWidget *TabWidget;
56 QWidget *tab, *tab_2, *tab_3; 57 QWidget *tab, *tab_2, *tab_3;
57 QListView *Local_View, *Remote_View; 58 QListView *Local_View, *Remote_View;
58 59
59 QLineEdit *currentPathEdit; 60 QLineEdit *currentPathEdit;
60 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; 61 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
61 QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; 62 QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
62// QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; 63// QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 4c24e83..619a7a9 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,82 +1,84 @@
1/*************************************************************************** 1/***************************************************************************
2 advancedfmData.cpp 2 advancedfmData.cpp
3 ------------------- 3 -------------------
4** Created: Mon 09-23-2002 13:24:11 4** Created: Mon 09-23-2002 13:24:11
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
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#include "advancedfm.h" 12#include "advancedfm.h"
13 13
14#include <qpe/qpeapplication.h> 14#include <qpe/qpeapplication.h>
15#include <qpe/qpemenubar.h> 15#include <qpe/qpemenubar.h>
16#include <qpe/qpetoolbar.h> 16#include <qpe/qpetoolbar.h>
17#include <qpe/resource.h> 17#include <qpe/resource.h>
18 18
19#include <qlayout.h> 19#include <qlayout.h>
20#include <qpixmap.h> 20#include <qpixmap.h>
21#include <qcombobox.h> 21#include <qcombobox.h>
22#include <qpopupmenu.h> 22#include <qpopupmenu.h>
23#include <qtabwidget.h> 23#include <qtabwidget.h>
24#include <qtoolbutton.h> 24#include <qtoolbutton.h>
25#include <qtabwidget.h> 25#include <qtabwidget.h>
26#include <qlineedit.h> 26#include <qlineedit.h>
27#include <qlistview.h> 27#include <qlistview.h>
28 28
29#include <sys/utsname.h> 29#include <sys/utsname.h>
30 30
31 31
32void AdvancedFm::init() { 32void AdvancedFm::init() {
33 33#if defined(QT_QWS_OPIE)
34 setCaption( tr( "AdvancedFm" ) ); 34 qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!");
35#endif
36 setCaption( tr( "AdvancedFm" ) );
35 37
36 QGridLayout *layout = new QGridLayout( this ); 38 QGridLayout *layout = new QGridLayout( this );
37 layout->setSpacing( 2); 39 layout->setSpacing( 2);
38 layout->setMargin( 2); 40 layout->setMargin( 2);
39 41
40 42
41 QPEMenuBar *menuBar = new QPEMenuBar(this); 43 QPEMenuBar *menuBar = new QPEMenuBar(this);
42 fileMenu = new QPopupMenu( this ); 44 fileMenu = new QPopupMenu( this );
43 viewMenu = new QPopupMenu( this ); 45 viewMenu = new QPopupMenu( this );
44 46
45 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); 47 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 );
46 48
47 menuBar->insertItem( tr( "File" ), fileMenu); 49 menuBar->insertItem( tr( "File" ), fileMenu);
48 menuBar->insertItem( tr( "View" ), viewMenu); 50 menuBar->insertItem( tr( "View" ), viewMenu);
49 51
50 qpeDirButton= new QToolButton(this,"QPEButton"); 52 qpeDirButton= new QToolButton(this,"QPEButton");
51 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); 53 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
52 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 54 qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
53 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); 55 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
54 56
55 cfButton = new QToolButton( this,"CFButton"); 57 cfButton = new QToolButton( this,"CFButton");
56 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 58 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
57 cfButton ->setFixedSize( QSize( 20, 20 ) ); 59 cfButton ->setFixedSize( QSize( 20, 20 ) );
58 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); 60 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
59 61
60 sdButton = new QToolButton( this,"SDButton"); 62 sdButton = new QToolButton( this,"SDButton");
61 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 63 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
62 sdButton->setFixedSize( QSize( 20, 20 ) ); 64 sdButton->setFixedSize( QSize( 20, 20 ) );
63 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); 65 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
64 66
65 cdUpButton = new QToolButton( this,"cdUpButton"); 67 cdUpButton = new QToolButton( this,"cdUpButton");
66 cdUpButton->setPixmap(Resource::loadPixmap("up")); 68 cdUpButton->setPixmap(Resource::loadPixmap("up"));
67 cdUpButton ->setFixedSize( QSize( 20, 20 ) ); 69 cdUpButton ->setFixedSize( QSize( 20, 20 ) );
68 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); 70 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
69 71
70 docButton = new QToolButton( this,"docsButton"); 72 docButton = new QToolButton( this,"docsButton");
71 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 73 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
72 docButton->setFixedSize( QSize( 20, 20 ) ); 74 docButton->setFixedSize( QSize( 20, 20 ) );
73 layout->addMultiCellWidget( docButton, 0, 0, 6, 6); 75 layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
74 76
75 homeButton = new QToolButton( this,"homeButton"); 77 homeButton = new QToolButton( this,"homeButton");
76 homeButton->setPixmap(Resource::loadPixmap("home")); 78 homeButton->setPixmap(Resource::loadPixmap("home"));
77 homeButton->setFixedSize( QSize( 20, 20 ) ); 79 homeButton->setFixedSize( QSize( 20, 20 ) );
78 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); 80 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
79 81
80 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); 82 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
81 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 83 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
82 fileMenu->insertSeparator(); 84 fileMenu->insertSeparator();
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 7ee5065..6d37904 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -298,111 +298,117 @@ void AdvancedFm::localRename() {
298 298
299void AdvancedFm::remoteRename() 299void AdvancedFm::remoteRename()
300{ 300{
301 QString curFile = Remote_View->currentItem()->text(0); 301 QString curFile = Remote_View->currentItem()->text(0);
302 if( curFile !="../") { 302 if( curFile !="../") {
303 InputDialog *fileDlg; 303 InputDialog *fileDlg;
304 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); 304 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
305 fileDlg->setInputText((const QString &)curFile); 305 fileDlg->setInputText((const QString &)curFile);
306 fileDlg->exec(); 306 fileDlg->exec();
307 if( fileDlg->result() == 1 ) { 307 if( fileDlg->result() == 1 ) {
308 QString oldname = currentRemoteDir.canonicalPath() + "/" + curFile; 308 QString oldname = currentRemoteDir.canonicalPath() + "/" + curFile;
309 QString newName = currentRemoteDir.canonicalPath() + "/" + fileDlg->LineEdit1->text(); 309 QString newName = currentRemoteDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();
310//+".playlist"; 310//+".playlist";
311 if( rename(oldname.latin1(), newName.latin1())== -1) 311 if( rename(oldname.latin1(), newName.latin1())== -1)
312 QMessageBox::message(tr("Note"),tr("Could not rename")); 312 QMessageBox::message(tr("Note"),tr("Could not rename"));
313 } 313 }
314 populateRemoteView(); 314 populateRemoteView();
315 } 315 }
316} 316}
317 317
318 318
319void AdvancedFm::filePerms() { 319void AdvancedFm::filePerms() {
320 320
321 QStringList curFileList = getPath(); 321 QStringList curFileList = getPath();
322 QString filePath; 322 QString filePath;
323 323
324 if (TabWidget->currentPageIndex() == 0) { 324 if (TabWidget->currentPageIndex() == 0) {
325 filePath = currentDir.canonicalPath()+"/"; 325 filePath = currentDir.canonicalPath()+"/";
326 } else { 326 } else {
327 filePath= currentRemoteDir.canonicalPath()+"/"; 327 filePath= currentRemoteDir.canonicalPath()+"/";
328 } 328 }
329 329
330 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 330 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
331 filePermissions *filePerm; 331 filePermissions *filePerm;
332 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); 332 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
333 filePerm->showMaximized(); 333 filePerm->showMaximized();
334 filePerm->exec(); 334 filePerm->exec();
335 if( filePerm) 335 if( filePerm)
336 delete filePerm; 336 delete filePerm;
337 } 337 }
338 if (TabWidget->currentPageIndex() == 0) { 338 if (TabWidget->currentPageIndex() == 0) {
339 populateLocalView(); 339 populateLocalView();
340 } else { 340 } else {
341 populateRemoteView(); 341 populateRemoteView();
342 } 342 }
343} 343}
344 344
345void AdvancedFm::doProperties() { 345void AdvancedFm::doProperties() {
346#if defined(QT_QWS_OPIE)
347
346 QStringList curFileList = getPath(); 348 QStringList curFileList = getPath();
349
347 QString filePath; 350 QString filePath;
348 if (TabWidget->currentPageIndex() == 0) { 351 if (TabWidget->currentPageIndex() == 0) {
349 filePath = currentDir.canonicalPath()+"/"; 352 filePath = currentDir.canonicalPath()+"/";
350 } else { 353 } else {
351 filePath= currentRemoteDir.canonicalPath()+"/"; 354 filePath= currentRemoteDir.canonicalPath()+"/";
352 } 355 }
353 // qDebug("%d",curFileList.count()); 356 qDebug("%d",curFileList.count());
354 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 357
358 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
355 qDebug((filePath+*it)); 359 qDebug((filePath+*it));
356 DocLnk lnk( (filePath+*it)); 360 DocLnk lnk( (filePath+*it));
357 LnkProperties prop( &lnk ); 361 LnkProperties prop( &lnk );
358 prop.showMaximized(); 362 prop.showMaximized();
359 prop.exec(); 363 prop.exec();
360 } 364 }
365#endif
366
361} 367}
362 368
363void AdvancedFm::upDir() { 369void AdvancedFm::upDir() {
364 if (TabWidget->currentPageIndex() == 0) { 370 if (TabWidget->currentPageIndex() == 0) {
365 QString current = currentDir.canonicalPath(); 371 QString current = currentDir.canonicalPath();
366 QDir dir(current); 372 QDir dir(current);
367 dir.cdUp(); 373 dir.cdUp();
368 current = dir.canonicalPath(); 374 current = dir.canonicalPath();
369 chdir( current.latin1() ); 375 chdir( current.latin1() );
370 currentDir.cd( current, TRUE); 376 currentDir.cd( current, TRUE);
371 populateLocalView(); 377 populateLocalView();
372 update(); 378 update();
373 } else { 379 } else {
374 QString current = currentRemoteDir.canonicalPath(); 380 QString current = currentRemoteDir.canonicalPath();
375 QDir dir(current); 381 QDir dir(current);
376 dir.cdUp(); 382 dir.cdUp();
377 current = dir.canonicalPath(); 383 current = dir.canonicalPath();
378 chdir( current.latin1() ); 384 chdir( current.latin1() );
379 currentRemoteDir.cd( current, TRUE); 385 currentRemoteDir.cd( current, TRUE);
380 populateRemoteView(); 386 populateRemoteView();
381 update(); 387 update();
382 } 388 }
383} 389}
384 390
385void AdvancedFm::copy() { 391void AdvancedFm::copy() {
386 qApp->processEvents(); 392 qApp->processEvents();
387 QStringList curFileList = getPath(); 393 QStringList curFileList = getPath();
388 if( curFileList.count() > 0) { 394 if( curFileList.count() > 0) {
389 QString curFile, item, destFile; 395 QString curFile, item, destFile;
390 if (TabWidget->currentPageIndex() == 0) { 396 if (TabWidget->currentPageIndex() == 0) {
391 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 397 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
392 item=(*it); 398 item=(*it);
393 399
394 if(item.find("->",0,TRUE)) //symlink 400 if(item.find("->",0,TRUE)) //symlink
395 item = item.left(item.find("->",0,TRUE)); 401 item = item.left(item.find("->",0,TRUE));
396 402
397 destFile = currentRemoteDir.canonicalPath()+"/"+ item; 403 destFile = currentRemoteDir.canonicalPath()+"/"+ item;
398 qDebug("Destination file is "+destFile); 404 qDebug("Destination file is "+destFile);
399 405
400 curFile = currentDir.canonicalPath()+"/"+ item; 406 curFile = currentDir.canonicalPath()+"/"+ item;
401 qDebug("CurrentFile file is " + curFile); 407 qDebug("CurrentFile file is " + curFile);
402 408
403 QFile f(destFile); 409 QFile f(destFile);
404 if( f.exists()) { 410 if( f.exists()) {
405 switch ( QMessageBox::warning(this,tr("Delete"), 411 switch ( QMessageBox::warning(this,tr("Delete"),
406 destFile+tr(" already exists\nDo you really want to delete it?"), 412 destFile+tr(" already exists\nDo you really want to delete it?"),
407 tr("Yes"),tr("No"),0,0,1) ) { 413 tr("Yes"),tr("No"),0,0,1) ) {
408 case 0: 414 case 0: