summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp6
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 08dc24e..23244a2 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,47 +1,47 @@
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#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15 #include <opie/otabwidget.h> 15#include <opie/otabwidget.h>
16// #include <opie/ofileselector.h> 16// #include <opie/ofileselector.h>
17// #include <opie/ofiledialog.h> 17// #include <opie/ofiledialog.h>
18 18
19#include <qpe/filemanager.h> 19#include <qpe/filemanager.h>
20#include <qpe/qcopenvelope_qws.h> 20#include <qpe/qcopenvelope_qws.h>
21#include <qpe/qpemenubar.h> 21#include <qpe/qpemenubar.h>
22#include <qpe/qpetoolbar.h> 22#include <qpe/qpetoolbar.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/config.h> 25#include <qpe/config.h>
26#include <qpe/mimetype.h> 26#include <qpe/mimetype.h>
27#include <qpe/applnk.h> 27#include <qpe/applnk.h>
28#include <qpe/ir.h> 28#include <qpe/ir.h>
29#include <qpe/resource.h> 29#include <qpe/resource.h>
30 30
31#include <qtabwidget.h> 31#include <qtabwidget.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qdatetime.h> 34#include <qdatetime.h>
35#include <qdir.h> 35#include <qdir.h>
36#include <qfile.h> 36#include <qfile.h>
37#include <qstring.h> 37#include <qstring.h>
38#include <qcombobox.h> 38#include <qcombobox.h>
39#include <qpopupmenu.h> 39#include <qpopupmenu.h>
40#include <qlistview.h> 40#include <qlistview.h>
41#include <qmainwindow.h> 41#include <qmainwindow.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qprogressbar.h> 43#include <qprogressbar.h>
44#include <qspinbox.h> 44#include <qspinbox.h>
45#include <qwidget.h> 45#include <qwidget.h>
46#include <qlayout.h> 46#include <qlayout.h>
47#include <qimage.h> 47#include <qimage.h>
@@ -784,66 +784,66 @@ void AdvancedFm::showFileMenu() {
784 n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); 784 n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() ));
785 n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); 785 n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() ));
786 n->insertItem( tr( "Move" ), this, SLOT( move() )); 786 n->insertItem( tr( "Move" ), this, SLOT( move() ));
787 787
788 n->insertSeparator(); 788 n->insertSeparator();
789 789
790 if(isLocalView) 790 if(isLocalView)
791 n->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 791 n->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
792 else 792 else
793 n->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 793 n->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
794 794
795 795
796 m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); 796 m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
797 797
798 m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); 798 m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() ));
799 m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); 799 m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() ));
800 800
801 m->insertSeparator(); 801 m->insertSeparator();
802 m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); 802 m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() ));
803 803
804#if defined(QT_QWS_OPIE) 804#if defined(QT_QWS_OPIE)
805 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 805 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
806#endif 806#endif
807 m->setCheckable(TRUE); 807 m->setCheckable(TRUE);
808 if (!b) 808 if (!b)
809 m->setItemChecked(m->idAt(0),TRUE); 809 m->setItemChecked(m->idAt(0),TRUE);
810 else 810 else
811 m->setItemChecked(m->idAt(0),FALSE); 811 m->setItemChecked(m->idAt(0),FALSE);
812 812
813 if(Ir::supported()) 813 if(Ir::supported())
814 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); 814 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
815 m->setFocus(); 815 m->setFocus();
816 m->exec( QCursor::pos() ); 816 m->exec( QPoint( 4,QCursor::pos().y()) );
817 sleep(1); 817
818 if(m) delete m; 818 if(m) delete m;
819} 819}
820 820
821 821
822void AdvancedFm::cancelMenuTimer() { 822void AdvancedFm::cancelMenuTimer() {
823 823
824// qDebug("selectionChanged: cancel menu timer"); 824// qDebug("selectionChanged: cancel menu timer");
825 if( menuTimer.isActive() ) 825 if( menuTimer.isActive() )
826 menuTimer.stop(); 826 menuTimer.stop();
827} 827}
828 828
829QString AdvancedFm::checkDiskSpace(const QString &path) { 829QString AdvancedFm::checkDiskSpace(const QString &path) {
830 struct statfs fss; 830 struct statfs fss;
831 if ( !statfs( path.latin1(), &fss ) ) { 831 if ( !statfs( path.latin1(), &fss ) ) {
832 int blkSize = fss.f_bsize; 832 int blkSize = fss.f_bsize;
833// int totalBlks = fs.f_blocks; 833// int totalBlks = fs.f_blocks;
834 int availBlks = fss.f_bavail; 834 int availBlks = fss.f_bavail;
835 835
836 long mult = blkSize / 1024; 836 long mult = blkSize / 1024;
837 long div = 1024 / blkSize; 837 long div = 1024 / blkSize;
838 if ( !mult ) mult = 1; 838 if ( !mult ) mult = 1;
839 if ( !div ) div = 1; 839 if ( !div ) div = 1;
840 840
841 841
842 return QString::number(availBlks * mult / div); 842 return QString::number(availBlks * mult / div);
843 } 843 }
844 return ""; 844 return "";
845} 845}
846 846
847void AdvancedFm::addToDocs() { 847void AdvancedFm::addToDocs() {
848 QStringList strListPaths = getPath(); 848 QStringList strListPaths = getPath();
849 if( strListPaths.count() > 0) { 849 if( strListPaths.count() > 0) {
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index f0a0a35..0966f02 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -58,64 +58,65 @@ void AdvancedFm::init() {
58 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 58 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
59 cfButton ->setFixedSize( QSize( 20, 20 ) ); 59 cfButton ->setFixedSize( QSize( 20, 20 ) );
60 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); 60 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
61 61
62 sdButton = new QToolButton( this,"SDButton"); 62 sdButton = new QToolButton( this,"SDButton");
63 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 63 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
64 sdButton->setFixedSize( QSize( 20, 20 ) ); 64 sdButton->setFixedSize( QSize( 20, 20 ) );
65 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); 65 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
66 66
67 cdUpButton = new QToolButton( this,"cdUpButton"); 67 cdUpButton = new QToolButton( this,"cdUpButton");
68 cdUpButton->setPixmap(Resource::loadPixmap("up")); 68 cdUpButton->setPixmap(Resource::loadPixmap("up"));
69 cdUpButton ->setFixedSize( QSize( 20, 20 ) ); 69 cdUpButton ->setFixedSize( QSize( 20, 20 ) );
70 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); 70 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
71 71
72 docButton = new QToolButton( this,"docsButton"); 72 docButton = new QToolButton( this,"docsButton");
73 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 73 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
74 docButton->setFixedSize( QSize( 20, 20 ) ); 74 docButton->setFixedSize( QSize( 20, 20 ) );
75 layout->addMultiCellWidget( docButton, 0, 0, 6, 6); 75 layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
76 76
77 homeButton = new QToolButton( this,"homeButton"); 77 homeButton = new QToolButton( this,"homeButton");
78 homeButton->setPixmap(Resource::loadPixmap("home")); 78 homeButton->setPixmap(Resource::loadPixmap("home"));
79 homeButton->setFixedSize( QSize( 20, 20 ) ); 79 homeButton->setFixedSize( QSize( 20, 20 ) );
80 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); 80 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
81 81
82 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); 82 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
83 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 83 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
84 fileMenu->insertSeparator(); 84 fileMenu->insertSeparator();
85 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); 85 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() ));
86 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); 86 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() ));
87 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); 87 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() ));
88 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); 88 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() ));
89 fileMenu->insertSeparator(); 89 fileMenu->insertSeparator();
90 fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
90 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); 91 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() ));
91 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); 92 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
92 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); 93 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() ));
93 fileMenu->setCheckable(TRUE); 94 fileMenu->setCheckable(TRUE);
94 95
95 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 96 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
96 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 97 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
97 viewMenu->insertSeparator(); 98 viewMenu->insertSeparator();
98 viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); 99 viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
99 viewMenu->setCheckable(TRUE); 100 viewMenu->setCheckable(TRUE);
100 101
101 102
102 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); 103 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
103 currentPathCombo->setEditable(TRUE); 104 currentPathCombo->setEditable(TRUE);
104 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); 105 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
105 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 106 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
106 107
107 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 108 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
108 109
109 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); 110 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
110 111
111 112
112 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); 113 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab);
113// TabWidget = new QTabWidget( this, "TabWidget" ); 114// TabWidget = new QTabWidget( this, "TabWidget" );
114 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); 115 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7);
115 116
116 tab = new QWidget( TabWidget, "tab" ); 117 tab = new QWidget( TabWidget, "tab" );
117 tabLayout = new QGridLayout( tab ); 118 tabLayout = new QGridLayout( tab );
118 tabLayout->setSpacing( 2); 119 tabLayout->setSpacing( 2);
119 tabLayout->setMargin( 2); 120 tabLayout->setMargin( 2);
120 121
121 Local_View = new QListView( tab, "Local_View" ); 122 Local_View = new QListView( tab, "Local_View" );