author | zecke <zecke> | 2004-08-18 22:07:30 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-18 22:07:30 (UTC) |
commit | 50636a24f8ec2e603f1888a18dba044a1045bf0b (patch) (unidiff) | |
tree | 9f69140b2449aaefe263e7acab3b6b147c7fadf7 /noncore | |
parent | eb0a70826bc77c8b4008bd0444218da7612d32a9 (diff) | |
download | opie-50636a24f8ec2e603f1888a18dba044a1045bf0b.zip opie-50636a24f8ec2e603f1888a18dba044a1045bf0b.tar.gz opie-50636a24f8ec2e603f1888a18dba044a1045bf0b.tar.bz2 |
-Remove #ifdef for NOQUICKLAUNCH as OPIE_EXPORT_APP works for
both cases already.
-Use QPEApplication::setStylusOperation for RightOnHold feature
instead of custom code
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 13 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 6 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/advancedfm/main.cpp | 2 |
4 files changed, 4 insertions, 24 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index a47edd8..afb44f5 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -26,29 +26,25 @@ | |||
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | 27 | ||
28 | 28 | ||
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <time.h> | 30 | #include <time.h> |
31 | #include <dirent.h> | 31 | #include <dirent.h> |
32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
33 | #include <sys/vfs.h> | 33 | #include <sys/vfs.h> |
34 | #include <mntent.h> | 34 | #include <mntent.h> |
35 | 35 | ||
36 | using namespace Opie::Ui; | 36 | using namespace Opie::Ui; |
37 | 37 | ||
38 | #ifdef NOQUICKLAUNCH | ||
39 | AdvancedFm::AdvancedFm( ) | ||
40 | #else | ||
41 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | 38 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) |
42 | #endif | ||
43 | : QMainWindow( ) { | 39 | : QMainWindow( ) { |
44 | init(); | 40 | init(); |
45 | renameBox = 0; | 41 | renameBox = 0; |
46 | 42 | ||
47 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 43 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
48 | 44 | ||
49 | initConnections(); | 45 | initConnections(); |
50 | whichTab=1; | 46 | whichTab=1; |
51 | rePopulate(); | 47 | rePopulate(); |
52 | currentPathCombo->setFocus(); | 48 | currentPathCombo->setFocus(); |
53 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 49 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
54 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 50 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
@@ -250,27 +246,24 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | |||
250 | } | 246 | } |
251 | 247 | ||
252 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { | 248 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { |
253 | dealWithSchmooSchmaa( item->listView()); | 249 | dealWithSchmooSchmaa( item->listView()); |
254 | switch (mouse) { | 250 | switch (mouse) { |
255 | case 1: | 251 | case 1: |
256 | { | 252 | { |
257 | if(renameBox != 0 ) { | 253 | if(renameBox != 0 ) { |
258 | cancelRename(); | 254 | cancelRename(); |
259 | } | 255 | } |
260 | } | 256 | } |
261 | break; | 257 | break; |
262 | case 2: | ||
263 | menuTimer.start( 500, TRUE ); | ||
264 | break; | ||
265 | }; | 258 | }; |
266 | } | 259 | } |
267 | 260 | ||
268 | 261 | ||
269 | void AdvancedFm::switchToLocalTab() { | 262 | void AdvancedFm::switchToLocalTab() { |
270 | //owarn << "switch to local view" << oendl; | 263 | //owarn << "switch to local view" << oendl; |
271 | TabWidget->setCurrentWidget(0); | 264 | TabWidget->setCurrentWidget(0); |
272 | Local_View->setFocus(); | 265 | Local_View->setFocus(); |
273 | } | 266 | } |
274 | 267 | ||
275 | void AdvancedFm::switchToRemoteTab() { | 268 | void AdvancedFm::switchToRemoteTab() { |
276 | //owarn << "switch to local view" << oendl; | 269 | //owarn << "switch to local view" << oendl; |
@@ -597,30 +590,24 @@ void AdvancedFm::showFileMenu() { | |||
597 | m->setItemChecked(m->idAt(0),FALSE); | 590 | m->setItemChecked(m->idAt(0),FALSE); |
598 | 591 | ||
599 | if(Ir::supported()) | 592 | if(Ir::supported()) |
600 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); | 593 | m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); |
601 | m->setFocus(); | 594 | m->setFocus(); |
602 | 595 | ||
603 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 596 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
604 | 597 | ||
605 | if(m) delete m; | 598 | if(m) delete m; |
606 | } | 599 | } |
607 | 600 | ||
608 | 601 | ||
609 | void AdvancedFm::cancelMenuTimer() { | ||
610 | |||
611 | if( menuTimer.isActive() ) | ||
612 | menuTimer.stop(); | ||
613 | } | ||
614 | |||
615 | QString AdvancedFm::checkDiskSpace(const QString &path) { | 602 | QString AdvancedFm::checkDiskSpace(const QString &path) { |
616 | struct statfs fss; | 603 | struct statfs fss; |
617 | if ( !statfs( path.latin1(), &fss ) ) { | 604 | if ( !statfs( path.latin1(), &fss ) ) { |
618 | int blkSize = fss.f_bsize; | 605 | int blkSize = fss.f_bsize; |
619 | // int totalBlks = fs.f_blocks; | 606 | // int totalBlks = fs.f_blocks; |
620 | int availBlks = fss.f_bavail; | 607 | int availBlks = fss.f_bavail; |
621 | 608 | ||
622 | long mult = blkSize / 1024; | 609 | long mult = blkSize / 1024; |
623 | long div = 1024 / blkSize; | 610 | long div = 1024 / blkSize; |
624 | if ( !mult ) mult = 1; | 611 | if ( !mult ) mult = 1; |
625 | if ( !div ) div = 1; | 612 | if ( !div ) div = 1; |
626 | 613 | ||
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 4eaa6d6..effda0b 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -46,29 +46,25 @@ class QFile; | |||
46 | class QListViewItem; | 46 | class QListViewItem; |
47 | class QLineEdit; | 47 | class QLineEdit; |
48 | class MenuButton; | 48 | class MenuButton; |
49 | 49 | ||
50 | class QToolButton; | 50 | class QToolButton; |
51 | class Ir; | 51 | class Ir; |
52 | 52 | ||
53 | class AdvancedFm : public QMainWindow | 53 | class AdvancedFm : public QMainWindow |
54 | { | 54 | { |
55 | Q_OBJECT | 55 | Q_OBJECT |
56 | public: | 56 | public: |
57 | static QString appName() { return QString::fromLatin1("advancedfm"); } | 57 | static QString appName() { return QString::fromLatin1("advancedfm"); } |
58 | #ifdef NOQUICKLAUNCH | ||
59 | AdvancedFm(); | ||
60 | #else | ||
61 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); | 58 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); |
62 | #endif | ||
63 | ~AdvancedFm(); | 59 | ~AdvancedFm(); |
64 | protected slots: | 60 | protected slots: |
65 | void slotSwitchMenu(int); | 61 | void slotSwitchMenu(int); |
66 | void selectAll(); | 62 | void selectAll(); |
67 | void addToDocs(); | 63 | void addToDocs(); |
68 | void doDirChange(); | 64 | void doDirChange(); |
69 | void mkDir(); | 65 | void mkDir(); |
70 | void del(); | 66 | void del(); |
71 | void rn(); | 67 | void rn(); |
72 | void populateView(); | 68 | void populateView(); |
73 | void rePopulate(); | 69 | void rePopulate(); |
74 | void showHidden(); | 70 | void showHidden(); |
@@ -130,25 +126,24 @@ protected: | |||
130 | QString dealWithSymName(const QString &); | 126 | QString dealWithSymName(const QString &); |
131 | QDir *CurrentDir(); | 127 | QDir *CurrentDir(); |
132 | QDir *OtherDir(); | 128 | QDir *OtherDir(); |
133 | QListView *CurrentView(); | 129 | QListView *CurrentView(); |
134 | QListView *OtherView(); | 130 | QListView *OtherView(); |
135 | void setOtherTabCurrent(); | 131 | void setOtherTabCurrent(); |
136 | void dealWithSchmooSchmaa(QWidget *); | 132 | void dealWithSchmooSchmaa(QWidget *); |
137 | 133 | ||
138 | protected slots: | 134 | protected slots: |
139 | void openSearch(); | 135 | void openSearch(); |
140 | void dirMenuSelected(int); | 136 | void dirMenuSelected(int); |
141 | void showFileMenu(); | 137 | void showFileMenu(); |
142 | void cancelMenuTimer(); | ||
143 | void homeButtonPushed(); | 138 | void homeButtonPushed(); |
144 | void docButtonPushed(); | 139 | void docButtonPushed(); |
145 | void SDButtonPushed(); | 140 | void SDButtonPushed(); |
146 | void CFButtonPushed(); | 141 | void CFButtonPushed(); |
147 | void QPEButtonPushed(); | 142 | void QPEButtonPushed(); |
148 | void upDir(); | 143 | void upDir(); |
149 | void currentPathComboChanged(); | 144 | void currentPathComboChanged(); |
150 | void copy(); | 145 | void copy(); |
151 | void copyAs(); | 146 | void copyAs(); |
152 | void copySameDir(); | 147 | void copySameDir(); |
153 | void currentPathComboActivated(const QString &); | 148 | void currentPathComboActivated(const QString &); |
154 | void fillCombo(const QString &); | 149 | void fillCombo(const QString &); |
@@ -157,25 +152,24 @@ protected slots: | |||
157 | void fileStatus(); | 152 | void fileStatus(); |
158 | void doAbout(); | 153 | void doAbout(); |
159 | void doBeam(); | 154 | void doBeam(); |
160 | void fileBeamFinished( Ir *); | 155 | void fileBeamFinished( Ir *); |
161 | bool copyDirectory( const QString & , const QString & ); | 156 | bool copyDirectory( const QString & , const QString & ); |
162 | // void navigateToSelected(); | 157 | // void navigateToSelected(); |
163 | bool moveDirectory( const QString & , const QString & ); | 158 | bool moveDirectory( const QString & , const QString & ); |
164 | // void slotSwitchtoLocal(int); | 159 | // void slotSwitchtoLocal(int); |
165 | 160 | ||
166 | private: | 161 | private: |
167 | MenuButton *menuButton; | 162 | MenuButton *menuButton; |
168 | QString oldName; | 163 | QString oldName; |
169 | QTimer menuTimer; | ||
170 | void startProcess(const QString &); | 164 | void startProcess(const QString &); |
171 | bool eventFilter( QObject * , QEvent * ); | 165 | bool eventFilter( QObject * , QEvent * ); |
172 | void cancelRename(); | 166 | void cancelRename(); |
173 | void doRename(QListView *); | 167 | void doRename(QListView *); |
174 | void okRename(); | 168 | void okRename(); |
175 | void customDirsToMenu(); | 169 | void customDirsToMenu(); |
176 | void addCustomDir(); | 170 | void addCustomDir(); |
177 | void removeCustomDir(); | 171 | void removeCustomDir(); |
178 | void gotoDirectory(const QString &); | 172 | void gotoDirectory(const QString &); |
179 | void navigateToSelected(); | 173 | void navigateToSelected(); |
180 | void findFile(const QString &); | 174 | void findFile(const QString &); |
181 | 175 | ||
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 29335f8..dc7e8e1 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -264,31 +264,32 @@ void AdvancedFm::initConnections() | |||
264 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), | 264 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), |
265 | this, SLOT( currentPathComboActivated(const QString&) ) ); | 265 | this, SLOT( currentPathComboActivated(const QString&) ) ); |
266 | 266 | ||
267 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 267 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
268 | this,SLOT(currentPathComboChanged())); | 268 | this,SLOT(currentPathComboChanged())); |
269 | 269 | ||
270 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), | 270 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), |
271 | this,SLOT( ListClicked(QListViewItem*)) ); | 271 | this,SLOT( ListClicked(QListViewItem*)) ); |
272 | 272 | ||
273 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | 273 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), |
274 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 274 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
275 | 275 | ||
276 | connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); | ||
277 | |||
278 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), | 276 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), |
279 | this,SLOT( ListClicked(QListViewItem*)) ); | 277 | this,SLOT( ListClicked(QListViewItem*)) ); |
280 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), | 278 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), |
281 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 279 | this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
282 | 280 | ||
283 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), | 281 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), |
284 | this,SLOT(tabChanged(QWidget*))); | 282 | this,SLOT(tabChanged(QWidget*))); |
285 | 283 | ||
286 | connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); | 284 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), |
285 | this, SLOT(showFileMenu())); | ||
286 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), | ||
287 | this, SLOT(showFileMenu())); | ||
287 | 288 | ||
288 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); | 289 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); |
289 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); | 290 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); |
290 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); | 291 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); |
291 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 292 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
292 | 293 | ||
293 | } | 294 | } |
294 | 295 | ||
diff --git a/noncore/apps/advancedfm/main.cpp b/noncore/apps/advancedfm/main.cpp index df0d4af..06fc741 100644 --- a/noncore/apps/advancedfm/main.cpp +++ b/noncore/apps/advancedfm/main.cpp | |||
@@ -1,16 +1,14 @@ | |||
1 | 1 | ||
2 | /*************************************************************************** | 2 | /*************************************************************************** |
3 | using namespace Opie::Core; | ||
4 | using namespace Opie::Core; | ||
5 | main.cpp - description | 3 | main.cpp - description |
6 | ------------------- | 4 | ------------------- |
7 | begin : March 10, 2002 | 5 | begin : March 10, 2002 |
8 | copyright : (C) 2002 by llornkcor | 6 | copyright : (C) 2002 by llornkcor |
9 | email : ljp@llornkcor.com | 7 | email : ljp@llornkcor.com |
10 | * This program is free software; you can redistribute it and/or modify * | 8 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 9 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 10 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 11 | * (at your option) any later version. * |
14 | ***************************************************************************/ | 12 | ***************************************************************************/ |
15 | 13 | ||
16 | #include "advancedfm.h" | 14 | #include "advancedfm.h" |