-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 10 |
2 files changed, 0 insertions, 11 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 42f3bc6..c25bce2 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -1,191 +1,190 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfm.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 |
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 | #ifndef ADVANCEDFM_H | 12 | #ifndef ADVANCEDFM_H |
13 | #define ADVANCEDFM_H | 13 | #define ADVANCEDFM_H |
14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties | 14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties |
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | #include <opie2/oprocess.h> | 17 | #include <opie2/oprocess.h> |
18 | #include <opie2/osplitter.h> | 18 | #include <opie2/osplitter.h> |
19 | 19 | ||
20 | #include <qpe/ir.h> | 20 | #include <qpe/ir.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | 22 | ||
23 | #include <qvariant.h> | 23 | #include <qvariant.h> |
24 | #include <qdialog.h> | 24 | #include <qdialog.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qpoint.h> | 29 | #include <qpoint.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qpixmap.h> | 31 | #include <qpixmap.h> |
32 | 32 | ||
33 | 33 | ||
34 | class QVBoxLayout; | 34 | class QVBoxLayout; |
35 | class QHBoxLayout; | 35 | class QHBoxLayout; |
36 | class QGridLayout; | 36 | class QGridLayout; |
37 | class QComboBox; | 37 | class QComboBox; |
38 | class QListView; | 38 | class QListView; |
39 | class QListviewItem; | 39 | class QListviewItem; |
40 | class QLabel; | 40 | class QLabel; |
41 | class QProgressBar; | 41 | class QProgressBar; |
42 | class QSpinBox; | 42 | class QSpinBox; |
43 | class QWidget; | 43 | class QWidget; |
44 | class QPopupMenu; | 44 | class QPopupMenu; |
45 | class QFile; | 45 | 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 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); | 58 | AdvancedFm(QWidget *p = 0, const char* name = 0, WFlags fl = 0); |
59 | ~AdvancedFm(); | 59 | ~AdvancedFm(); |
60 | protected: | 60 | protected: |
61 | 61 | ||
62 | Opie::Ui::OSplitter *TabWidget; | 62 | Opie::Ui::OSplitter *TabWidget; |
63 | QCopChannel * channel; | 63 | QCopChannel * channel; |
64 | QPixmap unknownXpm; | 64 | QPixmap unknownXpm; |
65 | int whichTab; | 65 | int whichTab; |
66 | // QTabWidget *TabWidget; | 66 | // QTabWidget *TabWidget; |
67 | QWidget *tab, *tab_2, *tab_3; | 67 | QWidget *tab, *tab_2, *tab_3; |
68 | QListView *Local_View, *Remote_View; | 68 | QListView *Local_View, *Remote_View; |
69 | 69 | ||
70 | QLineEdit *currentPathEdit; | 70 | QLineEdit *currentPathEdit; |
71 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; | 71 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; |
72 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 72 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
73 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 73 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
74 | QDir currentDir, currentRemoteDir; | 74 | QDir currentDir, currentRemoteDir; |
75 | QComboBox *currentPathCombo; | 75 | QComboBox *currentPathCombo; |
76 | QString filterStr, s_addBookmark, s_removeBookmark; | 76 | QString filterStr, s_addBookmark, s_removeBookmark; |
77 | QListViewItem * item; | 77 | QListViewItem * item; |
78 | bool b; | 78 | bool b; |
79 | QStringList fileSystemTypeList, fsList; | 79 | QStringList fileSystemTypeList, fsList; |
80 | int currentServerConfig; | 80 | int currentServerConfig; |
81 | bool zaurusDevice; | ||
82 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 81 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
83 | QStringList remoteDirPathStringList, localDirPathStringList; | 82 | QStringList remoteDirPathStringList, localDirPathStringList; |
84 | QLineEdit *renameBox; | 83 | QLineEdit *renameBox; |
85 | 84 | ||
86 | void init(); | 85 | void init(); |
87 | void initConnections(); | 86 | void initConnections(); |
88 | void keyReleaseEvent( QKeyEvent *); | 87 | void keyReleaseEvent( QKeyEvent *); |
89 | void keyPressEvent( QKeyEvent *); | 88 | void keyPressEvent( QKeyEvent *); |
90 | QString getFileSystemType(const QString &); | 89 | QString getFileSystemType(const QString &); |
91 | QString getDiskSpace(const QString &); | 90 | QString getDiskSpace(const QString &); |
92 | void parsetab(const QString &fileName); | 91 | void parsetab(const QString &fileName); |
93 | QString checkDiskSpace(const QString &); | 92 | QString checkDiskSpace(const QString &); |
94 | QString dealWithSymName(const QString &); | 93 | QString dealWithSymName(const QString &); |
95 | QDir *CurrentDir(); | 94 | QDir *CurrentDir(); |
96 | QDir *OtherDir(); | 95 | QDir *OtherDir(); |
97 | QListView *CurrentView(); | 96 | QListView *CurrentView(); |
98 | QListView *OtherView(); | 97 | QListView *OtherView(); |
99 | void setOtherTabCurrent(); | 98 | void setOtherTabCurrent(); |
100 | void changeTo(const QString dir); | 99 | void changeTo(const QString dir); |
101 | 100 | ||
102 | //protected signals: | 101 | //protected signals: |
103 | // void newPath(QString); | 102 | // void newPath(QString); |
104 | 103 | ||
105 | protected slots: | 104 | protected slots: |
106 | void slotSwitchMenu(int); | 105 | void slotSwitchMenu(int); |
107 | void selectAll(); | 106 | void selectAll(); |
108 | void addToDocs(); | 107 | void addToDocs(); |
109 | void doDirChange(); | 108 | void doDirChange(); |
110 | void mkDir(); | 109 | void mkDir(); |
111 | void del(); | 110 | void del(); |
112 | void rn(); | 111 | void rn(); |
113 | void populateView(); | 112 | void populateView(); |
114 | void rePopulate(); | 113 | void rePopulate(); |
115 | void showHidden(); | 114 | void showHidden(); |
116 | void showMenuHidden(); | 115 | void showMenuHidden(); |
117 | void ListClicked(QListViewItem *); | 116 | void ListClicked(QListViewItem *); |
118 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 117 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
119 | void makeDir(); | 118 | void makeDir(); |
120 | void doDelete(); | 119 | void doDelete(); |
121 | void tabChanged(QWidget*); | 120 | void tabChanged(QWidget*); |
122 | void cleanUp(); | 121 | void cleanUp(); |
123 | void renameIt(); | 122 | void renameIt(); |
124 | void runThis(); | 123 | void runThis(); |
125 | void runText(); | 124 | void runText(); |
126 | void filePerms(); | 125 | void filePerms(); |
127 | void doProperties(); | 126 | void doProperties(); |
128 | void runCommand(); | 127 | void runCommand(); |
129 | void runCommandStd(); | 128 | void runCommandStd(); |
130 | QStringList getPath(); | 129 | QStringList getPath(); |
131 | void mkSym(); | 130 | void mkSym(); |
132 | void switchToLocalTab(); | 131 | void switchToLocalTab(); |
133 | void switchToRemoteTab(); | 132 | void switchToRemoteTab(); |
134 | void refreshCurrentTab(); | 133 | void refreshCurrentTab(); |
135 | 134 | ||
136 | void openSearch(); | 135 | void openSearch(); |
137 | void dirMenuSelected(int); | 136 | void dirMenuSelected(int); |
138 | void showFileMenu(); | 137 | void showFileMenu(); |
139 | void homeButtonPushed(); | 138 | void homeButtonPushed(); |
140 | void docButtonPushed(); | 139 | void docButtonPushed(); |
141 | void SDButtonPushed(); | 140 | void SDButtonPushed(); |
142 | void CFButtonPushed(); | 141 | void CFButtonPushed(); |
143 | void QPEButtonPushed(); | 142 | void QPEButtonPushed(); |
144 | void upDir(); | 143 | void upDir(); |
145 | void currentPathComboChanged(); | 144 | void currentPathComboChanged(); |
146 | 145 | ||
147 | void copy(); | 146 | void copy(); |
148 | void copyTimer(); | 147 | void copyTimer(); |
149 | void copyAs(); | 148 | void copyAs(); |
150 | void copyAsTimer(); | 149 | void copyAsTimer(); |
151 | void copySameDir(); | 150 | void copySameDir(); |
152 | void copySameDirTimer(); | 151 | void copySameDirTimer(); |
153 | void move(); | 152 | void move(); |
154 | void moveTimer(); | 153 | void moveTimer(); |
155 | 154 | ||
156 | void fillCombo(const QString &); | 155 | void fillCombo(const QString &); |
157 | bool copyFile( const QString & , const QString & ); | 156 | bool copyFile( const QString & , const QString & ); |
158 | void fileStatus(); | 157 | void fileStatus(); |
159 | void doAbout(); | 158 | void doAbout(); |
160 | void doBeam(); | 159 | void doBeam(); |
161 | void fileBeamFinished( Ir *); | 160 | void fileBeamFinished( Ir *); |
162 | bool copyDirectory( const QString & , const QString & ); | 161 | bool copyDirectory( const QString & , const QString & ); |
163 | // void navigateToSelected(); | 162 | // void navigateToSelected(); |
164 | bool moveDirectory( const QString & , const QString & ); | 163 | bool moveDirectory( const QString & , const QString & ); |
165 | 164 | ||
166 | // void slotSwitchtoLocal(int); | 165 | // void slotSwitchtoLocal(int); |
167 | 166 | ||
168 | private: | 167 | private: |
169 | MenuButton *menuButton; | 168 | MenuButton *menuButton; |
170 | QString oldName, localViewDir, remoteViewDir; | 169 | QString oldName, localViewDir, remoteViewDir; |
171 | void startProcess(const QString &); | 170 | void startProcess(const QString &); |
172 | bool eventFilter( QObject * , QEvent * ); | 171 | bool eventFilter( QObject * , QEvent * ); |
173 | void cancelRename(); | 172 | void cancelRename(); |
174 | void doRename(QListView *); | 173 | void doRename(QListView *); |
175 | void okRename(); | 174 | void okRename(); |
176 | void customDirsToMenu(); | 175 | void customDirsToMenu(); |
177 | void addCustomDir(); | 176 | void addCustomDir(); |
178 | void removeCustomDir(); | 177 | void removeCustomDir(); |
179 | void navigateToSelected(); | 178 | void navigateToSelected(); |
180 | 179 | ||
181 | private slots: | 180 | private slots: |
182 | void processEnded(Opie::Core::OProcess *); | 181 | void processEnded(Opie::Core::OProcess *); |
183 | void oprocessStderr(Opie::Core::OProcess *, char *, int); | 182 | void oprocessStderr(Opie::Core::OProcess *, char *, int); |
184 | void gotoCustomDir(const QString &); | 183 | void gotoCustomDir(const QString &); |
185 | void qcopReceive(const QCString&, const QByteArray&); | 184 | void qcopReceive(const QCString&, const QByteArray&); |
186 | void setDocument(const QString &); | 185 | void setDocument(const QString &); |
187 | // void doMenu(int | 186 | // void doMenu(int |
188 | 187 | ||
189 | }; | 188 | }; |
190 | 189 | ||
191 | #endif // ADVANCEDFM_H | 190 | #endif // ADVANCEDFM_H |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index eaf4f79..3664c75 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -1,278 +1,268 @@ | |||
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 */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/storage.h> | 16 | #include <qpe/storage.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
19 | #include <qpe/menubutton.h> | 19 | #include <qpe/menubutton.h> |
20 | using namespace Opie::Core; | 20 | using namespace Opie::Core; |
21 | using namespace Opie::Ui; | 21 | using namespace Opie::Ui; |
22 | 22 | ||
23 | /* QT */ | 23 | /* QT */ |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qhbox.h> | 25 | #include <qhbox.h> |
26 | #include <qmenubar.h> | 26 | #include <qmenubar.h> |
27 | #include <qcombobox.h> | 27 | #include <qcombobox.h> |
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qlistview.h> | 30 | #include <qlistview.h> |
31 | 31 | ||
32 | /* STD */ | 32 | /* STD */ |
33 | #include <sys/utsname.h> | 33 | #include <sys/utsname.h> |
34 | 34 | ||
35 | void AdvancedFm::init() { | 35 | void AdvancedFm::init() { |
36 | b = false; | 36 | b = false; |
37 | setCaption( tr( "AdvancedFm" ) ); | 37 | setCaption( tr( "AdvancedFm" ) ); |
38 | 38 | ||
39 | QVBoxLayout *layout = new QVBoxLayout( this ); | 39 | QVBoxLayout *layout = new QVBoxLayout( this ); |
40 | layout->setSpacing( 2); | 40 | layout->setSpacing( 2); |
41 | layout->setMargin( 0); // squeeze | 41 | layout->setMargin( 0); // squeeze |
42 | 42 | ||
43 | QMenuBar *menuBar = new QMenuBar(this); | 43 | QMenuBar *menuBar = new QMenuBar(this); |
44 | menuBar->setMargin( 0 ); // squeeze | 44 | menuBar->setMargin( 0 ); // squeeze |
45 | fileMenu = new QPopupMenu( this ); | 45 | fileMenu = new QPopupMenu( this ); |
46 | viewMenu = new QPopupMenu( this ); | 46 | viewMenu = new QPopupMenu( this ); |
47 | // customDirMenu = new QPopupMenu( this ); | 47 | // customDirMenu = new QPopupMenu( this ); |
48 | 48 | ||
49 | layout->addWidget( menuBar ); | 49 | layout->addWidget( menuBar ); |
50 | 50 | ||
51 | menuBar->insertItem( tr( "File" ), fileMenu); | 51 | menuBar->insertItem( tr( "File" ), fileMenu); |
52 | menuBar->insertItem( tr( "View" ), viewMenu); | 52 | menuBar->insertItem( tr( "View" ), viewMenu); |
53 | 53 | ||
54 | cdUpButton = new QToolButton( 0,"cdUpButton"); | 54 | cdUpButton = new QToolButton( 0,"cdUpButton"); |
55 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 55 | cdUpButton->setPixmap(Resource::loadPixmap("up")); |
56 | cdUpButton->setAutoRaise( true ); | 56 | cdUpButton->setAutoRaise( true ); |
57 | menuBar->insertItem( cdUpButton ); | 57 | menuBar->insertItem( cdUpButton ); |
58 | 58 | ||
59 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 59 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
60 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 60 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); |
61 | qpeDirButton->setAutoRaise( true ); | 61 | qpeDirButton->setAutoRaise( true ); |
62 | menuBar->insertItem( qpeDirButton ); | 62 | menuBar->insertItem( qpeDirButton ); |
63 | 63 | ||
64 | cfButton = new QToolButton( 0, "CFButton"); | 64 | cfButton = new QToolButton( 0, "CFButton"); |
65 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | 65 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); |
66 | cfButton->setAutoRaise( true ); | 66 | cfButton->setAutoRaise( true ); |
67 | menuBar->insertItem( cfButton ); | 67 | menuBar->insertItem( cfButton ); |
68 | 68 | ||
69 | sdButton = new QToolButton( 0, "SDButton"); | 69 | sdButton = new QToolButton( 0, "SDButton"); |
70 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | 70 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); |
71 | sdButton->setAutoRaise( true ); | 71 | sdButton->setAutoRaise( true ); |
72 | menuBar->insertItem( sdButton ); | 72 | menuBar->insertItem( sdButton ); |
73 | 73 | ||
74 | docButton = new QToolButton( 0,"docsButton"); | 74 | docButton = new QToolButton( 0,"docsButton"); |
75 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 75 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); |
76 | docButton->setAutoRaise( true ); | 76 | docButton->setAutoRaise( true ); |
77 | menuBar->insertItem( docButton ); | 77 | menuBar->insertItem( docButton ); |
78 | 78 | ||
79 | homeButton = new QToolButton( 0, "homeButton"); | 79 | homeButton = new QToolButton( 0, "homeButton"); |
80 | homeButton->setPixmap(Resource::loadPixmap("home")); | 80 | homeButton->setPixmap(Resource::loadPixmap("home")); |
81 | homeButton->setAutoRaise( true ); | 81 | homeButton->setAutoRaise( true ); |
82 | menuBar->insertItem( homeButton ); | 82 | menuBar->insertItem( homeButton ); |
83 | 83 | ||
84 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 84 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
85 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 85 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
86 | fileMenu->insertSeparator(); | 86 | fileMenu->insertSeparator(); |
87 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 87 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
88 | fileMenu->insertSeparator(); | 88 | fileMenu->insertSeparator(); |
89 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 89 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
90 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 90 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
91 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 91 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
92 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 92 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
93 | fileMenu->insertSeparator(); | 93 | fileMenu->insertSeparator(); |
94 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 94 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
95 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 95 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
96 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 96 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
97 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 97 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
98 | fileMenu->setCheckable(TRUE); | 98 | fileMenu->setCheckable(TRUE); |
99 | 99 | ||
100 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); | 100 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
101 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); | 101 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
102 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); | 102 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); |
103 | // viewMenu->insertSeparator(); | 103 | // viewMenu->insertSeparator(); |
104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 104 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
105 | viewMenu->setCheckable(true); | 105 | viewMenu->setCheckable(true); |
106 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | 106 | viewMenu->setItemChecked( viewMenu->idAt(0), true); |
107 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | 107 | viewMenu->setItemChecked( viewMenu->idAt(1), false); |
108 | 108 | ||
109 | s_addBookmark = tr("Bookmark Directory"); | 109 | s_addBookmark = tr("Bookmark Directory"); |
110 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | 110 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); |
111 | 111 | ||
112 | // menuButton->insertItem(""); | 112 | // menuButton->insertItem(""); |
113 | 113 | ||
114 | // customDirMenu->insertItem(tr("Add This Directory")); | 114 | // customDirMenu->insertItem(tr("Add This Directory")); |
115 | // customDirMenu->insertItem(tr("Remove This Directory")); | 115 | // customDirMenu->insertItem(tr("Remove This Directory")); |
116 | // customDirMenu->insertSeparator(); | 116 | // customDirMenu->insertSeparator(); |
117 | 117 | ||
118 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later | 118 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later |
119 | CBHB->setMargin( 0 ); | 119 | CBHB->setMargin( 0 ); |
120 | CBHB->setSpacing( 1 ); | 120 | CBHB->setSpacing( 1 ); |
121 | 121 | ||
122 | menuButton = new MenuButton( this ); | 122 | menuButton = new MenuButton( this ); |
123 | 123 | ||
124 | menuButton->setUseLabel(false); | 124 | menuButton->setUseLabel(false); |
125 | menuButton->setMaximumWidth( 20 ); | 125 | menuButton->setMaximumWidth( 20 ); |
126 | menuButton->insertItem( s_addBookmark); | 126 | menuButton->insertItem( s_addBookmark); |
127 | menuButton->insertItem( s_removeBookmark); | 127 | menuButton->insertItem( s_removeBookmark); |
128 | menuButton->insertSeparator(); | 128 | menuButton->insertSeparator(); |
129 | // menuButton->setFocusPolicy(NoFocus); | 129 | // menuButton->setFocusPolicy(NoFocus); |
130 | CBHB->addWidget( menuButton ); | 130 | CBHB->addWidget( menuButton ); |
131 | 131 | ||
132 | customDirsToMenu(); | 132 | customDirsToMenu(); |
133 | 133 | ||
134 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 134 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
135 | currentPathCombo->setEditable(TRUE); | 135 | currentPathCombo->setEditable(TRUE); |
136 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 136 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
137 | // currentPathCombo->setFocusPolicy(NoFocus); | 137 | // currentPathCombo->setFocusPolicy(NoFocus); |
138 | CBHB->addWidget( currentPathCombo ); | 138 | CBHB->addWidget( currentPathCombo ); |
139 | 139 | ||
140 | layout->addLayout( CBHB ); | 140 | layout->addLayout( CBHB ); |
141 | 141 | ||
142 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); | 142 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); |
143 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 143 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
144 | layout->addWidget( TabWidget, 4 ); | 144 | layout->addWidget( TabWidget, 4 ); |
145 | 145 | ||
146 | tab = new QWidget( TabWidget, "tab" ); | 146 | tab = new QWidget( TabWidget, "tab" ); |
147 | tabLayout = new QGridLayout( tab ); | 147 | tabLayout = new QGridLayout( tab ); |
148 | tabLayout->setSpacing( 2); | 148 | tabLayout->setSpacing( 2); |
149 | tabLayout->setMargin( 2); | 149 | tabLayout->setMargin( 2); |
150 | 150 | ||
151 | Local_View = new QListView( tab, "Local_View" ); | 151 | Local_View = new QListView( tab, "Local_View" ); |
152 | Local_View->addColumn( tr("File"),130); | 152 | Local_View->addColumn( tr("File"),130); |
153 | Local_View->addColumn( tr("Size"),-1); | 153 | Local_View->addColumn( tr("Size"),-1); |
154 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 154 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
155 | Local_View->addColumn( tr("Date"),-1); | 155 | Local_View->addColumn( tr("Date"),-1); |
156 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 156 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
157 | Local_View->setAllColumnsShowFocus(TRUE); | 157 | Local_View->setAllColumnsShowFocus(TRUE); |
158 | Local_View->setMultiSelection( TRUE ); | 158 | Local_View->setMultiSelection( TRUE ); |
159 | Local_View->setSelectionMode(QListView::Extended); | 159 | Local_View->setSelectionMode(QListView::Extended); |
160 | Local_View->setFocusPolicy(StrongFocus); | 160 | Local_View->setFocusPolicy(StrongFocus); |
161 | Local_View->installEventFilter( this ); | 161 | Local_View->installEventFilter( this ); |
162 | 162 | ||
163 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); | 163 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); |
164 | 164 | ||
165 | tabLayout->addWidget( Local_View, 0, 0 ); | 165 | tabLayout->addWidget( Local_View, 0, 0 ); |
166 | 166 | ||
167 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); | 167 | TabWidget->addWidget( tab,"advancedfm/smFileBrowser.png", tr("1")); |
168 | // TabWidget->insertTab( tab, tr("1")); | 168 | // TabWidget->insertTab( tab, tr("1")); |
169 | 169 | ||
170 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 170 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
171 | tabLayout_2 = new QGridLayout( tab_2 ); | 171 | tabLayout_2 = new QGridLayout( tab_2 ); |
172 | tabLayout_2->setSpacing( 2); | 172 | tabLayout_2->setSpacing( 2); |
173 | tabLayout_2->setMargin( 2); | 173 | tabLayout_2->setMargin( 2); |
174 | 174 | ||
175 | Remote_View = new QListView( tab_2, "Remote_View" ); | 175 | Remote_View = new QListView( tab_2, "Remote_View" ); |
176 | Remote_View->addColumn( tr("File"),130); | 176 | Remote_View->addColumn( tr("File"),130); |
177 | Remote_View->addColumn( tr("Size"),-1); | 177 | Remote_View->addColumn( tr("Size"),-1); |
178 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 178 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
179 | Remote_View->addColumn( tr("Date"),-1); | 179 | Remote_View->addColumn( tr("Date"),-1); |
180 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 180 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
181 | Remote_View->setAllColumnsShowFocus(TRUE); | 181 | Remote_View->setAllColumnsShowFocus(TRUE); |
182 | Remote_View->setMultiSelection( TRUE ); | 182 | Remote_View->setMultiSelection( TRUE ); |
183 | Remote_View->setSelectionMode(QListView::Extended); | 183 | Remote_View->setSelectionMode(QListView::Extended); |
184 | Remote_View->setFocusPolicy(StrongFocus); | 184 | Remote_View->setFocusPolicy(StrongFocus); |
185 | Remote_View->installEventFilter( this ); | 185 | Remote_View->installEventFilter( this ); |
186 | 186 | ||
187 | QPEApplication::setStylusOperation( Remote_View->viewport(), QPEApplication::RightOnHold); | 187 | QPEApplication::setStylusOperation( Remote_View->viewport(), QPEApplication::RightOnHold); |
188 | 188 | ||
189 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 189 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
190 | 190 | ||
191 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); | 191 | TabWidget->addWidget( tab_2, "advancedfm/smFileBrowser.png",tr( "2")); |
192 | TabWidget->setSizeChange( 370 ); | 192 | TabWidget->setSizeChange( 370 ); |
193 | // TabWidget->insertTab( tab_2, tr( "2")); | 193 | // TabWidget->insertTab( tab_2, tr( "2")); |
194 | 194 | ||
195 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); | 195 | /* tab_3 = new QWidget( TabWidget, "tab_3" ); |
196 | tabLayout_3 = new QGridLayout( tab_3 ); | 196 | tabLayout_3 = new QGridLayout( tab_3 ); |
197 | tabLayout_3->setSpacing( 2); | 197 | tabLayout_3->setSpacing( 2); |
198 | tabLayout_3->setMargin( 2); | 198 | tabLayout_3->setMargin( 2); |
199 | 199 | ||
200 | 200 | ||
201 | // OFileDialog fileDialog; | 201 | // OFileDialog fileDialog; |
202 | // fileDialog; | 202 | // fileDialog; |
203 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy | 203 | // fileSelector = new FileSelector( "*",tab_3, "fileselector" , FALSE, FALSE); //buggy |
204 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); | 204 | // fileDialog = new OFileDialog("bangalow", tab_3, 4, 2, "Bungalow"); |
205 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); | 205 | // OFileSelector fileDialog = new OFileSelector( tab_3, 4, 2,"/"); |
206 | 206 | ||
207 | QListView *fileTree; | 207 | QListView *fileTree; |
208 | fileTree = new QListView( tab_3, "tree" ); | 208 | fileTree = new QListView( tab_3, "tree" ); |
209 | 209 | ||
210 | 210 | ||
211 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); | 211 | tabLayout_3->addMultiCellWidget( fileTree, 0, 0, 0, 3 ); |
212 | 212 | ||
213 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); | 213 | TabWidget->insertTab( tab_3, tr( "Remote" ) ); |
214 | */ | 214 | */ |
215 | 215 | ||
216 | /////////////// | 216 | /////////////// |
217 | 217 | ||
218 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | ||
219 | zaurusDevice=TRUE; | ||
220 | else | ||
221 | zaurusDevice=FALSE; | ||
222 | |||
223 | |||
224 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | 218 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { |
225 | odebug << "not have sd" << oendl; | ||
226 | sdButton->hide(); | 219 | sdButton->hide(); |
227 | } | 220 | } |
228 | if( !StorageInfo::hasCf() ) { | 221 | if( !StorageInfo::hasCf() ) { |
229 | odebug << "not have cf" << oendl; | ||
230 | cfButton->hide(); | 222 | cfButton->hide(); |
231 | } | 223 | } |
232 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 224 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
233 | currentDir.setPath( QDir::currentDirPath()); | 225 | currentDir.setPath( QDir::currentDirPath()); |
234 | 226 | ||
235 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 227 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
236 | currentRemoteDir.setPath( QDir::currentDirPath()); | 228 | currentRemoteDir.setPath( QDir::currentDirPath()); |
237 | 229 | ||
238 | // b = TRUE; | ||
239 | |||
240 | filterStr="*"; | 230 | filterStr="*"; |
241 | showMenuHidden(); | 231 | showMenuHidden(); |
242 | TabWidget->setCurrentWidget(0); | 232 | TabWidget->setCurrentWidget(0); |
243 | 233 | ||
244 | } | 234 | } |
245 | 235 | ||
246 | void AdvancedFm::initConnections() | 236 | void AdvancedFm::initConnections() |
247 | { | 237 | { |
248 | 238 | ||
249 | connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); | 239 | connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); |
250 | connect(qpeDirButton,SIGNAL(released()),this,SLOT(QPEButtonPushed())); | 240 | connect(qpeDirButton,SIGNAL(released()),this,SLOT(QPEButtonPushed())); |
251 | connect(cfButton,SIGNAL(released()),this,SLOT(CFButtonPushed())); | 241 | connect(cfButton,SIGNAL(released()),this,SLOT(CFButtonPushed())); |
252 | connect(sdButton,SIGNAL(released()),this,SLOT(SDButtonPushed())); | 242 | connect(sdButton,SIGNAL(released()),this,SLOT(SDButtonPushed())); |
253 | connect(cdUpButton,SIGNAL(released()),this,SLOT(upDir())); | 243 | connect(cdUpButton,SIGNAL(released()),this,SLOT(upDir())); |
254 | connect(docButton,SIGNAL(released()),this,SLOT(docButtonPushed())); | 244 | connect(docButton,SIGNAL(released()),this,SLOT(docButtonPushed())); |
255 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed())); | 245 | connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed())); |
256 | connect(currentPathCombo,SIGNAL(activated(const QString&)),this,SLOT(changeTo(const QString&))); | 246 | connect(currentPathCombo,SIGNAL(activated(const QString&)),this,SLOT(changeTo(const QString&))); |
257 | 247 | ||
258 | connect(currentPathCombo->lineEdit(),SIGNAL(returnPressed()),this,SLOT(currentPathComboChanged())); | 248 | connect(currentPathCombo->lineEdit(),SIGNAL(returnPressed()),this,SLOT(currentPathComboChanged())); |
259 | 249 | ||
260 | connect(Local_View,SIGNAL(clicked(QListViewItem*)),this,SLOT( ListClicked(QListViewItem*))); | 250 | connect(Local_View,SIGNAL(clicked(QListViewItem*)),this,SLOT( ListClicked(QListViewItem*))); |
261 | 251 | ||
262 | connect(Local_View,SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 252 | connect(Local_View,SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
263 | 253 | ||
264 | connect(Remote_View,SIGNAL(clicked(QListViewItem*)),this,SLOT(ListClicked(QListViewItem*))); | 254 | connect(Remote_View,SIGNAL(clicked(QListViewItem*)),this,SLOT(ListClicked(QListViewItem*))); |
265 | connect(Remote_View,SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),this,SLOT(ListPressed(int,QListViewItem*,const QPoint&,int))); | 255 | connect(Remote_View,SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),this,SLOT(ListPressed(int,QListViewItem*,const QPoint&,int))); |
266 | 256 | ||
267 | connect(TabWidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); | 257 | connect(TabWidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); |
268 | 258 | ||
269 | connect(Remote_View,SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),this,SLOT(showFileMenu())); | 259 | connect(Remote_View,SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),this,SLOT(showFileMenu())); |
270 | connect(Local_View,SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),this,SLOT(showFileMenu())); | 260 | connect(Local_View,SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),this,SLOT(showFileMenu())); |
271 | 261 | ||
272 | connect(menuButton,SIGNAL(selected(const QString&)),SLOT(gotoCustomDir(const QString&))); | 262 | connect(menuButton,SIGNAL(selected(const QString&)),SLOT(gotoCustomDir(const QString&))); |
273 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); | 263 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); |
274 | connect(viewMenu,SIGNAL(activated(int)),this,SLOT(slotSwitchMenu(int))); | 264 | connect(viewMenu,SIGNAL(activated(int)),this,SLOT(slotSwitchMenu(int))); |
275 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 265 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
276 | 266 | ||
277 | } | 267 | } |
278 | 268 | ||