Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index d0de442..a120f35 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -3,24 +3,26 @@ | |||
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/storage.h> | ||
16 | |||
15 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
17 | #include <qpe/menubutton.h> | 19 | #include <qpe/menubutton.h> |
18 | 20 | ||
19 | #include <qlayout.h> | 21 | #include <qlayout.h> |
20 | #include <qhbox.h> | 22 | #include <qhbox.h> |
21 | #include <qmenubar.h> | 23 | #include <qmenubar.h> |
22 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
23 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
24 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
25 | #include <qlistview.h> | 27 | #include <qlistview.h> |
26 | 28 | ||
@@ -74,24 +76,26 @@ void AdvancedFm::init() { | |||
74 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 76 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); |
75 | docButton->setAutoRaise( true ); | 77 | docButton->setAutoRaise( true ); |
76 | menuBar->insertItem( docButton ); | 78 | menuBar->insertItem( docButton ); |
77 | 79 | ||
78 | homeButton = new QToolButton( 0, "homeButton"); | 80 | homeButton = new QToolButton( 0, "homeButton"); |
79 | homeButton->setPixmap(Resource::loadPixmap("home")); | 81 | homeButton->setPixmap(Resource::loadPixmap("home")); |
80 | homeButton->setAutoRaise( true ); | 82 | homeButton->setAutoRaise( true ); |
81 | menuBar->insertItem( homeButton ); | 83 | menuBar->insertItem( homeButton ); |
82 | 84 | ||
83 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 85 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
84 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 86 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
85 | fileMenu->insertSeparator(); | 87 | fileMenu->insertSeparator(); |
88 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | ||
89 | fileMenu->insertSeparator(); | ||
86 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 90 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
87 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 91 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
88 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 92 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
89 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 93 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
90 | fileMenu->insertSeparator(); | 94 | fileMenu->insertSeparator(); |
91 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 95 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
92 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 96 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
93 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 97 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
94 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 98 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
95 | fileMenu->setCheckable(TRUE); | 99 | fileMenu->setCheckable(TRUE); |
96 | 100 | ||
97 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 101 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
@@ -189,35 +193,43 @@ void AdvancedFm::init() { | |||
189 | 193 | ||
190 | QListView *fileTree; | 194 | QListView *fileTree; |
191 | fileTree = new QListView( tab_3, "tree" ); | 195 | fileTree = new QListView( tab_3, "tree" ); |
192 | 196 | ||
193 | 197 | ||
194 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | 198 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); |
195 | 199 | ||
196 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | 200 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); |
197 | */ | 201 | */ |
198 | 202 | ||
199 | /////////////// | 203 | /////////////// |
200 | 204 | ||
205 | |||
201 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 206 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
202 | if (uname(&name) != -1) { | 207 | if (uname(&name) != -1) { |
203 | QString release=name.release; | 208 | QString release=name.release; |
204 | if(release.find("embedix",0,TRUE) !=-1) { | 209 | if(release.find("embedix",0,TRUE) !=-1) { |
205 | zaurusDevice=TRUE; | 210 | zaurusDevice=TRUE; |
206 | } else { | 211 | } else { |
207 | zaurusDevice=FALSE; | 212 | zaurusDevice=FALSE; |
208 | sdButton->hide(); | ||
209 | } | 213 | } |
210 | } | 214 | } |
211 | 215 | ||
216 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | ||
217 | qDebug("not have sd"); | ||
218 | sdButton->hide(); | ||
219 | } | ||
220 | if( !StorageInfo::hasCf() ) { | ||
221 | qDebug("not have cf"); | ||
222 | cfButton->hide(); | ||
223 | } | ||
212 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 224 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
213 | currentDir.setPath( QDir::currentDirPath()); | 225 | currentDir.setPath( QDir::currentDirPath()); |
214 | 226 | ||
215 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 227 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
216 | currentRemoteDir.setPath( QDir::currentDirPath()); | 228 | currentRemoteDir.setPath( QDir::currentDirPath()); |
217 | 229 | ||
218 | b = TRUE; | 230 | b = TRUE; |
219 | 231 | ||
220 | filterStr="*"; | 232 | filterStr="*"; |
221 | b=FALSE; | 233 | b=FALSE; |
222 | TabWidget->setCurrentTab(0); | 234 | TabWidget->setCurrentTab(0); |
223 | 235 | ||
@@ -239,24 +251,25 @@ void AdvancedFm::initConnections() | |||
239 | connect( docButton,SIGNAL(released()), | 251 | connect( docButton,SIGNAL(released()), |
240 | this,SLOT( docButtonPushed()) ); | 252 | this,SLOT( docButtonPushed()) ); |
241 | connect( homeButton,SIGNAL(released()), | 253 | connect( homeButton,SIGNAL(released()), |
242 | this,SLOT( homeButtonPushed()) ); | 254 | this,SLOT( homeButtonPushed()) ); |
243 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 255 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
244 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 256 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
245 | 257 | ||
246 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 258 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
247 | this,SLOT(currentPathComboChanged())); | 259 | this,SLOT(currentPathComboChanged())); |
248 | 260 | ||
249 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | 261 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
250 | this,SLOT( ListClicked(QListViewItem *)) ); | 262 | this,SLOT( ListClicked(QListViewItem *)) ); |
263 | |||
251 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 264 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
252 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 265 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
253 | 266 | ||
254 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | 267 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); |
255 | 268 | ||
256 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | 269 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
257 | this,SLOT( ListClicked(QListViewItem *)) ); | 270 | this,SLOT( ListClicked(QListViewItem *)) ); |
258 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 271 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
259 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 272 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); |
260 | 273 | ||
261 | connect( TabWidget,SIGNAL(currentChanged(QWidget *)), | 274 | connect( TabWidget,SIGNAL(currentChanged(QWidget *)), |
262 | this,SLOT(tabChanged(QWidget*))); | 275 | this,SLOT(tabChanged(QWidget*))); |