summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-04-22 17:39:18 (UTC)
committer harlekin <harlekin>2003-04-22 17:39:18 (UTC)
commitb22d89883cd92bd9d858caf5ca90b6eef80598d4 (patch) (unidiff)
tree695ff1e42ca09098d8b0cba0b95f0f2f736e0fd2
parentab9387322c5802f75bc9b37b3bb334bd98dd5dd1 (diff)
downloadopie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.zip
opie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.tar.gz
opie-b22d89883cd92bd9d858caf5ca90b6eef80598d4.tar.bz2
- a lot of includes and gui cleanups
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp39
-rw-r--r--noncore/apps/advancedfm/advancedfm.h5
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp82
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp4
4 files changed, 47 insertions, 83 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 41e83c7..66353bb 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,113 +1,88 @@
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
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/config.h> 19#include <opie/otabwidget.h>
20
20#include <qpe/filemanager.h> 21#include <qpe/filemanager.h>
21#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
22#include <qpe/qpemenubar.h>
23#include <qpe/qpetoolbar.h>
24#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h>
26#include <qpe/config.h> 24#include <qpe/config.h>
27#include <qpe/mimetype.h> 25#include <qpe/mimetype.h>
28#include <qpe/applnk.h> 26#include <qpe/applnk.h>
29#include <qpe/ir.h> 27#include <qpe/ir.h>
30#include <qpe/resource.h> 28#include <qpe/resource.h>
31#include <qpe/menubutton.h> 29#include <qpe/menubutton.h>
32 30
33
34#include <qwmatrix.h>
35#include <qregexp.h>
36#include <qtabwidget.h>
37#include <qtextstream.h>
38#include <qpushbutton.h>
39#include <qdatetime.h> 31#include <qdatetime.h>
40#include <qdir.h>
41#include <qfile.h> 32#include <qfile.h>
42#include <qstring.h>
43#include <qcombobox.h> 33#include <qcombobox.h>
44#include <qpopupmenu.h> 34#include <qpopupmenu.h>
45#include <qlistview.h> 35#include <qlistview.h>
46#include <qmainwindow.h>
47#include <qlabel.h> 36#include <qlabel.h>
48#include <qprogressbar.h>
49#include <qspinbox.h>
50#include <qwidget.h> 37#include <qwidget.h>
51#include <qlayout.h> 38#include <qlayout.h>
52#include <qimage.h> 39#include <qimage.h>
53#include <qpixmap.h>
54#include <qmessagebox.h> 40#include <qmessagebox.h>
55#include <qlineedit.h> 41#include <qlineedit.h>
56#include <qregexp.h>
57 42
58#include <unistd.h>
59#include <stdlib.h>
60#include <sys/stat.h> 43#include <sys/stat.h>
61#include <dirent.h>
62#include <stdio.h>
63#include <time.h> 44#include <time.h>
45#include <dirent.h>
64#include <fcntl.h> 46#include <fcntl.h>
65#include <mntent.h>
66#include <string.h>
67#include <errno.h>
68#include <sys/vfs.h> 47#include <sys/vfs.h>
69#include <mntent.h> 48#include <mntent.h>
70#include <sys/utsname.h>
71 49
72AdvancedFm::AdvancedFm( ) 50AdvancedFm::AdvancedFm( )
73 : QMainWindow( ) { 51 : QMainWindow( ) {
74 init(); 52 init();
75 renameBox = 0; 53 renameBox = 0;
76 54
77 QWMatrix matrix; 55 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
78 QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); 56
79 matrix.scale( .4, .4);
80 unknownXpm = pix.xForm(matrix);
81
82 initConnections(); 57 initConnections();
83 whichTab=1; 58 whichTab=1;
84 rePopulate(); 59 rePopulate();
85 currentPathCombo->setFocus(); 60 currentPathCombo->setFocus();
86} 61}
87 62
88AdvancedFm::~AdvancedFm() { 63AdvancedFm::~AdvancedFm() {
89} 64}
90 65
91 66
92void AdvancedFm::cleanUp() 67void AdvancedFm::cleanUp()
93{ 68{
94 QString sfile=QDir::homeDirPath(); 69 QString sfile=QDir::homeDirPath();
95 if(sfile.right(1) != "/") 70 if(sfile.right(1) != "/")
96 sfile+="/._temp"; 71 sfile+="/._temp";
97 else 72 else
98 sfile+="._temp"; 73 sfile+="._temp";
99 QFile file( sfile); 74 QFile file( sfile);
100 if(file.exists()) 75 if(file.exists())
101 file.remove(); 76 file.remove();
102} 77}
103 78
104void AdvancedFm::tabChanged(QWidget *w) 79void AdvancedFm::tabChanged(QWidget *w)
105{ 80{
106 if( w == tab) 81 if( w == tab)
107 whichTab = 1; 82 whichTab = 1;
108 else 83 else
109 whichTab = 2; 84 whichTab = 2;
110 85
111// qDebug("tab changed %d", whichTab ); 86// qDebug("tab changed %d", whichTab );
112 87
113 QString path = CurrentDir()->canonicalPath(); 88 QString path = CurrentDir()->canonicalPath();
@@ -181,65 +156,65 @@ void AdvancedFm::populateView()
181 } 156 }
182 else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) 157 else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") )
183 { 158 {
184 pm = Resource::loadPixmap( "exec"); 159 pm = Resource::loadPixmap( "exec");
185 } 160 }
186 else if( (fileInfo.permission( QFileInfo::ExeUser) 161 else if( (fileInfo.permission( QFileInfo::ExeUser)
187 | fileInfo.permission( QFileInfo::ExeGroup) 162 | fileInfo.permission( QFileInfo::ExeGroup)
188 | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) 163 | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" )
189 { 164 {
190 pm = Resource::loadPixmap( "exec"); 165 pm = Resource::loadPixmap( "exec");
191 } 166 }
192 else if( !fi->isReadable() ) 167 else if( !fi->isReadable() )
193 { 168 {
194 pm = Resource::loadPixmap( "locked" ); 169 pm = Resource::loadPixmap( "locked" );
195 } 170 }
196 else { //everything else goes by mimetype 171 else { //everything else goes by mimetype
197 MimeType mt(fi->filePath()); 172 MimeType mt(fi->filePath());
198 pm=mt.pixmap(); //sets the correct pixmap for mimetype 173 pm=mt.pixmap(); //sets the correct pixmap for mimetype
199 if(pm.isNull()) { 174 if(pm.isNull()) {
200 pm = unknownXpm; 175 pm = unknownXpm;
201 } 176 }
202 } 177 }
203 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) 178 if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1)
204 { 179 {
205 // overlay link image 180 // overlay link image
206 pm= Resource::loadPixmap( "folder" ); 181 pm= Resource::loadPixmap( "folder" );
207 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 182 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
208 QPainter painter( &pm ); 183 QPainter painter( &pm );
209 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 184 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
210 pm.setMask( pm.createHeuristicMask( FALSE ) ); 185 pm.setMask( pm.createHeuristicMask( FALSE ) );
211 } 186 }
212 item->setPixmap( 0,pm); 187 item->setPixmap( 0,pm);
213 188
214 } 189 }
215 isDir=FALSE; 190 isDir=FALSE;
216 ++it; 191 ++it;
217 } 192 }
218 193
219 if( path.find("dev",0,TRUE) != -1) 194 if( path.find("dev",0,TRUE) != -1)
220 { 195 {
221 struct stat buf; 196 struct stat buf;
222 dev_t devT; 197 dev_t devT;
223 DIR *dir; 198 DIR *dir;
224 struct dirent *mydirent; 199 struct dirent *mydirent;
225 200
226 if((dir = opendir( path.latin1())) != NULL) 201 if((dir = opendir( path.latin1())) != NULL)
227 while ((mydirent = readdir(dir)) != NULL) 202 while ((mydirent = readdir(dir)) != NULL)
228 { 203 {
229 lstat( mydirent->d_name, &buf); 204 lstat( mydirent->d_name, &buf);
230// qDebug(mydirent->d_name); 205// qDebug(mydirent->d_name);
231 fileL.sprintf("%s", mydirent->d_name); 206 fileL.sprintf("%s", mydirent->d_name);
232 devT = buf.st_dev; 207 devT = buf.st_dev;
233 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); 208 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
234 fileDate.sprintf("%s", ctime( &buf.st_mtime)); 209 fileDate.sprintf("%s", ctime( &buf.st_mtime));
235 if( fileL.find(".") == -1 ) 210 if( fileL.find(".") == -1 )
236 { 211 {
237 item= new QListViewItem( thisView, fileL, fileS, fileDate); 212 item= new QListViewItem( thisView, fileL, fileS, fileDate);
238 pm = unknownXpm; 213 pm = unknownXpm;
239 item->setPixmap( 0,pm); 214 item->setPixmap( 0,pm);
240 } 215 }
241 } 216 }
242 217
243 closedir(dir); 218 closedir(dir);
244 } 219 }
245 220
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index c30d8e0..4480051 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -11,79 +11,76 @@
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#define QT_QWS_OPIE
16 16
17//#include <opie/otabwidget.h> 17//#include <opie/otabwidget.h>
18#include <opie/oprocess.h> 18#include <opie/oprocess.h>
19#include <qpe/ir.h> 19#include <qpe/ir.h>
20 20
21#include <qvariant.h> 21#include <qvariant.h>
22#include <qdialog.h> 22#include <qdialog.h>
23#include <qmainwindow.h> 23#include <qmainwindow.h>
24#include <qstringlist.h> 24#include <qstringlist.h>
25#include <qdir.h> 25#include <qdir.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30 30
31class OTabWidget; 31class OTabWidget;
32class QVBoxLayout; 32class QVBoxLayout;
33class QHBoxLayout; 33class QHBoxLayout;
34class QGridLayout; 34class QGridLayout;
35class QComboBox; 35class QComboBox;
36class QListView; 36class QListView;
37class QListviewItem; 37class QListviewItem;
38class QLabel; 38class QLabel;
39class QProgressBar; 39class QProgressBar;
40class QSpinBox; 40class QSpinBox;
41class QTabWidget; 41class QTabWidget;
42class QWidget; 42class QWidget;
43class QPEToolBar;
44class QPEMenuBar;
45class QPopupMenu; 43class QPopupMenu;
46class QFile; 44class QFile;
47class QListViewItem; 45class QListViewItem;
48class QLineEdit; 46class QLineEdit;
49class MenuButton; 47class MenuButton;
50 48
51//class QPushButton;
52class QToolButton; 49class QToolButton;
53class Ir; 50class Ir;
54 51
55class AdvancedFm : public QMainWindow 52class AdvancedFm : public QMainWindow
56{ 53{
57 Q_OBJECT 54 Q_OBJECT
58public: 55public:
59 AdvancedFm(); 56 AdvancedFm();
60 ~AdvancedFm(); 57 ~AdvancedFm();
61protected slots: 58protected slots:
62 void selectAll(); 59 void selectAll();
63 void addToDocs(); 60 void addToDocs();
64 void doDirChange(); 61 void doDirChange();
65 void mkDir(); 62 void mkDir();
66 void del(); 63 void del();
67 void rn(); 64 void rn();
68 void populateView(); 65 void populateView();
69 void rePopulate(); 66 void rePopulate();
70 void showHidden(); 67 void showHidden();
71 void showMenuHidden(); 68 void showMenuHidden();
72 void writeConfig(); 69 void writeConfig();
73 void readConfig(); 70 void readConfig();
74 void ListClicked(QListViewItem *); 71 void ListClicked(QListViewItem *);
75 void ListPressed( int, QListViewItem *, const QPoint&, int); 72 void ListPressed( int, QListViewItem *, const QPoint&, int);
76 void makeDir(); 73 void makeDir();
77 void doDelete(); 74 void doDelete();
78 void tabChanged(QWidget*); 75 void tabChanged(QWidget*);
79 void cleanUp(); 76 void cleanUp();
80 void renameIt(); 77 void renameIt();
81 void runThis(); 78 void runThis();
82 void runText(); 79 void runText();
83 void filePerms(); 80 void filePerms();
84 void doProperties(); 81 void doProperties();
85 void runCommand(); 82 void runCommand();
86 void runCommandStd(); 83 void runCommandStd();
87 QStringList getPath(); 84 QStringList getPath();
88 void mkSym(); 85 void mkSym();
89 void switchToLocalTab(); 86 void switchToLocalTab();
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 1a7a6d7..eb2bcd8 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,170 +1,164 @@
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 <opie/otabwidget.h> 14#include <opie/otabwidget.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include <qpe/qpemenubar.h>
17#include <qpe/qpetoolbar.h>
18#include <qpe/resource.h> 16#include <qpe/resource.h>
19#include <qpe/menubutton.h> 17#include <qpe/menubutton.h>
20#include <qpe/config.h>
21 18
22#include <qlayout.h> 19#include <qlayout.h>
23#include <qpixmap.h> 20#include <qhbox.h>
21#include <qmenubar.h>
24#include <qcombobox.h> 22#include <qcombobox.h>
25#include <qpopupmenu.h>
26#include <qtabwidget.h>
27#include <qtoolbutton.h> 23#include <qtoolbutton.h>
28#include <qlineedit.h> 24#include <qlineedit.h>
29#include <qlistview.h> 25#include <qlistview.h>
30 26
31#include <sys/utsname.h> 27#include <sys/utsname.h>
32 28
33 29
34void AdvancedFm::init() { 30void AdvancedFm::init() {
35#if defined(QT_QWS_OPIE) 31#if defined(QT_QWS_OPIE)
36 qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!"); 32 qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!");
37#endif 33#endif
38 setCaption( tr( "AdvancedFm" ) ); 34 setCaption( tr( "AdvancedFm" ) );
39 35
40 QGridLayout *layout = new QGridLayout( this ); 36 QVBoxLayout *layout = new QVBoxLayout( this );
41 layout->setSpacing( 2); 37 layout->setSpacing( 2);
42 layout->setMargin( 2); 38 layout->setMargin( 2);
43 39
44 40
45 QPEMenuBar *menuBar = new QPEMenuBar(this); 41 QMenuBar *menuBar = new QMenuBar(this);
46 fileMenu = new QPopupMenu( this ); 42 fileMenu = new QPopupMenu( this );
47 viewMenu = new QPopupMenu( this ); 43 viewMenu = new QPopupMenu( this );
48// customDirMenu = new QPopupMenu( this ); 44// customDirMenu = new QPopupMenu( this );
49 45
50 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); 46 layout->addWidget( menuBar );
51 47
52 menuBar->insertItem( tr( "File" ), fileMenu); 48 menuBar->insertItem( tr( "File" ), fileMenu);
53 menuBar->insertItem( tr( "View" ), viewMenu); 49 menuBar->insertItem( tr( "View" ), viewMenu);
54// menuBar->insertItem( tr( "^" ), customDirMenu);
55 50
56 cdUpButton = new QToolButton( this,"cdUpButton"); 51 cdUpButton = new QToolButton( 0,"cdUpButton");
57 cdUpButton->setPixmap(Resource::loadPixmap("up")); 52 cdUpButton->setPixmap(Resource::loadPixmap("up"));
58 cdUpButton->setFixedSize( QSize( 20, 20 ) ); 53 cdUpButton->setAutoRaise( true );
59 layout->addMultiCellWidget( cdUpButton , 0, 0, 2, 2); 54 menuBar->insertItem( cdUpButton );
60 55
61 menuButton = new MenuButton(this);
62 menuButton->setFixedSize( QSize( 20, 20 ) );
63 layout->addMultiCellWidget( menuButton , 0, 0, 3, 3);
64 56
65 qpeDirButton= new QToolButton(this,"QPEButton"); 57 QHBox *lineBox = new QHBox( this );
58
59 qpeDirButton= new QToolButton( 0,"QPEButton");
66 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); 60 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
67 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 61 qpeDirButton->setAutoRaise( true );
68 layout->addMultiCellWidget( qpeDirButton , 0, 0, 4, 4); 62 menuBar->insertItem( qpeDirButton );
69 63
70 cfButton = new QToolButton( this,"CFButton"); 64 cfButton = new QToolButton( 0, "CFButton");
71 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 65 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
72 cfButton ->setFixedSize( QSize( 20, 20 ) ); 66 cfButton->setAutoRaise( true );
73 layout->addMultiCellWidget( cfButton , 0, 0, 5, 5); 67 menuBar->insertItem( cfButton );
74 68
75 sdButton = new QToolButton( this,"SDButton"); 69 sdButton = new QToolButton( 0, "SDButton");
76 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 70 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
77 sdButton->setFixedSize( QSize( 20, 20 ) ); 71 sdButton->setAutoRaise( true );
78 layout->addMultiCellWidget( sdButton , 0, 0, 6, 6); 72 menuBar->insertItem( sdButton );
79
80 73
81 docButton = new QToolButton( this,"docsButton"); 74 docButton = new QToolButton( 0,"docsButton");
82 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 75 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
83 docButton->setFixedSize( QSize( 20, 20 ) ); 76 docButton->setAutoRaise( true );
84 layout->addMultiCellWidget( docButton, 0, 0, 7, 7); 77 menuBar->insertItem( docButton );
85 78
86 homeButton = new QToolButton( this,"homeButton"); 79 homeButton = new QToolButton( 0, "homeButton");
87 homeButton->setPixmap(Resource::loadPixmap("home")); 80 homeButton->setPixmap(Resource::loadPixmap("home"));
88 homeButton->setFixedSize( QSize( 20, 20 ) ); 81 homeButton->setAutoRaise( true );
89 layout->addMultiCellWidget( homeButton, 0, 0, 8, 8); 82 menuBar->insertItem( homeButton );
90 83
91 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); 84 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
92 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 85 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
93 fileMenu->insertSeparator(); 86 fileMenu->insertSeparator();
94 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); 87 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() ));
95 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); 88 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() ));
96 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); 89 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() ));
97 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); 90 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() ));
98 fileMenu->insertSeparator(); 91 fileMenu->insertSeparator();
99 fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); 92 fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() ));
100 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); 93 fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() ));
101 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); 94 fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() ));
102 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); 95 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() ));
103 fileMenu->setCheckable(TRUE); 96 fileMenu->setCheckable(TRUE);
104 97
105 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 98 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
106 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 99 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
107// viewMenu->insertSeparator(); 100// viewMenu->insertSeparator();
108// viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); 101// viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
109 viewMenu->setCheckable(TRUE); 102 viewMenu->setCheckable(TRUE);
110 103
111 s_addBookmark = tr("Bookmark Directory"); 104 s_addBookmark = tr("Bookmark Directory");
112 s_removeBookmark = tr("Remove Current Directory from Bookmarks"); 105 s_removeBookmark = tr("Remove Current Directory from Bookmarks");
113 106
114 menuButton->setUseLabel(false);
115 menuButton->insertItem( s_addBookmark);
116 menuButton->insertItem( s_removeBookmark);
117 menuButton->insertSeparator();
118// menuButton->insertItem(""); 107// menuButton->insertItem("");
119 108
120// customDirMenu->insertItem(tr("Add This Directory")); 109// customDirMenu->insertItem(tr("Add This Directory"));
121// customDirMenu->insertItem(tr("Remove This Directory")); 110// customDirMenu->insertItem(tr("Remove This Directory"));
122// customDirMenu->insertSeparator(); 111// customDirMenu->insertSeparator();
123 112
124 customDirsToMenu(); 113 customDirsToMenu();
125 114
126 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); 115 menuButton = new MenuButton( lineBox );
127 currentPathCombo->setEditable(TRUE);
128 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8);
129 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
130 116
117 menuButton->setUseLabel(false);
118 menuButton->setMaximumWidth( 20 );
119 menuButton->insertItem( s_addBookmark);
120 menuButton->insertItem( s_removeBookmark);
121 menuButton->insertSeparator();
122
123 currentPathCombo = new QComboBox( FALSE, lineBox, "currentPathCombo" );
124 currentPathCombo->setEditable(TRUE);
131 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 125 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
132 126
133 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 8); 127 layout->addWidget( lineBox );
134 128
135 129
136 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab); 130 TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab);
137// TabWidget = new QTabWidget( this, "TabWidget" ); 131// TabWidget = new QTabWidget( this, "TabWidget" );
138 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 8); 132 layout->addWidget( TabWidget, 4 );
139 133
140 tab = new QWidget( TabWidget, "tab" ); 134 tab = new QWidget( TabWidget, "tab" );
141 tabLayout = new QGridLayout( tab ); 135 tabLayout = new QGridLayout( tab );
142 tabLayout->setSpacing( 2); 136 tabLayout->setSpacing( 2);
143 tabLayout->setMargin( 2); 137 tabLayout->setMargin( 2);
144 138
145 Local_View = new QListView( tab, "Local_View" ); 139 Local_View = new QListView( tab, "Local_View" );
146 Local_View->addColumn( tr("File"),130); 140 Local_View->addColumn( tr("File"),130);
147 Local_View->addColumn( tr("Size"),-1); 141 Local_View->addColumn( tr("Size"),-1);
148 Local_View->setColumnAlignment(1,QListView::AlignRight); 142 Local_View->setColumnAlignment(1,QListView::AlignRight);
149 Local_View->addColumn( tr("Date"),-1); 143 Local_View->addColumn( tr("Date"),-1);
150 Local_View->setColumnAlignment(2,QListView::AlignRight); 144 Local_View->setColumnAlignment(2,QListView::AlignRight);
151 Local_View->setAllColumnsShowFocus(TRUE); 145 Local_View->setAllColumnsShowFocus(TRUE);
152 Local_View->setMultiSelection( TRUE ); 146 Local_View->setMultiSelection( TRUE );
153 Local_View->setSelectionMode(QListView::Extended); 147 Local_View->setSelectionMode(QListView::Extended);
154 148
155 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 149 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
156 150
157 tabLayout->addWidget( Local_View, 0, 0 ); 151 tabLayout->addWidget( Local_View, 0, 0 );
158 152
159 TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1")); 153 TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1"));
160// TabWidget->insertTab( tab, tr("1")); 154// TabWidget->insertTab( tab, tr("1"));
161 155
162 tab_2 = new QWidget( TabWidget, "tab_2" ); 156 tab_2 = new QWidget( TabWidget, "tab_2" );
163 tabLayout_2 = new QGridLayout( tab_2 ); 157 tabLayout_2 = new QGridLayout( tab_2 );
164 tabLayout_2->setSpacing( 2); 158 tabLayout_2->setSpacing( 2);
165 tabLayout_2->setMargin( 2); 159 tabLayout_2->setMargin( 2);
166 160
167 Remote_View = new QListView( tab_2, "Remote_View" ); 161 Remote_View = new QListView( tab_2, "Remote_View" );
168 Remote_View->addColumn( tr("File"),130); 162 Remote_View->addColumn( tr("File"),130);
169 Remote_View->addColumn( tr("Size"),-1); 163 Remote_View->addColumn( tr("Size"),-1);
170 Remote_View->setColumnAlignment(1,QListView::AlignRight); 164 Remote_View->setColumnAlignment(1,QListView::AlignRight);
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index eae86a4..575833a 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -1,54 +1,52 @@
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#include "advancedfm.h" 12#include "advancedfm.h"
13#include "output.h" 13#include "output.h"
14#include "filePermissions.h" 14#include "filePermissions.h"
15 15
16#include <opie/otabwidget.h> 16#include <opie/otabwidget.h>
17#include <opie/oprocess.h> 17#include <opie/oprocess.h>
18 18
19#include <qpe/lnkproperties.h> 19#include <qpe/lnkproperties.h>
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/qpemenubar.h>
22#include <qpe/qpetoolbar.h>
23#include <qpe/resource.h> 21#include <qpe/resource.h>
24#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
25#include <qpe/applnk.h> 23#include <qpe/applnk.h>
26#include <qpe/ir.h> 24#include <qpe/ir.h>
27 25
28#include <qmessagebox.h> 26#include <qmessagebox.h>
29#include <qmultilineedit.h> 27#include <qmultilineedit.h>
30 28
31#include <qstring.h> 29#include <qstring.h>
32 30
33#include <qlayout.h> 31#include <qlayout.h>
34#include <qpixmap.h> 32#include <qpixmap.h>
35#include <qcombobox.h> 33#include <qcombobox.h>
36#include <qpopupmenu.h> 34#include <qpopupmenu.h>
37#include <qtabwidget.h> 35#include <qtabwidget.h>
38#include <qtoolbutton.h> 36#include <qtoolbutton.h>
39#include <qtabwidget.h> 37#include <qtabwidget.h>
40#include <qlineedit.h> 38#include <qlineedit.h>
41#include <qlistview.h> 39#include <qlistview.h>
42 40
43#include <stdlib.h> 41#include <stdlib.h>
44#include <unistd.h> 42#include <unistd.h>
45#include <sys/stat.h> 43#include <sys/stat.h>
46#include <dirent.h> 44#include <dirent.h>
47#include <sys/sendfile.h> 45#include <sys/sendfile.h>
48#include <fcntl.h> 46#include <fcntl.h>
49 47
50void AdvancedFm::doDirChange() 48void AdvancedFm::doDirChange()
51{ 49{
52 ListClicked( CurrentView()->currentItem()); 50 ListClicked( CurrentView()->currentItem());
53} 51}
54 52
@@ -745,65 +743,65 @@ void AdvancedFm::selectAll()
745 743
746void AdvancedFm::startProcess(const QString & cmd) 744void AdvancedFm::startProcess(const QString & cmd)
747{ 745{
748 QStringList command; 746 QStringList command;
749 OProcess *process; 747 OProcess *process;
750 process = new OProcess(); 748 process = new OProcess();
751 connect(process, SIGNAL(processExited(OProcess *)), 749 connect(process, SIGNAL(processExited(OProcess *)),
752 this, SLOT( processEnded(OProcess *))); 750 this, SLOT( processEnded(OProcess *)));
753 751
754 connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), 752 connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)),
755 this, SLOT( oprocessStderr(OProcess *, char *, int))); 753 this, SLOT( oprocessStderr(OProcess *, char *, int)));
756 754
757 command << "/bin/sh"; 755 command << "/bin/sh";
758 command << "-c"; 756 command << "-c";
759 command << cmd.latin1(); 757 command << cmd.latin1();
760 *process << command; 758 *process << command;
761 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 759 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
762 qDebug("could not start process"); 760 qDebug("could not start process");
763} 761}
764 762
765void AdvancedFm::processEnded(OProcess *) 763void AdvancedFm::processEnded(OProcess *)
766{ 764{
767// populateLocalView(); 765// populateLocalView();
768 populateView(); 766 populateView();
769} 767}
770 768
771void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) { 769void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) {
772 qWarning("received stderrt %d bytes", buflen); 770 qWarning("received stderrt %d bytes", buflen);
773 771
774 QString lineStr = buffer; 772 QString lineStr = buffer;
775// lineStr=lineStr.left(lineStr.length()-1); 773// lineStr=lineStr.left(lineStr.length()-1);
776 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 774 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
777 775
778// OutputEdit->append(lineStr); 776// OutputEdit->append(lineStr);
779// OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 777// OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
780} 778}
781 779
782bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) 780bool AdvancedFm::eventFilter( QObject * o, QEvent * e )
783{ 781{
784 if ( o->inherits( "QLineEdit" ) ) 782 if ( o->inherits( "QLineEdit" ) )
785 { 783 {
786 if ( e->type() == QEvent::KeyPress ) 784 if ( e->type() == QEvent::KeyPress )
787 { 785 {
788 QKeyEvent *ke = (QKeyEvent*)e; 786 QKeyEvent *ke = (QKeyEvent*)e;
789 if ( ke->key() == Key_Return || 787 if ( ke->key() == Key_Return ||
790 ke->key() == Key_Enter ) 788 ke->key() == Key_Enter )
791 { 789 {
792 okRename(); 790 okRename();
793 return true; 791 return true;
794 } 792 }
795 else if ( ke->key() == Key_Escape ) 793 else if ( ke->key() == Key_Escape )
796 { 794 {
797 cancelRename(); 795 cancelRename();
798 return true; 796 return true;
799 } 797 }
800 } 798 }
801 else if ( e->type() == QEvent::FocusOut ) 799 else if ( e->type() == QEvent::FocusOut )
802 { 800 {
803 cancelRename(); 801 cancelRename();
804 return true; 802 return true;
805 } 803 }
806 } 804 }
807 if ( o->inherits( "QListView" ) ) 805 if ( o->inherits( "QListView" ) )
808 { 806 {
809 if ( e->type() == QEvent::FocusOut ) 807 if ( e->type() == QEvent::FocusOut )