summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp36
-rw-r--r--noncore/apps/advancedfm/advancedfm.h6
2 files changed, 28 insertions, 14 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 1287c57..9e38d14 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -48,130 +48,142 @@
48#include <qpopupmenu.h> 48#include <qpopupmenu.h>
49#include <qlistview.h> 49#include <qlistview.h>
50#include <qmainwindow.h> 50#include <qmainwindow.h>
51#include <qlabel.h> 51#include <qlabel.h>
52#include <qprogressbar.h> 52#include <qprogressbar.h>
53#include <qspinbox.h> 53#include <qspinbox.h>
54#include <qtabwidget.h> 54#include <qtabwidget.h>
55#include <qwidget.h> 55#include <qwidget.h>
56#include <qlayout.h> 56#include <qlayout.h>
57#include <qimage.h> 57#include <qimage.h>
58#include <qpixmap.h> 58#include <qpixmap.h>
59#include <qmessagebox.h> 59#include <qmessagebox.h>
60#include <qlineedit.h> 60#include <qlineedit.h>
61#include <qregexp.h> 61#include <qregexp.h>
62 62
63#include <unistd.h> 63#include <unistd.h>
64#include <stdlib.h> 64#include <stdlib.h>
65#include <sys/stat.h> 65#include <sys/stat.h>
66#include <dirent.h> 66#include <dirent.h>
67#include <stdio.h> 67#include <stdio.h>
68#include <time.h> 68#include <time.h>
69#include <fcntl.h> 69#include <fcntl.h>
70#include <mntent.h> 70#include <mntent.h>
71#include <string.h> 71#include <string.h>
72#include <errno.h> 72#include <errno.h>
73 73
74AdvancedFm::AdvancedFm( ) 74AdvancedFm::AdvancedFm( )
75 : QMainWindow( ) 75 : QMainWindow( )
76{ 76{
77 setCaption( tr( "AdvancedFm" ) ); 77 setCaption( tr( "AdvancedFm" ) );
78// menuTimer( this ); 78// menuTimer( this );
79 79
80 QGridLayout *layout = new QGridLayout( this ); 80 QGridLayout *layout = new QGridLayout( this );
81 layout->setSpacing( 2); 81 layout->setSpacing( 2);
82 layout->setMargin( 2); 82 layout->setMargin( 2);
83 83
84 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 84 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
85 85
86 QPEMenuBar *menuBar = new QPEMenuBar(this); 86 QPEMenuBar *menuBar = new QPEMenuBar(this);
87// fileMenu = new QPopupMenu( this ); 87// fileMenu = new QPopupMenu( this );
88 fileMenu = new QPopupMenu( this ); 88 fileMenu = new QPopupMenu( this );
89 viewMenu = new QPopupMenu( this ); 89 viewMenu = new QPopupMenu( this );
90 90
91 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); 91 layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 );
92 92
93 menuBar->insertItem( tr( "File" ), fileMenu); 93 menuBar->insertItem( tr( "File" ), fileMenu);
94 menuBar->insertItem( tr( "View" ), viewMenu); 94 menuBar->insertItem( tr( "View" ), viewMenu);
95 95
96 qpeDirButton= new QPushButton(Resource::loadIconSet("launcher/opielogo16x16"),"",this,"QPEButton"); 96 qpeDirButton= new QToolButton(this,"QPEButton");
97 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
98// qpeDirButton= new QPushButton(Resource::loadIconSet("launcher/opielogo16x16"),"",this,"QPEButton");
97 qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); 99 qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
98 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); 100 connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
99 qpeDirButton->setFlat(TRUE); 101 //qpeDirButton->setFlat(TRUE);
100 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); 102 layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
101 103
102 cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton"); 104 cfButton = new QToolButton( this,"CFButton");
105 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
106// cfButton = new QPushButton(Resource::loadIconSet("cardmon/pcmcia"),"",this,"CFButton");
103 cfButton ->setFixedSize( QSize( 20, 20 ) ); 107 cfButton ->setFixedSize( QSize( 20, 20 ) );
104 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); 108 connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) );
105 cfButton->setFlat(TRUE); 109 //cfButton->setFlat(TRUE);
106 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); 110 layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
107 111
108 sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton"); 112 sdButton = new QToolButton( this,"SDButton");
113 sdButton->setPixmap(Resource::loadPixmap("sdmon/sdcard"));
114// sdButton = new QPushButton(Resource::loadIconSet("sdmon/sdcard"),"",this,"SDButton");
109 sdButton->setFixedSize( QSize( 20, 20 ) ); 115 sdButton->setFixedSize( QSize( 20, 20 ) );
110 connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) ); 116 connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) );
111 sdButton->setFlat(TRUE); 117// sdButton->setFlat(TRUE);
112 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); 118 layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
113 119
114 cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton"); 120 cdUpButton = new QToolButton( this,"cdUpButton");
121 cdUpButton->setPixmap(Resource::loadPixmap("up"));
122// cdUpButton = new QPushButton(Resource::loadIconSet("up"),"",this,"cdUpButton");
115 cdUpButton ->setFixedSize( QSize( 20, 20 ) ); 123 cdUpButton ->setFixedSize( QSize( 20, 20 ) );
116 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); 124 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) );
117 cdUpButton ->setFlat(TRUE); 125 //cdUpButton ->setFlat(TRUE);
118 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); 126 layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
119 127
120 docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); 128 docButton = new QToolButton( this,"docsButton");
129 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
130// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
121 docButton->setFixedSize( QSize( 20, 20 ) ); 131 docButton->setFixedSize( QSize( 20, 20 ) );
122 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); 132 connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
123 docButton->setFlat(TRUE); 133// docButton->setFlat(TRUE);
124 layout->addMultiCellWidget( docButton, 0, 0, 6, 6); 134 layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
125 135
126 homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton"); 136 homeButton = new QToolButton( this,"homeButton");
137 homeButton->setPixmap(Resource::loadPixmap("home"));
138// homeButton = new QPushButton( Resource::loadIconSet("home"),"",this,"homeButton");
127 homeButton->setFixedSize( QSize( 20, 20 ) ); 139 homeButton->setFixedSize( QSize( 20, 20 ) );
128 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 140 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
129 homeButton->setFlat(TRUE); 141// homeButton->setFlat(TRUE);
130 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); 142 layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
131// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); 143// fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
132// fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); 144// fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() ));
133// fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); 145// fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() ));
134 146
135 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 147 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
136 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 148 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
137 fileMenu->insertSeparator(); 149 fileMenu->insertSeparator();
138 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); 150 fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() ));
139 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); 151 fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() ));
140 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); 152 fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() ));
141 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); 153 fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() ));
142 fileMenu->insertSeparator(); 154 fileMenu->insertSeparator();
143 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); 155 fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() ));
144 fileMenu->setCheckable(TRUE); 156 fileMenu->setCheckable(TRUE);
145 157
146 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 158 viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
147 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 159 viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
148 viewMenu->insertSeparator(); 160 viewMenu->insertSeparator();
149 viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); 161 viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
150 viewMenu->setCheckable(TRUE); 162 viewMenu->setCheckable(TRUE);
151 163
152 164
153 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); 165 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
154 currentPathCombo->setEditable(TRUE); 166 currentPathCombo->setEditable(TRUE);
155 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); 167 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
156 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 168 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
157 169
158 connect( currentPathCombo, SIGNAL( activated( const QString & ) ), 170 connect( currentPathCombo, SIGNAL( activated( const QString & ) ),
159 this, SLOT( currentPathComboActivated( const QString & ) ) ); 171 this, SLOT( currentPathComboActivated( const QString & ) ) );
160 172
161 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 173 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
162 this,SLOT(currentPathComboChanged())); 174 this,SLOT(currentPathComboChanged()));
163 175
164 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 176 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
165 177
166 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); 178 layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
167 179
168 180
169 TabWidget = new QTabWidget( this, "TabWidget" ); 181 TabWidget = new QTabWidget( this, "TabWidget" );
170 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); 182 layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7);
171 183
172 tab = new QWidget( TabWidget, "tab" ); 184 tab = new QWidget( TabWidget, "tab" );
173 tabLayout = new QGridLayout( tab ); 185 tabLayout = new QGridLayout( tab );
174 tabLayout->setSpacing( 2); 186 tabLayout->setSpacing( 2);
175 tabLayout->setMargin( 2); 187 tabLayout->setMargin( 2);
176 188
177 Local_View = new QListView( tab, "Local_View" ); 189 Local_View = new QListView( tab, "Local_View" );
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 0cf94c6..7335773 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -1,107 +1,109 @@
1/*************************************************************************** 1/***************************************************************************
2 opieftp.h 2 opieftp.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 14
15#include <qpe/ir.h> 15#include <qpe/ir.h>
16 16
17#include <qvariant.h> 17#include <qvariant.h>
18#include <qdialog.h> 18#include <qdialog.h>
19#include <qmainwindow.h> 19#include <qmainwindow.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21#include <qdir.h> 21#include <qdir.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qpoint.h> 23#include <qpoint.h>
24#include <qtimer.h> 24#include <qtimer.h>
25 25
26class QVBoxLayout; 26class QVBoxLayout;
27class QHBoxLayout; 27class QHBoxLayout;
28class QGridLayout; 28class QGridLayout;
29class QComboBox; 29class QComboBox;
30class QListView; 30class QListView;
31class QListviewItem; 31class QListviewItem;
32class QLabel; 32class QLabel;
33class QProgressBar; 33class QProgressBar;
34class QSpinBox; 34class QSpinBox;
35class QTabWidget; 35class QTabWidget;
36class QWidget; 36class QWidget;
37class QPEToolBar; 37class QPEToolBar;
38class QPEMenuBar; 38class QPEMenuBar;
39class QPopupMenu; 39class QPopupMenu;
40class QFile; 40class QFile;
41class QListViewItem; 41class QListViewItem;
42class QLineEdit; 42class QLineEdit;
43class QPushButton; 43//class QPushButton;
44class QToolButton;
44class Ir; 45class Ir;
45 46
46class AdvancedFm : public QMainWindow 47class AdvancedFm : public QMainWindow
47{ 48{
48 Q_OBJECT 49 Q_OBJECT
49public: 50public:
50 AdvancedFm(); 51 AdvancedFm();
51 ~AdvancedFm(); 52 ~AdvancedFm();
52 53
53 QTabWidget *TabWidget; 54 QTabWidget *TabWidget;
54 QWidget *tab, *tab_2, *tab_3; 55 QWidget *tab, *tab_2, *tab_3;
55 QListView *Local_View, *Remote_View; 56 QListView *Local_View, *Remote_View;
56 57
57 QLineEdit *currentPathEdit; 58 QLineEdit *currentPathEdit;
58 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu; 59 QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
59 QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; 60 QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
61// QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
60 QDir currentDir, currentRemoteDir; 62 QDir currentDir, currentRemoteDir;
61 QComboBox *currentPathCombo; 63 QComboBox *currentPathCombo;
62 QString filterStr; 64 QString filterStr;
63 QListViewItem * item; 65 QListViewItem * item;
64 bool b; 66 bool b;
65 QStringList fileSystemTypeList, fsList; 67 QStringList fileSystemTypeList, fsList;
66 int currentServerConfig; 68 int currentServerConfig;
67protected slots: 69protected slots:
68 void doLocalCd(); 70 void doLocalCd();
69 void doRemoteCd(); 71 void doRemoteCd();
70// void copy(); 72// void copy();
71 void mkDir(); 73 void mkDir();
72 void del(); 74 void del();
73 void rn(); 75 void rn();
74 void populateLocalView(); 76 void populateLocalView();
75 void populateRemoteView(); 77 void populateRemoteView();
76 void showHidden(); 78 void showHidden();
77 void showRemoteHidden(); 79 void showRemoteHidden();
78 void writeConfig(); 80 void writeConfig();
79 void readConfig(); 81 void readConfig();
80 void localListClicked(QListViewItem *); 82 void localListClicked(QListViewItem *);
81 void remoteListClicked(QListViewItem *); 83 void remoteListClicked(QListViewItem *);
82 void localListPressed( int, QListViewItem *, const QPoint&, int); 84 void localListPressed( int, QListViewItem *, const QPoint&, int);
83 void remoteListPressed( int, QListViewItem *, const QPoint&, int); 85 void remoteListPressed( int, QListViewItem *, const QPoint&, int);
84 void localMakDir(); 86 void localMakDir();
85 void localDelete(); 87 void localDelete();
86 void remoteMakDir(); 88 void remoteMakDir();
87 void remoteDelete(); 89 void remoteDelete();
88/* bool remoteDirList(const QString &); */ 90/* bool remoteDirList(const QString &); */
89/* bool remoteChDir(const QString &); */ 91/* bool remoteChDir(const QString &); */
90 void tabChanged(QWidget*); 92 void tabChanged(QWidget*);
91 void cleanUp(); 93 void cleanUp();
92 void remoteRename(); 94 void remoteRename();
93 void localRename(); 95 void localRename();
94 void runThis(); 96 void runThis();
95 void runText(); 97 void runText();
96 void filePerms(); 98 void filePerms();
97 void doProperties(); 99 void doProperties();
98 void runCommand(); 100 void runCommand();
99 void runCommandStd(); 101 void runCommandStd();
100 QStringList getPath(); 102 QStringList getPath();
101 void mkSym(); 103 void mkSym();
102 void switchToLocalTab(); 104 void switchToLocalTab();
103 void switchToRemoteTab(); 105 void switchToRemoteTab();
104 106
105protected: 107protected:
106 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; 108 QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3;
107 QStringList remoteDirPathStringList, localDirPathStringList; 109 QStringList remoteDirPathStringList, localDirPathStringList;