summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfmData.cpp
Unidiff
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmData.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 2997c55..29335f8 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,78 +1,82 @@
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/* OPIE */
15#include <opie2/odebug.h>
14#include <qpe/storage.h> 16#include <qpe/storage.h>
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>
20using namespace Opie::Core;
21using namespace Opie::Ui;
18 22
23/* QT */
19#include <qlayout.h> 24#include <qlayout.h>
20#include <qhbox.h> 25#include <qhbox.h>
21#include <qmenubar.h> 26#include <qmenubar.h>
22#include <qcombobox.h> 27#include <qcombobox.h>
23#include <qtoolbutton.h> 28#include <qtoolbutton.h>
24#include <qlineedit.h> 29#include <qlineedit.h>
25#include <qlistview.h> 30#include <qlistview.h>
26 31
32/* STD */
27#include <sys/utsname.h> 33#include <sys/utsname.h>
28 34
29
30using namespace Opie::Ui;
31void AdvancedFm::init() { 35void AdvancedFm::init() {
32 b = false; 36 b = false;
33 setCaption( tr( "AdvancedFm" ) ); 37 setCaption( tr( "AdvancedFm" ) );
34 38
35 QVBoxLayout *layout = new QVBoxLayout( this ); 39 QVBoxLayout *layout = new QVBoxLayout( this );
36 layout->setSpacing( 2); 40 layout->setSpacing( 2);
37 layout->setMargin( 0); // squeeze 41 layout->setMargin( 0); // squeeze
38 42
39 QMenuBar *menuBar = new QMenuBar(this); 43 QMenuBar *menuBar = new QMenuBar(this);
40 menuBar->setMargin( 0 ); // squeeze 44 menuBar->setMargin( 0 ); // squeeze
41 fileMenu = new QPopupMenu( this ); 45 fileMenu = new QPopupMenu( this );
42 viewMenu = new QPopupMenu( this ); 46 viewMenu = new QPopupMenu( this );
43// customDirMenu = new QPopupMenu( this ); 47// customDirMenu = new QPopupMenu( this );
44 48
45 layout->addWidget( menuBar ); 49 layout->addWidget( menuBar );
46 50
47 menuBar->insertItem( tr( "File" ), fileMenu); 51 menuBar->insertItem( tr( "File" ), fileMenu);
48 menuBar->insertItem( tr( "View" ), viewMenu); 52 menuBar->insertItem( tr( "View" ), viewMenu);
49 53
50 cdUpButton = new QToolButton( 0,"cdUpButton"); 54 cdUpButton = new QToolButton( 0,"cdUpButton");
51 cdUpButton->setPixmap(Resource::loadPixmap("up")); 55 cdUpButton->setPixmap(Resource::loadPixmap("up"));
52 cdUpButton->setAutoRaise( true ); 56 cdUpButton->setAutoRaise( true );
53 menuBar->insertItem( cdUpButton ); 57 menuBar->insertItem( cdUpButton );
54 58
55 59
56 60
57 qpeDirButton= new QToolButton( 0,"QPEButton"); 61 qpeDirButton= new QToolButton( 0,"QPEButton");
58 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); 62 qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
59 qpeDirButton->setAutoRaise( true ); 63 qpeDirButton->setAutoRaise( true );
60 menuBar->insertItem( qpeDirButton ); 64 menuBar->insertItem( qpeDirButton );
61 65
62 cfButton = new QToolButton( 0, "CFButton"); 66 cfButton = new QToolButton( 0, "CFButton");
63 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); 67 cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
64 cfButton->setAutoRaise( true ); 68 cfButton->setAutoRaise( true );
65 menuBar->insertItem( cfButton ); 69 menuBar->insertItem( cfButton );
66 70
67 sdButton = new QToolButton( 0, "SDButton"); 71 sdButton = new QToolButton( 0, "SDButton");
68 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); 72 sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
69 sdButton->setAutoRaise( true ); 73 sdButton->setAutoRaise( true );
70 menuBar->insertItem( sdButton ); 74 menuBar->insertItem( sdButton );
71 75
72 docButton = new QToolButton( 0,"docsButton"); 76 docButton = new QToolButton( 0,"docsButton");
73 docButton->setPixmap(Resource::loadPixmap("DocsIcon")); 77 docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
74 docButton->setAutoRaise( true ); 78 docButton->setAutoRaise( true );
75 menuBar->insertItem( docButton ); 79 menuBar->insertItem( docButton );
76 80
77 homeButton = new QToolButton( 0, "homeButton"); 81 homeButton = new QToolButton( 0, "homeButton");
78 homeButton->setPixmap(Resource::loadPixmap("home")); 82 homeButton->setPixmap(Resource::loadPixmap("home"));
@@ -174,101 +178,101 @@ void AdvancedFm::init() {
174 Remote_View->addColumn( tr("Size"),-1); 178 Remote_View->addColumn( tr("Size"),-1);
175 Remote_View->setColumnAlignment(1,QListView::AlignRight); 179 Remote_View->setColumnAlignment(1,QListView::AlignRight);
176 Remote_View->addColumn( tr("Date"),-1); 180 Remote_View->addColumn( tr("Date"),-1);
177 Remote_View->setColumnAlignment(2,QListView::AlignRight); 181 Remote_View->setColumnAlignment(2,QListView::AlignRight);
178 Remote_View->setAllColumnsShowFocus(TRUE); 182 Remote_View->setAllColumnsShowFocus(TRUE);
179 Remote_View->setMultiSelection( TRUE ); 183 Remote_View->setMultiSelection( TRUE );
180 Remote_View->setSelectionMode(QListView::Extended); 184 Remote_View->setSelectionMode(QListView::Extended);
181 Remote_View->setFocusPolicy(StrongFocus); 185 Remote_View->setFocusPolicy(StrongFocus);
182 Remote_View->installEventFilter( this ); 186 Remote_View->installEventFilter( this );
183 187
184 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 188 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
185 189
186 tabLayout_2->addWidget( Remote_View, 0, 0 ); 190 tabLayout_2->addWidget( Remote_View, 0, 0 );
187 191
188 TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); 192 TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2"));
189 TabWidget->setSizeChange( 370 ); 193 TabWidget->setSizeChange( 370 );
190// TabWidget->insertTab( tab_2, tr( "2")); 194// TabWidget->insertTab( tab_2, tr( "2"));
191 195
192 /* tab_3 = new QWidget( TabWidget, "tab_3" ); 196 /* tab_3 = new QWidget( TabWidget, "tab_3" );
193 tabLayout_3 = new QGridLayout( tab_3 ); 197 tabLayout_3 = new QGridLayout( tab_3 );
194 tabLayout_3->setSpacing( 2); 198 tabLayout_3->setSpacing( 2);
195 tabLayout_3->setMargin( 2); 199 tabLayout_3->setMargin( 2);
196 200
197 201
198 // OFileDialog fileDialog; 202 // OFileDialog fileDialog;
199 // fileDialog; 203 // fileDialog;
200 // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy 204 // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy
201 // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); 205 // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow");
202 // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); 206 // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/");
203 207
204 QListView *fileTree; 208 QListView *fileTree;
205 fileTree = new QListView( tab_3, "tree" ); 209 fileTree = new QListView( tab_3, "tree" );
206 210
207 211
208 tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); 212 tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 );
209 213
210 TabWidget->insertTab( tab_3, tr( "Remote" ) ); 214 TabWidget->insertTab( tab_3, tr( "Remote" ) );
211 */ 215 */
212 216
213 /////////////// 217 ///////////////
214 218
215 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) 219 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
216 zaurusDevice=TRUE; 220 zaurusDevice=TRUE;
217 else 221 else
218 zaurusDevice=FALSE; 222 zaurusDevice=FALSE;
219 223
220 224
221 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { 225 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
222 qDebug("not have sd"); 226 odebug << "not have sd" << oendl;
223 sdButton->hide(); 227 sdButton->hide();
224 } 228 }
225 if( !StorageInfo::hasCf() ) { 229 if( !StorageInfo::hasCf() ) {
226 qDebug("not have cf"); 230 odebug << "not have cf" << oendl;
227 cfButton->hide(); 231 cfButton->hide();
228 } 232 }
229 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 233 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
230 currentDir.setPath( QDir::currentDirPath()); 234 currentDir.setPath( QDir::currentDirPath());
231 235
232 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 236 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
233 currentRemoteDir.setPath( QDir::currentDirPath()); 237 currentRemoteDir.setPath( QDir::currentDirPath());
234 238
235 // b = TRUE; 239 // b = TRUE;
236 240
237 filterStr="*"; 241 filterStr="*";
238 showMenuHidden(); 242 showMenuHidden();
239 TabWidget->setCurrentWidget(0); 243 TabWidget->setCurrentWidget(0);
240 244
241} 245}
242 246
243void AdvancedFm::initConnections() 247void AdvancedFm::initConnections()
244{ 248{
245 249
246 connect( qApp,SIGNAL( aboutToQuit()), 250 connect( qApp,SIGNAL( aboutToQuit()),
247 this, SLOT( cleanUp()) ); 251 this, SLOT( cleanUp()) );
248 connect( qpeDirButton ,SIGNAL(released()), 252 connect( qpeDirButton ,SIGNAL(released()),
249 this,SLOT( QPEButtonPushed()) ); 253 this,SLOT( QPEButtonPushed()) );
250 connect( cfButton ,SIGNAL(released()), 254 connect( cfButton ,SIGNAL(released()),
251 this,SLOT( CFButtonPushed()) ); 255 this,SLOT( CFButtonPushed()) );
252 connect( sdButton ,SIGNAL(released()), 256 connect( sdButton ,SIGNAL(released()),
253 this,SLOT( SDButtonPushed()) ); 257 this,SLOT( SDButtonPushed()) );
254 connect( cdUpButton ,SIGNAL(released()), 258 connect( cdUpButton ,SIGNAL(released()),
255 this,SLOT( upDir()) ); 259 this,SLOT( upDir()) );
256 connect( docButton,SIGNAL(released()), 260 connect( docButton,SIGNAL(released()),
257 this,SLOT( docButtonPushed()) ); 261 this,SLOT( docButtonPushed()) );
258 connect( homeButton,SIGNAL(released()), 262 connect( homeButton,SIGNAL(released()),
259 this,SLOT( homeButtonPushed()) ); 263 this,SLOT( homeButtonPushed()) );
260 connect( currentPathCombo, SIGNAL( activated(const QString&) ), 264 connect( currentPathCombo, SIGNAL( activated(const QString&) ),
261 this, SLOT( currentPathComboActivated(const QString&) ) ); 265 this, SLOT( currentPathComboActivated(const QString&) ) );
262 266
263 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 267 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
264 this,SLOT(currentPathComboChanged())); 268 this,SLOT(currentPathComboChanged()));
265 269
266 connect( Local_View, SIGNAL( clicked(QListViewItem*)), 270 connect( Local_View, SIGNAL( clicked(QListViewItem*)),
267 this,SLOT( ListClicked(QListViewItem*)) ); 271 this,SLOT( ListClicked(QListViewItem*)) );
268 272
269 connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), 273 connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
270 this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); 274 this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) );
271 275
272 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); 276 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
273 277
274 connect( Remote_View, SIGNAL( clicked(QListViewItem*)), 278 connect( Remote_View, SIGNAL( clicked(QListViewItem*)),