author | llornkcor <llornkcor> | 2002-09-23 13:38:57 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-23 13:38:57 (UTC) |
commit | 7c3194a651beca5ba43bc29d87cc96b55761b7bc (patch) (unidiff) | |
tree | c2860d2c826b62ce6737681ac43c78197448931b | |
parent | cfeb1373faa2b46011ecdb294d0ce4e557ea988f (diff) | |
download | opie-7c3194a651beca5ba43bc29d87cc96b55761b7bc.zip opie-7c3194a651beca5ba43bc29d87cc96b55761b7bc.tar.gz opie-7c3194a651beca5ba43bc29d87cc96b55761b7bc.tar.bz2 |
start changing things around
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 413 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 8 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 236 |
4 files changed, 337 insertions, 322 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index c054465..8f49a53 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -1,8 +1,8 @@ | |||
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 * |
@@ -19,28 +19,27 @@ | |||
19 | 19 | ||
20 | // #include <opie/ofileselector.h> | 20 | // #include <opie/ofileselector.h> |
21 | // #include <opie/ofiledialog.h> | 21 | // #include <opie/ofiledialog.h> |
22 | 22 | ||
23 | |||
24 | #include <qpe/lnkproperties.h> | 23 | #include <qpe/lnkproperties.h> |
25 | #include <qpe/filemanager.h> | 24 | #include <qpe/filemanager.h> |
26 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
27 | #include <qpe/qpemenubar.h> | 26 | #include <qpe/qpemenubar.h> |
28 | #include <qpe/qpetoolbar.h> | 27 | #include <qpe/qpetoolbar.h> |
29 | #include <qpe/qpeapplication.h> | 28 | #include <qpe/qpeapplication.h> |
30 | #include <qpe/resource.h> | ||
31 | #include <qpe/qcopenvelope_qws.h> | 29 | #include <qpe/qcopenvelope_qws.h> |
32 | #include <qpe/config.h> | 30 | #include <qpe/config.h> |
33 | #include <qpe/mimetype.h> | 31 | #include <qpe/mimetype.h> |
34 | #include <qpe/applnk.h> | 32 | #include <qpe/applnk.h> |
35 | #include <qpe/ir.h> | 33 | #include <qpe/ir.h> |
34 | #include <qpe/resource.h> | ||
36 | 35 | ||
37 | //#include <opie/ofileselector.h> | 36 | //#include <opie/ofileselector.h> |
38 | #include <qmultilineedit.h> | 37 | #include <qmultilineedit.h> |
39 | 38 | ||
39 | #include <qtabwidget.h> | ||
40 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qtoolbutton.h> | ||
43 | #include <qdatetime.h> | 42 | #include <qdatetime.h> |
44 | #include <qdir.h> | 43 | #include <qdir.h> |
45 | #include <qfile.h> | 44 | #include <qfile.h> |
46 | #include <qstring.h> | 45 | #include <qstring.h> |
@@ -50,9 +49,8 @@ | |||
50 | #include <qmainwindow.h> | 49 | #include <qmainwindow.h> |
51 | #include <qlabel.h> | 50 | #include <qlabel.h> |
52 | #include <qprogressbar.h> | 51 | #include <qprogressbar.h> |
53 | #include <qspinbox.h> | 52 | #include <qspinbox.h> |
54 | #include <qtabwidget.h> | ||
55 | #include <qwidget.h> | 53 | #include <qwidget.h> |
56 | #include <qlayout.h> | 54 | #include <qlayout.h> |
57 | #include <qimage.h> | 55 | #include <qimage.h> |
58 | #include <qpixmap.h> | 56 | #include <qpixmap.h> |
@@ -74,218 +72,20 @@ | |||
74 | #include <mntent.h> | 72 | #include <mntent.h> |
75 | #include <sys/utsname.h> | 73 | #include <sys/utsname.h> |
76 | 74 | ||
77 | AdvancedFm::AdvancedFm( ) | 75 | AdvancedFm::AdvancedFm( ) |
78 | : QMainWindow( ) | 76 | : QMainWindow( ) { |
79 | { | 77 | init(); |
80 | setCaption( tr( "AdvancedFm" ) ); | ||
81 | |||
82 | QGridLayout *layout = new QGridLayout( this ); | ||
83 | layout->setSpacing( 2); | ||
84 | layout->setMargin( 2); | ||
85 | |||
86 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | ||
87 | |||
88 | QPEMenuBar *menuBar = new QPEMenuBar(this); | ||
89 | fileMenu = new QPopupMenu( this ); | ||
90 | viewMenu = new QPopupMenu( this ); | ||
91 | |||
92 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); | ||
93 | |||
94 | menuBar->insertItem( tr( "File" ), fileMenu); | ||
95 | menuBar->insertItem( tr( "View" ), viewMenu); | ||
96 | |||
97 | qpeDirButton= new QToolButton(this,"QPEButton"); | ||
98 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | ||
99 | qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); | ||
100 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); | ||
101 | layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); | ||
102 | |||
103 | cfButton = new QToolButton( this,"CFButton"); | ||
104 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | ||
105 | cfButton ->setFixedSize( QSize( 20, 20 ) ); | ||
106 | connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); | ||
107 | layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); | ||
108 | |||
109 | sdButton = new QToolButton( this,"SDButton"); | ||
110 | sdButton->setPixmap(Resource::loadPixmap("sdmon/sdcard")); | ||
111 | sdButton->setFixedSize( QSize( 20, 20 ) ); | ||
112 | connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) ); | ||
113 | layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); | ||
114 | |||
115 | cdUpButton = new QToolButton( this,"cdUpButton"); | ||
116 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | ||
117 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | ||
118 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | ||
119 | layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); | ||
120 | |||
121 | docButton = new QToolButton( this,"docsButton"); | ||
122 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | ||
123 | docButton->setFixedSize( QSize( 20, 20 ) ); | ||
124 | connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | ||
125 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6); | ||
126 | |||
127 | homeButton = new QToolButton( this,"homeButton"); | ||
128 | homeButton->setPixmap(Resource::loadPixmap("home")); | ||
129 | homeButton->setFixedSize( QSize( 20, 20 ) ); | ||
130 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | ||
131 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); | ||
132 | |||
133 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | ||
134 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | ||
135 | fileMenu->insertSeparator(); | ||
136 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | ||
137 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | ||
138 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | ||
139 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | ||
140 | fileMenu->insertSeparator(); | ||
141 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | ||
142 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | ||
143 | fileMenu->setCheckable(TRUE); | ||
144 | |||
145 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | ||
146 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | ||
147 | viewMenu->insertSeparator(); | ||
148 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | ||
149 | viewMenu->setCheckable(TRUE); | ||
150 | |||
151 | |||
152 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | ||
153 | currentPathCombo->setEditable(TRUE); | ||
154 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | ||
155 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | ||
156 | |||
157 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | ||
158 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | ||
159 | |||
160 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | ||
161 | this,SLOT(currentPathComboChanged())); | ||
162 | |||
163 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | ||
164 | |||
165 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | ||
166 | |||
167 | |||
168 | TabWidget = new QTabWidget( this, "TabWidget" ); | ||
169 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); | ||
170 | |||
171 | tab = new QWidget( TabWidget, "tab" ); | ||
172 | tabLayout = new QGridLayout( tab ); | ||
173 | tabLayout->setSpacing( 2); | ||
174 | tabLayout->setMargin( 2); | ||
175 | |||
176 | Local_View = new QListView( tab, "Local_View" ); | ||
177 | Local_View->addColumn( tr("File"),130); | ||
178 | Local_View->addColumn( tr("Size"),-1); | ||
179 | Local_View->setColumnAlignment(1,QListView::AlignRight); | ||
180 | Local_View->addColumn( tr("Date"),-1); | ||
181 | Local_View->setColumnAlignment(2,QListView::AlignRight); | ||
182 | Local_View->setAllColumnsShowFocus(TRUE); | ||
183 | Local_View->setMultiSelection( TRUE ); | ||
184 | Local_View->setSelectionMode(QListView::Extended); | ||
185 | |||
186 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | ||
187 | |||
188 | tabLayout->addWidget( Local_View, 0, 0 ); | ||
189 | |||
190 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | ||
191 | this,SLOT( localListClicked(QListViewItem *)) ); | ||
192 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | ||
193 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); | ||
194 | |||
195 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | ||
196 | |||
197 | TabWidget->insertTab( tab, tr("1")); | ||
198 | |||
199 | tab_2 = new QWidget( TabWidget, "tab_2" ); | ||
200 | tabLayout_2 = new QGridLayout( tab_2 ); | ||
201 | tabLayout_2->setSpacing( 2); | ||
202 | tabLayout_2->setMargin( 2); | ||
203 | |||
204 | Remote_View = new QListView( tab_2, "Remote_View" ); | ||
205 | Remote_View->addColumn( tr("File"),130); | ||
206 | Remote_View->addColumn( tr("Size"),-1); | ||
207 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | ||
208 | Remote_View->addColumn( tr("Date"),-1); | ||
209 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | ||
210 | Remote_View->setAllColumnsShowFocus(TRUE); | ||
211 | Remote_View->setMultiSelection( TRUE ); | ||
212 | Remote_View->setSelectionMode(QListView::Extended); | ||
213 | |||
214 | |||
215 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | ||
216 | |||
217 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | ||
218 | this,SLOT( remoteListClicked(QListViewItem *)) ); | ||
219 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | ||
220 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | ||
221 | |||
222 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | ||
223 | |||
224 | |||
225 | TabWidget->insertTab( tab_2, tr( "2")); | ||
226 | |||
227 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | ||
228 | this,SLOT(tabChanged(QWidget*))); | ||
229 | |||
230 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | ||
231 | tabLayout_3 = new QGridLayout( tab_3 ); | ||
232 | tabLayout_3->setSpacing( 2); | ||
233 | tabLayout_3->setMargin( 2); | ||
234 | |||
235 | |||
236 | // OFileDialog fileDialog; | ||
237 | // fileDialog; | ||
238 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy | ||
239 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); | ||
240 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); | ||
241 | |||
242 | QListView *fileTree; | ||
243 | fileTree = new QListView( tab_3, "tree" ); | ||
244 | |||
245 | |||
246 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | ||
247 | |||
248 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | ||
249 | */ | ||
250 | |||
251 | /////////////// | ||
252 | |||
253 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | ||
254 | if (uname(&name) != -1) { | ||
255 | QString release=name.release; | ||
256 | if(release.find("embedix",0,TRUE) !=-1) { | ||
257 | zaurusDevice=TRUE; | ||
258 | } else { | ||
259 | zaurusDevice=FALSE; | ||
260 | sdButton->hide(); | ||
261 | } | ||
262 | } | ||
263 | |||
264 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | ||
265 | currentDir.setPath( QDir::currentDirPath()); | ||
266 | |||
267 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | ||
268 | currentRemoteDir.setPath( QDir::currentDirPath()); | ||
269 | |||
270 | b = TRUE; | ||
271 | |||
272 | filterStr="*"; | ||
273 | b=FALSE; | ||
274 | |||
275 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | ||
276 | 78 | ||
277 | populateLocalView(); | 79 | populateLocalView(); |
278 | populateRemoteView(); | 80 | populateRemoteView(); |
279 | currentPathCombo->setFocus(); | 81 | currentPathCombo->setFocus(); |
280 | } | 82 | } |
281 | 83 | ||
282 | AdvancedFm::~AdvancedFm() | 84 | AdvancedFm::~AdvancedFm() { |
283 | { | ||
284 | } | 85 | } |
285 | 86 | ||
286 | void AdvancedFm::cleanUp() | 87 | void AdvancedFm::cleanUp() { |
287 | { | ||
288 | QString sfile=QDir::homeDirPath(); | 88 | QString sfile=QDir::homeDirPath(); |
289 | if(sfile.right(1) != "/") | 89 | if(sfile.right(1) != "/") |
290 | sfile+="/._temp"; | 90 | sfile+="/._temp"; |
291 | else | 91 | else |
@@ -294,10 +94,9 @@ void AdvancedFm::cleanUp() | |||
294 | if(file.exists()) | 94 | if(file.exists()) |
295 | file.remove(); | 95 | file.remove(); |
296 | } | 96 | } |
297 | 97 | ||
298 | void AdvancedFm::tabChanged(QWidget *) | 98 | void AdvancedFm::tabChanged(QWidget *) { |
299 | { | ||
300 | if (TabWidget->currentPageIndex() == 0) { | 99 | if (TabWidget->currentPageIndex() == 0) { |
301 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 100 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
302 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 101 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
303 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 102 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
@@ -314,10 +113,9 @@ void AdvancedFm::tabChanged(QWidget *) | |||
314 | } | 113 | } |
315 | } | 114 | } |
316 | 115 | ||
317 | 116 | ||
318 | void AdvancedFm::populateLocalView() | 117 | void AdvancedFm::populateLocalView() { |
319 | { | ||
320 | QPixmap pm; | 118 | QPixmap pm; |
321 | Local_View->clear(); | 119 | Local_View->clear(); |
322 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 120 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
323 | currentDir.setMatchAllDirs(TRUE); | 121 | currentDir.setMatchAllDirs(TRUE); |
@@ -411,10 +209,9 @@ void AdvancedFm::populateLocalView() | |||
411 | fillCombo( (const QString &) currentDir.canonicalPath()); | 209 | fillCombo( (const QString &) currentDir.canonicalPath()); |
412 | } | 210 | } |
413 | 211 | ||
414 | 212 | ||
415 | void AdvancedFm::populateRemoteView() | 213 | void AdvancedFm::populateRemoteView() { |
416 | { | ||
417 | QPixmap pm; | 214 | QPixmap pm; |
418 | Remote_View->clear(); | 215 | Remote_View->clear(); |
419 | currentRemoteDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 216 | currentRemoteDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
420 | currentRemoteDir.setMatchAllDirs(TRUE); | 217 | currentRemoteDir.setMatchAllDirs(TRUE); |
@@ -508,10 +305,9 @@ void AdvancedFm::populateRemoteView() | |||
508 | Remote_View->setSorting( 3,FALSE); | 305 | Remote_View->setSorting( 3,FALSE); |
509 | fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); | 306 | fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); |
510 | } | 307 | } |
511 | 308 | ||
512 | void AdvancedFm::localListClicked(QListViewItem *selectedItem) | 309 | void AdvancedFm::localListClicked(QListViewItem *selectedItem) { |
513 | { | ||
514 | if(selectedItem) { | 310 | if(selectedItem) { |
515 | QString strItem=selectedItem->text(0); | 311 | QString strItem=selectedItem->text(0); |
516 | QString strSize=selectedItem->text(1); | 312 | QString strSize=selectedItem->text(1); |
517 | strSize=strSize.stripWhiteSpace(); | 313 | strSize=strSize.stripWhiteSpace(); |
@@ -549,10 +345,10 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) | |||
549 | } | 345 | } |
550 | } | 346 | } |
551 | } | 347 | } |
552 | 348 | ||
553 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) | 349 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) { |
554 | { | 350 | |
555 | if(selectedItem) { | 351 | if(selectedItem) { |
556 | QString strItem=selectedItem->text(0); | 352 | QString strItem=selectedItem->text(0); |
557 | QString strSize=selectedItem->text(1); | 353 | QString strSize=selectedItem->text(1); |
558 | strSize=strSize.stripWhiteSpace(); | 354 | strSize=strSize.stripWhiteSpace(); |
@@ -590,20 +386,17 @@ void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) | |||
590 | } | 386 | } |
591 | } | 387 | } |
592 | } | 388 | } |
593 | 389 | ||
594 | void AdvancedFm::doLocalCd() | 390 | void AdvancedFm::doLocalCd() { |
595 | { | ||
596 | localListClicked( Local_View->currentItem()); | 391 | localListClicked( Local_View->currentItem()); |
597 | } | 392 | } |
598 | 393 | ||
599 | void AdvancedFm::doRemoteCd() | 394 | void AdvancedFm::doRemoteCd() { |
600 | { | ||
601 | localListClicked( Remote_View->currentItem()); | 395 | localListClicked( Remote_View->currentItem()); |
602 | } | 396 | } |
603 | 397 | ||
604 | void AdvancedFm::showHidden() | 398 | void AdvancedFm::showHidden() { |
605 | { | ||
606 | if (b) { | 399 | if (b) { |
607 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 400 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
608 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 401 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
609 | b=FALSE; | 402 | b=FALSE; |
@@ -616,10 +409,9 @@ void AdvancedFm::showHidden() | |||
616 | populateLocalView(); | 409 | populateLocalView(); |
617 | 410 | ||
618 | } | 411 | } |
619 | 412 | ||
620 | void AdvancedFm::showRemoteHidden() | 413 | void AdvancedFm::showRemoteHidden() { |
621 | { | ||
622 | if (b) { | 414 | if (b) { |
623 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 415 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
624 | b=TRUE; | 416 | b=TRUE; |
625 | 417 | ||
@@ -629,10 +421,9 @@ void AdvancedFm::showRemoteHidden() | |||
629 | } | 421 | } |
630 | populateRemoteView(); | 422 | populateRemoteView(); |
631 | } | 423 | } |
632 | 424 | ||
633 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) | 425 | void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) { |
634 | { | ||
635 | qDebug("list pressed"); | 426 | qDebug("list pressed"); |
636 | switch (mouse) { | 427 | switch (mouse) { |
637 | case 1: | 428 | case 1: |
638 | break; | 429 | break; |
@@ -642,10 +433,9 @@ void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , i | |||
642 | break; | 433 | break; |
643 | }; | 434 | }; |
644 | } | 435 | } |
645 | 436 | ||
646 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) | 437 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) { |
647 | { | ||
648 | 438 | ||
649 | switch (mouse) { | 439 | switch (mouse) { |
650 | case 1: | 440 | case 1: |
651 | break; | 441 | break; |
@@ -727,10 +517,9 @@ void AdvancedFm::runText() { | |||
727 | } | 517 | } |
728 | } | 518 | } |
729 | } | 519 | } |
730 | 520 | ||
731 | void AdvancedFm::localMakDir() | 521 | void AdvancedFm::localMakDir() { |
732 | { | ||
733 | InputDialog *fileDlg; | 522 | InputDialog *fileDlg; |
734 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 523 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
735 | fileDlg->exec(); | 524 | fileDlg->exec(); |
736 | if( fileDlg->result() == 1 ) { | 525 | if( fileDlg->result() == 1 ) { |
@@ -739,10 +528,9 @@ void AdvancedFm::localMakDir() | |||
739 | } | 528 | } |
740 | populateLocalView(); | 529 | populateLocalView(); |
741 | } | 530 | } |
742 | 531 | ||
743 | void AdvancedFm::remoteMakDir() | 532 | void AdvancedFm::remoteMakDir() { |
744 | { | ||
745 | InputDialog *fileDlg; | 533 | InputDialog *fileDlg; |
746 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 534 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
747 | fileDlg->exec(); | 535 | fileDlg->exec(); |
748 | if( fileDlg->result() == 1 ) { | 536 | if( fileDlg->result() == 1 ) { |
@@ -751,10 +539,9 @@ void AdvancedFm::remoteMakDir() | |||
751 | } | 539 | } |
752 | populateRemoteView(); | 540 | populateRemoteView(); |
753 | } | 541 | } |
754 | 542 | ||
755 | void AdvancedFm::localDelete() | 543 | void AdvancedFm::localDelete() { |
756 | { | ||
757 | QStringList curFileList = getPath(); | 544 | QStringList curFileList = getPath(); |
758 | if(curFileList.count() > 0) { | 545 | if(curFileList.count() > 0) { |
759 | QString myFile; | 546 | QString myFile; |
760 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 547 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
@@ -801,10 +588,9 @@ void AdvancedFm::localDelete() | |||
801 | } | 588 | } |
802 | } | 589 | } |
803 | } | 590 | } |
804 | 591 | ||
805 | void AdvancedFm::remoteDelete() | 592 | void AdvancedFm::remoteDelete() { |
806 | { | ||
807 | QStringList curFileList = getPath(); | 593 | QStringList curFileList = getPath(); |
808 | if( curFileList.count() > 0) { | 594 | if( curFileList.count() > 0) { |
809 | QString myFile; | 595 | QString myFile; |
810 | 596 | ||
@@ -851,10 +637,9 @@ void AdvancedFm::remoteDelete() | |||
851 | } | 637 | } |
852 | } | 638 | } |
853 | } | 639 | } |
854 | 640 | ||
855 | void AdvancedFm::localRename() | 641 | void AdvancedFm::localRename() { |
856 | { | ||
857 | QString curFile = Local_View->currentItem()->text(0); | 642 | QString curFile = Local_View->currentItem()->text(0); |
858 | qDebug("currentItem "+curFile); | 643 | qDebug("currentItem "+curFile); |
859 | if( curFile !="../") { | 644 | if( curFile !="../") { |
860 | InputDialog *fileDlg; | 645 | InputDialog *fileDlg; |
@@ -888,32 +673,27 @@ void AdvancedFm::remoteRename() | |||
888 | populateRemoteView(); | 673 | populateRemoteView(); |
889 | } | 674 | } |
890 | } | 675 | } |
891 | 676 | ||
892 | void AdvancedFm::switchToLocalTab() | 677 | void AdvancedFm::switchToLocalTab() { |
893 | { | ||
894 | TabWidget->setCurrentPage(0); | 678 | TabWidget->setCurrentPage(0); |
895 | Local_View->setFocus(); | 679 | Local_View->setFocus(); |
896 | } | 680 | } |
897 | 681 | ||
898 | void AdvancedFm::switchToRemoteTab() | 682 | void AdvancedFm::switchToRemoteTab() { |
899 | { | ||
900 | TabWidget->setCurrentPage(1); | 683 | TabWidget->setCurrentPage(1); |
901 | Remote_View->setFocus(); | 684 | Remote_View->setFocus(); |
902 | } | 685 | } |
903 | 686 | ||
904 | void AdvancedFm::readConfig() | 687 | void AdvancedFm::readConfig() { |
905 | { | ||
906 | Config cfg("AdvancedFm"); | 688 | Config cfg("AdvancedFm"); |
907 | } | 689 | } |
908 | 690 | ||
909 | void AdvancedFm::writeConfig() | 691 | void AdvancedFm::writeConfig() { |
910 | { | ||
911 | Config cfg("AdvancedFm"); | 692 | Config cfg("AdvancedFm"); |
912 | } | 693 | } |
913 | 694 | ||
914 | void AdvancedFm::currentPathComboChanged() | 695 | void AdvancedFm::currentPathComboChanged() { |
915 | { | ||
916 | if (TabWidget->currentPageIndex() == 0) { | 696 | if (TabWidget->currentPageIndex() == 0) { |
917 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { | 697 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
918 | currentDir.setPath( currentPathCombo->lineEdit()->text() ); | 698 | currentDir.setPath( currentPathCombo->lineEdit()->text() ); |
919 | populateLocalView(); | 699 | populateLocalView(); |
@@ -1093,10 +873,9 @@ void AdvancedFm::CFButtonPushed() { | |||
1093 | 873 | ||
1094 | } | 874 | } |
1095 | 875 | ||
1096 | 876 | ||
1097 | void AdvancedFm::upDir() | 877 | void AdvancedFm::upDir() { |
1098 | { | ||
1099 | if (TabWidget->currentPageIndex() == 0) { | 878 | if (TabWidget->currentPageIndex() == 0) { |
1100 | QString current = currentDir.canonicalPath(); | 879 | QString current = currentDir.canonicalPath(); |
1101 | QDir dir(current); | 880 | QDir dir(current); |
1102 | dir.cdUp(); | 881 | dir.cdUp(); |
@@ -1116,10 +895,9 @@ void AdvancedFm::upDir() | |||
1116 | update(); | 895 | update(); |
1117 | } | 896 | } |
1118 | } | 897 | } |
1119 | 898 | ||
1120 | void AdvancedFm::copy() | 899 | void AdvancedFm::copy() { |
1121 | { | ||
1122 | qApp->processEvents(); | 900 | qApp->processEvents(); |
1123 | QStringList curFileList = getPath(); | 901 | QStringList curFileList = getPath(); |
1124 | if( curFileList.count() > 0) { | 902 | if( curFileList.count() > 0) { |
1125 | QString curFile; | 903 | QString curFile; |
@@ -1594,10 +1372,9 @@ void AdvancedFm::doAbout() { | |||
1594 | "L.J.Potter<llornkcor@handhelds.org>\n" | 1372 | "L.J.Potter<llornkcor@handhelds.org>\n" |
1595 | "and is licensed by the GPL")); | 1373 | "and is licensed by the GPL")); |
1596 | } | 1374 | } |
1597 | 1375 | ||
1598 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) | 1376 | void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { |
1599 | { | ||
1600 | if( TabWidget->hasFocus()) | 1377 | if( TabWidget->hasFocus()) |
1601 | switch ( e->key() ) { | 1378 | switch ( e->key() ) { |
1602 | case Key_Delete: | 1379 | case Key_Delete: |
1603 | del(); | 1380 | del(); |
@@ -1807,90 +1584,90 @@ void AdvancedFm::fileBeamFinished( Ir *) { | |||
1807 | } | 1584 | } |
1808 | 1585 | ||
1809 | void AdvancedFm::showFileMenu() { | 1586 | void AdvancedFm::showFileMenu() { |
1810 | 1587 | ||
1811 | QString curApp; | 1588 | QString curApp; |
1812 | bool isLocalView = false; | 1589 | bool isLocalView = false; |
1813 | if (TabWidget->currentPageIndex() == 0) { | 1590 | if (TabWidget->currentPageIndex() == 0) { |
1814 | isLocalView = TRUE; | 1591 | isLocalView = TRUE; |
1815 | curApp = Local_View->currentItem()->text(0); | 1592 | curApp = Local_View->currentItem()->text(0); |
1816 | } else { | 1593 | } else { |
1817 | curApp = Remote_View->currentItem()->text(0); | 1594 | curApp = Remote_View->currentItem()->text(0); |
1818 | } | 1595 | } |
1819 | 1596 | ||
1820 | MimeType mt( curApp ); | 1597 | MimeType mt( curApp ); |
1821 | const AppLnk* app = mt.application(); | 1598 | const AppLnk* app = mt.application(); |
1822 | QFile fi(curApp); | 1599 | QFile fi(curApp); |
1823 | 1600 | ||
1824 | QPopupMenu *m = new QPopupMenu(0); | 1601 | QPopupMenu *m = new QPopupMenu(0); |
1825 | 1602 | ||
1826 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 1603 | m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
1827 | m->insertSeparator(); | 1604 | m->insertSeparator(); |
1828 | if ( QFileInfo(fi).isDir() ) { | 1605 | if ( QFileInfo(fi).isDir() ) { |
1829 | m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | 1606 | m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); |
1830 | } else { | 1607 | } else { |
1831 | 1608 | ||
1832 | if ( app ) | 1609 | if ( app ) |
1833 | m->insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( runThis() ) ); | 1610 | m->insertItem( app->pixmap(), tr( "Open in " + app->name() ), this, SLOT( runThis() ) ); |
1834 | else if( QFileInfo(fi).isExecutable() ) | 1611 | else if( QFileInfo(fi).isExecutable() ) |
1835 | m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) ); | 1612 | m->insertItem( tr( "Execute" ), this, SLOT( runThis() ) ); |
1836 | 1613 | ||
1837 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); | 1614 | m->insertItem( Resource::loadPixmap( "txt" ), tr( "Open as text" ),this, SLOT( runText() ) ); |
1838 | } | 1615 | } |
1839 | m->insertSeparator(); | 1616 | m->insertSeparator(); |
1840 | 1617 | ||
1841 | 1618 | ||
1842 | if(isLocalView) | 1619 | if(isLocalView) |
1843 | m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 1620 | m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
1844 | else | 1621 | else |
1845 | m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 1622 | m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
1846 | 1623 | ||
1847 | m->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 1624 | m->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
1848 | m->insertSeparator(); | 1625 | m->insertSeparator(); |
1849 | 1626 | ||
1850 | if(isLocalView) | 1627 | if(isLocalView) |
1851 | m->insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 1628 | m->insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
1852 | else | 1629 | else |
1853 | m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 1630 | m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
1854 | 1631 | ||
1855 | m->insertItem( tr( "Copy" ), this, SLOT( copy() )); | 1632 | m->insertItem( tr( "Copy" ), this, SLOT( copy() )); |
1856 | m->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); | 1633 | m->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); |
1857 | m->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); | 1634 | m->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); |
1858 | m->insertItem( tr( "Move" ), this, SLOT( move() )); | 1635 | m->insertItem( tr( "Move" ), this, SLOT( move() )); |
1859 | m->insertSeparator(); | 1636 | m->insertSeparator(); |
1860 | m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 1637 | m->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
1861 | 1638 | ||
1862 | // if(isLocalView) | 1639 | // if(isLocalView) |
1863 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); | 1640 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateLocalView() )); |
1864 | // else | 1641 | // else |
1865 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); | 1642 | // m->insertItem( tr( "Rescan" ), this, SLOT( populateRemoteView() )); |
1866 | 1643 | ||
1867 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 1644 | m->insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); |
1868 | m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); | 1645 | m->insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); |
1869 | m->insertSeparator(); | 1646 | m->insertSeparator(); |
1870 | 1647 | ||
1871 | if(isLocalView) | 1648 | if(isLocalView) |
1872 | m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 1649 | m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
1873 | else | 1650 | else |
1874 | m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 1651 | m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
1875 | 1652 | ||
1876 | m->insertSeparator(); | 1653 | m->insertSeparator(); |
1877 | m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); | 1654 | m->insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); |
1878 | 1655 | ||
1879 | if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings | 1656 | if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings |
1880 | m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); | 1657 | m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); |
1881 | m->setCheckable(TRUE); | 1658 | m->setCheckable(TRUE); |
1882 | if (!b) | 1659 | if (!b) |
1883 | m->setItemChecked(m->idAt(0),TRUE); | 1660 | m->setItemChecked(m->idAt(0),TRUE); |
1884 | else | 1661 | else |
1885 | m->setItemChecked(m->idAt(0),FALSE); | 1662 | m->setItemChecked(m->idAt(0),FALSE); |
1886 | 1663 | ||
1887 | if(Ir::supported()) | 1664 | if(Ir::supported()) |
1888 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); | 1665 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); |
1889 | m->setFocus(); | 1666 | m->setFocus(); |
1890 | m->exec( QCursor::pos() ); | 1667 | m->exec( QCursor::pos() ); |
1891 | sleep(1); | 1668 | sleep(1); |
1892 | if(m) delete m; | 1669 | if(m) delete m; |
1893 | } | 1670 | } |
1894 | 1671 | ||
1895 | 1672 | ||
1896 | void AdvancedFm::cancelMenuTimer() { | 1673 | void AdvancedFm::cancelMenuTimer() { |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 53dad50..b2705b8 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | opieftp.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 |
@@ -109,14 +109,16 @@ protected: | |||
109 | bool zaurusDevice; | 109 | bool zaurusDevice; |
110 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 110 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
111 | QStringList remoteDirPathStringList, localDirPathStringList; | 111 | QStringList remoteDirPathStringList, localDirPathStringList; |
112 | 112 | ||
113 | void init(); | ||
114 | void initConnections(); | ||
113 | void keyReleaseEvent( QKeyEvent *); | 115 | void keyReleaseEvent( QKeyEvent *); |
114 | QString getFileSystemType(const QString &); | 116 | QString getFileSystemType(const QString &); |
115 | QString getDiskSpace(const QString &); | 117 | QString getDiskSpace(const QString &); |
116 | |||
117 | void parsetab(const QString &fileName); | 118 | void parsetab(const QString &fileName); |
118 | QString checkDiskSpace(const QString &); | 119 | QString checkDiskSpace(const QString &); |
120 | |||
119 | protected slots: | 121 | protected slots: |
120 | void showFileMenu(); | 122 | void showFileMenu(); |
121 | void cancelMenuTimer(); | 123 | void cancelMenuTimer(); |
122 | void homeButtonPushed(); | 124 | void homeButtonPushed(); |
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index 0f0f770..9629f0e 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro | |||
@@ -1,8 +1,8 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h | 3 | HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h |
4 | SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp | 4 | SOURCES = advancedfm.cpp advancedfmData.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp |
5 | TARGET = advancedfm | 5 | TARGET = advancedfm |
6 | REQUIRES=medium-config | 6 | REQUIRES=medium-config |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp new file mode 100644 index 0000000..a4f4d59 --- a/dev/null +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -0,0 +1,236 @@ | |||
1 | /*************************************************************************** | ||
2 | advancedfmData.cpp | ||
3 | ------------------- | ||
4 | ** Created: Mon 09-23-2002 13:24:11 | ||
5 | copyright : (C) 2002 by ljp | ||
6 | email : ljp@llornkcor.com | ||
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 * | ||
9 | * the Free Software Foundation; either version 2 of the License, or * | ||
10 | * (at your option) any later version. * | ||
11 | ***************************************************************************/ | ||
12 | #include "advancedfm.h" | ||
13 | |||
14 | #include <qpe/qpeapplication.h> | ||
15 | #include <qpe/qpemenubar.h> | ||
16 | #include <qpe/qpetoolbar.h> | ||
17 | #include <qpe/resource.h> | ||
18 | |||
19 | #include <qlayout.h> | ||
20 | #include <qpixmap.h> | ||
21 | #include <qcombobox.h> | ||
22 | #include <qpopupmenu.h> | ||
23 | #include <qtabwidget.h> | ||
24 | #include <qtoolbutton.h> | ||
25 | #include <qtabwidget.h> | ||
26 | #include <qlineedit.h> | ||
27 | #include <qlistview.h> | ||
28 | |||
29 | #include <sys/utsname.h> | ||
30 | |||
31 | |||
32 | void AdvancedFm::init() { | ||
33 | |||
34 | setCaption( tr( "AdvancedFm" ) ); | ||
35 | |||
36 | QGridLayout *layout = new QGridLayout( this ); | ||
37 | layout->setSpacing( 2); | ||
38 | layout->setMargin( 2); | ||
39 | |||
40 | |||
41 | QPEMenuBar *menuBar = new QPEMenuBar(this); | ||
42 | fileMenu = new QPopupMenu( this ); | ||
43 | viewMenu = new QPopupMenu( this ); | ||
44 | |||
45 | layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 ); | ||
46 | |||
47 | menuBar->insertItem( tr( "File" ), fileMenu); | ||
48 | menuBar->insertItem( tr( "View" ), viewMenu); | ||
49 | |||
50 | qpeDirButton= new QToolButton(this,"QPEButton"); | ||
51 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | ||
52 | qpeDirButton ->setFixedSize( QSize( 20, 20 ) ); | ||
53 | layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2); | ||
54 | |||
55 | cfButton = new QToolButton( this,"CFButton"); | ||
56 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | ||
57 | cfButton ->setFixedSize( QSize( 20, 20 ) ); | ||
58 | layout->addMultiCellWidget( cfButton , 0, 0, 3, 3); | ||
59 | |||
60 | sdButton = new QToolButton( this,"SDButton"); | ||
61 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | ||
62 | sdButton->setFixedSize( QSize( 20, 20 ) ); | ||
63 | layout->addMultiCellWidget( sdButton , 0, 0, 4, 4); | ||
64 | |||
65 | cdUpButton = new QToolButton( this,"cdUpButton"); | ||
66 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | ||
67 | cdUpButton ->setFixedSize( QSize( 20, 20 ) ); | ||
68 | layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5); | ||
69 | |||
70 | docButton = new QToolButton( this,"docsButton"); | ||
71 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | ||
72 | docButton->setFixedSize( QSize( 20, 20 ) ); | ||
73 | layout->addMultiCellWidget( docButton, 0, 0, 6, 6); | ||
74 | |||
75 | homeButton = new QToolButton( this,"homeButton"); | ||
76 | homeButton->setPixmap(Resource::loadPixmap("home")); | ||
77 | homeButton->setFixedSize( QSize( 20, 20 ) ); | ||
78 | layout->addMultiCellWidget( homeButton, 0, 0, 7, 7); | ||
79 | |||
80 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | ||
81 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | ||
82 | fileMenu->insertSeparator(); | ||
83 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | ||
84 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | ||
85 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | ||
86 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | ||
87 | fileMenu->insertSeparator(); | ||
88 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | ||
89 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | ||
90 | fileMenu->setCheckable(TRUE); | ||
91 | |||
92 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | ||
93 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | ||
94 | viewMenu->insertSeparator(); | ||
95 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | ||
96 | viewMenu->setCheckable(TRUE); | ||
97 | |||
98 | |||
99 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | ||
100 | currentPathCombo->setEditable(TRUE); | ||
101 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | ||
102 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | ||
103 | |||
104 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | ||
105 | |||
106 | layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7); | ||
107 | |||
108 | |||
109 | TabWidget = new QTabWidget( this, "TabWidget" ); | ||
110 | layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7); | ||
111 | |||
112 | tab = new QWidget( TabWidget, "tab" ); | ||
113 | tabLayout = new QGridLayout( tab ); | ||
114 | tabLayout->setSpacing( 2); | ||
115 | tabLayout->setMargin( 2); | ||
116 | |||
117 | Local_View = new QListView( tab, "Local_View" ); | ||
118 | Local_View->addColumn( tr("File"),130); | ||
119 | Local_View->addColumn( tr("Size"),-1); | ||
120 | Local_View->setColumnAlignment(1,QListView::AlignRight); | ||
121 | Local_View->addColumn( tr("Date"),-1); | ||
122 | Local_View->setColumnAlignment(2,QListView::AlignRight); | ||
123 | Local_View->setAllColumnsShowFocus(TRUE); | ||
124 | Local_View->setMultiSelection( TRUE ); | ||
125 | Local_View->setSelectionMode(QListView::Extended); | ||
126 | |||
127 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | ||
128 | |||
129 | tabLayout->addWidget( Local_View, 0, 0 ); | ||
130 | |||
131 | TabWidget->insertTab( tab, tr("1")); | ||
132 | |||
133 | tab_2 = new QWidget( TabWidget, "tab_2" ); | ||
134 | tabLayout_2 = new QGridLayout( tab_2 ); | ||
135 | tabLayout_2->setSpacing( 2); | ||
136 | tabLayout_2->setMargin( 2); | ||
137 | |||
138 | Remote_View = new QListView( tab_2, "Remote_View" ); | ||
139 | Remote_View->addColumn( tr("File"),130); | ||
140 | Remote_View->addColumn( tr("Size"),-1); | ||
141 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | ||
142 | Remote_View->addColumn( tr("Date"),-1); | ||
143 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | ||
144 | Remote_View->setAllColumnsShowFocus(TRUE); | ||
145 | Remote_View->setMultiSelection( TRUE ); | ||
146 | Remote_View->setSelectionMode(QListView::Extended); | ||
147 | |||
148 | |||
149 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | ||
150 | |||
151 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | ||
152 | |||
153 | |||
154 | TabWidget->insertTab( tab_2, tr( "2")); | ||
155 | |||
156 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | ||
157 | tabLayout_3 = new QGridLayout( tab_3 ); | ||
158 | tabLayout_3->setSpacing( 2); | ||
159 | tabLayout_3->setMargin( 2); | ||
160 | |||
161 | |||
162 | // OFileDialog fileDialog; | ||
163 | // fileDialog; | ||
164 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy | ||
165 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); | ||
166 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); | ||
167 | |||
168 | QListView *fileTree; | ||
169 | fileTree = new QListView( tab_3, "tree" ); | ||
170 | |||
171 | |||
172 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | ||
173 | |||
174 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | ||
175 | */ | ||
176 | |||
177 | /////////////// | ||
178 | |||
179 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | ||
180 | if (uname(&name) != -1) { | ||
181 | QString release=name.release; | ||
182 | if(release.find("embedix",0,TRUE) !=-1) { | ||
183 | zaurusDevice=TRUE; | ||
184 | } else { | ||
185 | zaurusDevice=FALSE; | ||
186 | sdButton->hide(); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | ||
191 | currentDir.setPath( QDir::currentDirPath()); | ||
192 | |||
193 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | ||
194 | currentRemoteDir.setPath( QDir::currentDirPath()); | ||
195 | |||
196 | b = TRUE; | ||
197 | |||
198 | filterStr="*"; | ||
199 | b=FALSE; | ||
200 | |||
201 | |||
202 | |||
203 | } | ||
204 | |||
205 | void AdvancedFm::initConnections() { | ||
206 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | ||
207 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); | ||
208 | connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) ); | ||
209 | connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) ); | ||
210 | connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); | ||
211 | connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); | ||
212 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); | ||
213 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | ||
214 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | ||
215 | |||
216 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | ||
217 | this,SLOT(currentPathComboChanged())); | ||
218 | |||
219 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | ||
220 | this,SLOT( localListClicked(QListViewItem *)) ); | ||
221 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | ||
222 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); | ||
223 | |||
224 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | ||
225 | |||
226 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | ||
227 | this,SLOT( remoteListClicked(QListViewItem *)) ); | ||
228 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | ||
229 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | ||
230 | |||
231 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | ||
232 | this,SLOT(tabChanged(QWidget*))); | ||
233 | |||
234 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | ||
235 | |||
236 | } | ||