summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp66
-rw-r--r--noncore/apps/advancedfm/advancedfm.h3
2 files changed, 19 insertions, 50 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 02898de..fec320d 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -35,36 +35,27 @@
35#include <mntent.h> 35#include <mntent.h>
36 36
37using namespace Opie::Ui; 37using namespace Opie::Ui;
38 38
39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
40 : QMainWindow( ) { 40 : QMainWindow( ) {
41 init(); 41 init();
42 renameBox = 0; 42 renameBox = 0;
43 43
44 unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); 44 unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() );
45 45
46 initConnections(); 46 initConnections();
47 47 populateView();
48 whichTab = 1;
49 populateView();
50 // rePopulate();
51 // currentPathCombo->setFocus();
52 channel = new QCopChannel( "QPE/Application/advancedfm", this ); 48 channel = new QCopChannel( "QPE/Application/advancedfm", this );
53 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); 49 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&)));
54
55 // if( CurrentView() == Local_View)
56 // qDebug("LOCAL VIEW");
57 // else
58 // qDebug("REMOTE VIEW");
59 switchToLocalTab(); 50 switchToLocalTab();
60} 51}
61 52
62AdvancedFm::~AdvancedFm() { 53AdvancedFm::~AdvancedFm() {
63} 54}
64 55
65 56
66void AdvancedFm::cleanUp() { 57void AdvancedFm::cleanUp() {
67 QString sfile=QDir::homeDirPath(); 58 QString sfile=QDir::homeDirPath();
68 if(sfile.right(1) != "/") 59 if(sfile.right(1) != "/")
69 sfile+="/._temp"; 60 sfile+="/._temp";
70 else 61 else
@@ -281,44 +272,33 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in
281// break; 272// break;
282 }; 273 };
283} 274}
284 275
285 276
286void AdvancedFm::refreshCurrentTab() { 277void AdvancedFm::refreshCurrentTab() {
287 populateView(); 278 populateView();
288 // if ( TabWidget->currentWidget() == tab) { 279 // if ( TabWidget->currentWidget() == tab) {
289 280
290} 281}
291 282
292void AdvancedFm::switchToLocalTab() { 283void AdvancedFm::switchToLocalTab() {
293 qDebug("switchToLocal "); 284 TabWidget->setCurrentWidget(0);
294 TabWidget->setCurrentWidget(0); 285 Local_View->setFocus();
295 Local_View->setFocus(); 286 whichTab = 1;
296 whichTab = 1;
297
298} 287}
299 288
300void AdvancedFm::switchToRemoteTab() { 289void AdvancedFm::switchToRemoteTab() {
301 qDebug("switchToRemoteTab() "); 290 TabWidget->setCurrentWidget(1);
302 TabWidget->setCurrentWidget(1); 291 Remote_View->setFocus();
303 Remote_View->setFocus(); 292 whichTab = 2;
304 whichTab = 2;
305}
306
307void AdvancedFm::readConfig() {
308 Config cfg("AdvancedFm");
309}
310
311void AdvancedFm::writeConfig() {
312 Config cfg("AdvancedFm");
313} 293}
314 294
315void AdvancedFm::currentPathComboChanged() { 295void AdvancedFm::currentPathComboChanged() {
316 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 296 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
317 CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); 297 CurrentDir()->setPath( currentPathCombo->lineEdit()->text() );
318 populateView(); 298 populateView();
319 } else { 299 } else {
320 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 300 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
321 } 301 }
322} 302}
323 303
324void AdvancedFm::fillCombo(const QString &currentPath) { 304void AdvancedFm::fillCombo(const QString &currentPath) {
@@ -353,58 +333,48 @@ QStringList AdvancedFm::getPath() {
353 QListView *thisView=CurrentView(); 333 QListView *thisView=CurrentView();
354 QList<QListViewItem> * getSelectedItems( QListView * thisView ); 334 QList<QListViewItem> * getSelectedItems( QListView * thisView );
355 QListViewItemIterator it( thisView ); 335 QListViewItemIterator it( thisView );
356 for ( ; it.current(); ++it ) { 336 for ( ; it.current(); ++it ) {
357 if ( it.current()->isSelected() ) { 337 if ( it.current()->isSelected() ) {
358 strList << it.current()->text(0); 338 strList << it.current()->text(0);
359// odebug << it.current()->text(0) << oendl; 339// odebug << it.current()->text(0) << oendl;
360 } 340 }
361 } 341 }
362 return strList; 342 return strList;
363} 343}
364 344
365void AdvancedFm::homeButtonPushed() { 345void AdvancedFm::changeTo(QString dir) {
366 QString current = QDir::homeDirPath(); 346 chdir( dir.latin1());
367 chdir( current.latin1() ); 347 CurrentDir()->cd(dir, TRUE);
368 CurrentDir()->cd( current, TRUE);
369 populateView(); 348 populateView();
370 update(); 349 update();
371} 350}
372 351
352void AdvancedFm::homeButtonPushed() {
353 changeTo(QDir::homeDirPath());
354}
355
373void AdvancedFm::docButtonPushed() { 356void AdvancedFm::docButtonPushed() {
374 QString current = QPEApplication::documentDir(); 357 changeTo(QPEApplication::documentDir());
375 chdir( current.latin1() );
376 CurrentDir()->cd( current, TRUE);
377 populateView();
378 update();
379} 358}
380 359
381void AdvancedFm::SDButtonPushed() { 360void AdvancedFm::SDButtonPushed() {
382 QString current = "/mnt/card";// this can change so fix 361 changeTo("/mnt/card");// this can change so fix
383 chdir( current.latin1() );
384 CurrentDir()->cd( current, TRUE);
385 populateView();
386 update();
387} 362}
388 363
389void AdvancedFm::CFButtonPushed() { 364void AdvancedFm::CFButtonPushed() {
390 QString current;
391 if(zaurusDevice) 365 if(zaurusDevice)
392 current= "/mnt/cf"; //zaurus 366 changeTo("/mnt/cf"); //zaurus
393 else 367 else
394 current = "/mnt/hda"; //ipaq 368 changeTo("/mnt/hda"); //ipaq
395 chdir( current.latin1() );
396 CurrentDir()->cd( current, TRUE);
397 populateView();
398 update();
399} 369}
400 370
401 371
402void AdvancedFm::doAbout() { 372void AdvancedFm::doAbout() {
403 QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); 373 QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>"));
404} 374}
405 375
406void AdvancedFm::keyPressEvent( QKeyEvent *e) { 376void AdvancedFm::keyPressEvent( QKeyEvent *e) {
407// owarn << "key " << e->key() << "" << oendl; 377// owarn << "key " << e->key() << "" << oendl;
408// if( CurrentView()->hasFocus() ) 378// if( CurrentView()->hasFocus() )
409 { 379 {
410 switch ( e->key() ) { 380 switch ( e->key() ) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 2234b3c..c52b853 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -88,42 +88,41 @@ protected:
88 void keyReleaseEvent( QKeyEvent *); 88 void keyReleaseEvent( QKeyEvent *);
89 void keyPressEvent( QKeyEvent *); 89 void keyPressEvent( QKeyEvent *);
90 QString getFileSystemType(const QString &); 90 QString getFileSystemType(const QString &);
91 QString getDiskSpace(const QString &); 91 QString getDiskSpace(const QString &);
92 void parsetab(const QString &fileName); 92 void parsetab(const QString &fileName);
93 QString checkDiskSpace(const QString &); 93 QString checkDiskSpace(const QString &);
94 QString dealWithSymName(const QString &); 94 QString dealWithSymName(const QString &);
95 QDir *CurrentDir(); 95 QDir *CurrentDir();
96 QDir *OtherDir(); 96 QDir *OtherDir();
97 QListView *CurrentView(); 97 QListView *CurrentView();
98 QListView *OtherView(); 98 QListView *OtherView();
99 void setOtherTabCurrent(); 99 void setOtherTabCurrent();
100 void changeTo(QString & dir);
100 101
101//protected signals: 102//protected signals:
102 // void newPath(QString); 103 // void newPath(QString);
103 104
104protected slots: 105protected slots:
105 void slotSwitchMenu(int); 106 void slotSwitchMenu(int);
106 void selectAll(); 107 void selectAll();
107 void addToDocs(); 108 void addToDocs();
108 void doDirChange(); 109 void doDirChange();
109 void mkDir(); 110 void mkDir();
110 void del(); 111 void del();
111 void rn(); 112 void rn();
112 void populateView(); 113 void populateView();
113 void rePopulate(); 114 void rePopulate();
114 void showHidden(); 115 void showHidden();
115 void showMenuHidden(); 116 void showMenuHidden();
116 void writeConfig();
117 void readConfig();
118 void ListClicked(QListViewItem *); 117 void ListClicked(QListViewItem *);
119 void ListPressed( int, QListViewItem *, const QPoint&, int); 118 void ListPressed( int, QListViewItem *, const QPoint&, int);
120 void makeDir(); 119 void makeDir();
121 void doDelete(); 120 void doDelete();
122 void tabChanged(QWidget*); 121 void tabChanged(QWidget*);
123 void cleanUp(); 122 void cleanUp();
124 void renameIt(); 123 void renameIt();
125 void runThis(); 124 void runThis();
126 void runText(); 125 void runText();
127 void filePerms(); 126 void filePerms();
128 void doProperties(); 127 void doProperties();
129 void runCommand(); 128 void runCommand();