-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index b4461cb..4de7d38 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -224,128 +224,134 @@ void AdvancedFm::rePopulate() { | |||
224 | 224 | ||
225 | // int tmpTab = whichTab; | 225 | // int tmpTab = whichTab; |
226 | // // odebug << "" << tmpTab << "" << oendl; | 226 | // // odebug << "" << tmpTab << "" << oendl; |
227 | 227 | ||
228 | // for(int i =1; i < 3; i++) { | 228 | // for(int i =1; i < 3; i++) { |
229 | // TabWidget->setCurrentWidget(i - 1); | 229 | // TabWidget->setCurrentWidget(i - 1); |
230 | // populateView(); | 230 | // populateView(); |
231 | // } | 231 | // } |
232 | // TabWidget->setCurrentWidget( tmpTab - 1); | 232 | // TabWidget->setCurrentWidget( tmpTab - 1); |
233 | } | 233 | } |
234 | 234 | ||
235 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | 235 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { |
236 | if ( TabWidget->currentWidget() == tab) | 236 | if ( TabWidget->currentWidget() == tab) |
237 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); | 237 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); |
238 | else | 238 | else |
239 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); | 239 | qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); |
240 | 240 | ||
241 | 241 | ||
242 | if(selectedItem) { | 242 | if(selectedItem) { |
243 | QString strItem=selectedItem->text(0); | 243 | QString strItem=selectedItem->text(0); |
244 | // owarn << strItem << oendl; | 244 | // owarn << strItem << oendl; |
245 | QString strSize=selectedItem->text(1); | 245 | QString strSize=selectedItem->text(1); |
246 | strSize=strSize.stripWhiteSpace(); | 246 | strSize=strSize.stripWhiteSpace(); |
247 | bool isDirectory = false; | 247 | bool isDirectory = false; |
248 | QString strItem2; | 248 | QString strItem2; |
249 | 249 | ||
250 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink | 250 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink |
251 | strItem2 = dealWithSymName((const QString&)strItem); | 251 | strItem2 = dealWithSymName((const QString&)strItem); |
252 | if(QDir(strItem2).exists() ) | 252 | if(QDir(strItem2).exists() ) |
253 | strItem = strItem2; | 253 | strItem = strItem2; |
254 | } | 254 | } |
255 | 255 | ||
256 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 256 | if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
257 | 257 | ||
258 | if(QDir(strItem).exists()) | 258 | if(QDir(strItem).exists()) |
259 | isDirectory = true; | 259 | isDirectory = true; |
260 | } | 260 | } |
261 | 261 | ||
262 | if( isDirectory ) { | 262 | if( isDirectory ) { |
263 | CurrentDir()->cd( strItem, TRUE); | 263 | CurrentDir()->cd( strItem, TRUE); |
264 | populateView(); | 264 | populateView(); |
265 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); | 265 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); |
266 | } | 266 | } |
267 | chdir( strItem.latin1()); | 267 | chdir( strItem.latin1()); |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { | 271 | void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , int ) { |
272 | Q_UNUSED(item); | 272 | Q_UNUSED(item); |
273 | switch (mouse) { | 273 | switch (mouse) { |
274 | case 1: | 274 | case 1: |
275 | { | 275 | { |
276 | if(renameBox != 0 ) { | 276 | if(renameBox != 0 ) { |
277 | cancelRename(); | 277 | cancelRename(); |
278 | } | 278 | } |
279 | } | 279 | } |
280 | break; | 280 | break; |
281 | // case 2: | 281 | // case 2: |
282 | // menuTimer.start( 50, TRUE ); | 282 | // menuTimer.start( 50, TRUE ); |
283 | // break; | 283 | // break; |
284 | }; | 284 | }; |
285 | } | 285 | } |
286 | 286 | ||
287 | 287 | ||
288 | void AdvancedFm::refreshCurrentTab() { | ||
289 | populateView(); | ||
290 | // if ( TabWidget->currentWidget() == tab) { | ||
291 | |||
292 | } | ||
293 | |||
288 | void AdvancedFm::switchToLocalTab() { | 294 | void AdvancedFm::switchToLocalTab() { |
289 | TabWidget->setCurrentWidget(0); | 295 | TabWidget->setCurrentWidget(0); |
290 | Local_View->setFocus(); | 296 | Local_View->setFocus(); |
291 | 297 | ||
292 | } | 298 | } |
293 | 299 | ||
294 | void AdvancedFm::switchToRemoteTab() { | 300 | void AdvancedFm::switchToRemoteTab() { |
295 | TabWidget->setCurrentWidget(1); | 301 | TabWidget->setCurrentWidget(1); |
296 | Remote_View->setFocus(); | 302 | Remote_View->setFocus(); |
297 | } | 303 | } |
298 | 304 | ||
299 | void AdvancedFm::readConfig() { | 305 | void AdvancedFm::readConfig() { |
300 | Config cfg("AdvancedFm"); | 306 | Config cfg("AdvancedFm"); |
301 | } | 307 | } |
302 | 308 | ||
303 | void AdvancedFm::writeConfig() { | 309 | void AdvancedFm::writeConfig() { |
304 | Config cfg("AdvancedFm"); | 310 | Config cfg("AdvancedFm"); |
305 | } | 311 | } |
306 | 312 | ||
307 | void AdvancedFm::currentPathComboChanged() { | 313 | void AdvancedFm::currentPathComboChanged() { |
308 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { | 314 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) { |
309 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); | 315 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); |
310 | populateView(); | 316 | populateView(); |
311 | } else { | 317 | } else { |
312 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); | 318 | QMessageBox::message(tr("Note"),tr("That directory does not exist")); |
313 | } | 319 | } |
314 | } | 320 | } |
315 | 321 | ||
316 | void AdvancedFm::fillCombo(const QString ¤tPath) { | 322 | void AdvancedFm::fillCombo(const QString ¤tPath) { |
317 | 323 | ||
318 | if ( TabWidget->currentWidget() == tab) { | 324 | if ( TabWidget->currentWidget() == tab) { |
319 | // if ( whichTab == 1) { | 325 | // if ( whichTab == 1) { |
320 | currentPathCombo->lineEdit()->setText( currentPath); | 326 | currentPathCombo->lineEdit()->setText( currentPath); |
321 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 327 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
322 | currentPathCombo->clear(); | 328 | currentPathCombo->clear(); |
323 | localDirPathStringList.prepend( currentPath ); | 329 | localDirPathStringList.prepend( currentPath ); |
324 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 330 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
325 | } | 331 | } |
326 | } else { | 332 | } else { |
327 | currentPathCombo->lineEdit()->setText( currentPath); | 333 | currentPathCombo->lineEdit()->setText( currentPath); |
328 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 334 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
329 | currentPathCombo->clear(); | 335 | currentPathCombo->clear(); |
330 | remoteDirPathStringList.prepend( currentPath ); | 336 | remoteDirPathStringList.prepend( currentPath ); |
331 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 337 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
332 | } | 338 | } |
333 | } | 339 | } |
334 | } | 340 | } |
335 | 341 | ||
336 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | 342 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { |
337 | chdir( currentPath.latin1() ); | 343 | chdir( currentPath.latin1() ); |
338 | CurrentDir()->cd( currentPath, TRUE); | 344 | CurrentDir()->cd( currentPath, TRUE); |
339 | populateView(); | 345 | populateView(); |
340 | update(); | 346 | update(); |
341 | } | 347 | } |
342 | 348 | ||
343 | QStringList AdvancedFm::getPath() { | 349 | QStringList AdvancedFm::getPath() { |
344 | QStringList strList; | 350 | QStringList strList; |
345 | QListView *thisView=CurrentView(); | 351 | QListView *thisView=CurrentView(); |
346 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); | 352 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); |
347 | QListViewItemIterator it( thisView ); | 353 | QListViewItemIterator it( thisView ); |
348 | for ( ; it.current(); ++it ) { | 354 | for ( ; it.current(); ++it ) { |
349 | if ( it.current()->isSelected() ) { | 355 | if ( it.current()->isSelected() ) { |
350 | strList << it.current()->text(0); | 356 | strList << it.current()->text(0); |
351 | // odebug << it.current()->text(0) << oendl; | 357 | // odebug << it.current()->text(0) << oendl; |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index e596977..def6fe2 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -27,129 +27,129 @@ | |||
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 slots: | 60 | protected slots: |
61 | void slotSwitchMenu(int); | 61 | void slotSwitchMenu(int); |
62 | void selectAll(); | 62 | void selectAll(); |
63 | void addToDocs(); | 63 | void addToDocs(); |
64 | void doDirChange(); | 64 | void doDirChange(); |
65 | void mkDir(); | 65 | void mkDir(); |
66 | void del(); | 66 | void del(); |
67 | void rn(); | 67 | void rn(); |
68 | void populateView(); | 68 | void populateView(); |
69 | void rePopulate(); | 69 | void rePopulate(); |
70 | void showHidden(); | 70 | void showHidden(); |
71 | void showMenuHidden(); | 71 | void showMenuHidden(); |
72 | void writeConfig(); | 72 | void writeConfig(); |
73 | void readConfig(); | 73 | void readConfig(); |
74 | void ListClicked(QListViewItem *); | 74 | void ListClicked(QListViewItem *); |
75 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 75 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
76 | void makeDir(); | 76 | void makeDir(); |
77 | void doDelete(); | 77 | void doDelete(); |
78 | void tabChanged(QWidget*); | 78 | void tabChanged(QWidget*); |
79 | void cleanUp(); | 79 | void cleanUp(); |
80 | void renameIt(); | 80 | void renameIt(); |
81 | void runThis(); | 81 | void runThis(); |
82 | void runText(); | 82 | void runText(); |
83 | void filePerms(); | 83 | void filePerms(); |
84 | void doProperties(); | 84 | void doProperties(); |
85 | void runCommand(); | 85 | void runCommand(); |
86 | void runCommandStd(); | 86 | void runCommandStd(); |
87 | QStringList getPath(); | 87 | QStringList getPath(); |
88 | void mkSym(); | 88 | void mkSym(); |
89 | void switchToLocalTab(); | 89 | void switchToLocalTab(); |
90 | void switchToRemoteTab(); | 90 | void switchToRemoteTab(); |
91 | 91 | void refreshCurrentTab(); | |
92 | protected: | 92 | protected: |
93 | 93 | ||
94 | Opie::Ui::OSplitter *TabWidget; | 94 | Opie::Ui::OSplitter *TabWidget; |
95 | QCopChannel * channel; | 95 | QCopChannel * channel; |
96 | QPixmap unknownXpm; | 96 | QPixmap unknownXpm; |
97 | int whichTab; | 97 | int whichTab; |
98 | // QTabWidget *TabWidget; | 98 | // QTabWidget *TabWidget; |
99 | QWidget *tab, *tab_2, *tab_3; | 99 | QWidget *tab, *tab_2, *tab_3; |
100 | QListView *Local_View, *Remote_View; | 100 | QListView *Local_View, *Remote_View; |
101 | 101 | ||
102 | QLineEdit *currentPathEdit; | 102 | QLineEdit *currentPathEdit; |
103 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; | 103 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; |
104 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 104 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
105 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 105 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
106 | QDir currentDir, currentRemoteDir; | 106 | QDir currentDir, currentRemoteDir; |
107 | QComboBox *currentPathCombo; | 107 | QComboBox *currentPathCombo; |
108 | QString filterStr, s_addBookmark, s_removeBookmark; | 108 | QString filterStr, s_addBookmark, s_removeBookmark; |
109 | QListViewItem * item; | 109 | QListViewItem * item; |
110 | bool b; | 110 | bool b; |
111 | QStringList fileSystemTypeList, fsList; | 111 | QStringList fileSystemTypeList, fsList; |
112 | int currentServerConfig; | 112 | int currentServerConfig; |
113 | bool zaurusDevice; | 113 | bool zaurusDevice; |
114 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 114 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
115 | QStringList remoteDirPathStringList, localDirPathStringList; | 115 | QStringList remoteDirPathStringList, localDirPathStringList; |
116 | QLineEdit *renameBox; | 116 | QLineEdit *renameBox; |
117 | 117 | ||
118 | void init(); | 118 | void init(); |
119 | void initConnections(); | 119 | void initConnections(); |
120 | void keyReleaseEvent( QKeyEvent *); | 120 | void keyReleaseEvent( QKeyEvent *); |
121 | void keyPressEvent( QKeyEvent *); | 121 | void keyPressEvent( QKeyEvent *); |
122 | QString getFileSystemType(const QString &); | 122 | QString getFileSystemType(const QString &); |
123 | QString getDiskSpace(const QString &); | 123 | QString getDiskSpace(const QString &); |
124 | void parsetab(const QString &fileName); | 124 | void parsetab(const QString &fileName); |
125 | QString checkDiskSpace(const QString &); | 125 | QString checkDiskSpace(const QString &); |
126 | QString dealWithSymName(const QString &); | 126 | QString dealWithSymName(const QString &); |
127 | QDir *CurrentDir(); | 127 | QDir *CurrentDir(); |
128 | QDir *OtherDir(); | 128 | QDir *OtherDir(); |
129 | QListView *CurrentView(); | 129 | QListView *CurrentView(); |
130 | QListView *OtherView(); | 130 | QListView *OtherView(); |
131 | void setOtherTabCurrent(); | 131 | void setOtherTabCurrent(); |
132 | 132 | ||
133 | protected slots: | 133 | protected slots: |
134 | 134 | ||
135 | void openSearch(); | 135 | void openSearch(); |
136 | void dirMenuSelected(int); | 136 | void dirMenuSelected(int); |
137 | void showFileMenu(); | 137 | void showFileMenu(); |
138 | void homeButtonPushed(); | 138 | void homeButtonPushed(); |
139 | void docButtonPushed(); | 139 | void docButtonPushed(); |
140 | void SDButtonPushed(); | 140 | void SDButtonPushed(); |
141 | void CFButtonPushed(); | 141 | void CFButtonPushed(); |
142 | void QPEButtonPushed(); | 142 | void QPEButtonPushed(); |
143 | void upDir(); | 143 | void upDir(); |
144 | void currentPathComboChanged(); | 144 | void currentPathComboChanged(); |
145 | void copy(); | 145 | void copy(); |
146 | void copyAs(); | 146 | void copyAs(); |
147 | void copySameDir(); | 147 | void copySameDir(); |
148 | void currentPathComboActivated(const QString &); | 148 | void currentPathComboActivated(const QString &); |
149 | void fillCombo(const QString &); | 149 | void fillCombo(const QString &); |
150 | bool copyFile( const QString & , const QString & ); | 150 | bool copyFile( const QString & , const QString & ); |
151 | void move(); | 151 | void move(); |
152 | void fileStatus(); | 152 | void fileStatus(); |
153 | void doAbout(); | 153 | void doAbout(); |
154 | void doBeam(); | 154 | void doBeam(); |
155 | void fileBeamFinished( Ir *); | 155 | void fileBeamFinished( Ir *); |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index dc7e8e1..1802571 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -40,128 +40,129 @@ void AdvancedFm::init() { | |||
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 | 59 | ||
60 | 60 | ||
61 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 61 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
62 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 62 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); |
63 | qpeDirButton->setAutoRaise( true ); | 63 | qpeDirButton->setAutoRaise( true ); |
64 | menuBar->insertItem( qpeDirButton ); | 64 | menuBar->insertItem( qpeDirButton ); |
65 | 65 | ||
66 | cfButton = new QToolButton( 0, "CFButton"); | 66 | cfButton = new QToolButton( 0, "CFButton"); |
67 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | 67 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); |
68 | cfButton->setAutoRaise( true ); | 68 | cfButton->setAutoRaise( true ); |
69 | menuBar->insertItem( cfButton ); | 69 | menuBar->insertItem( cfButton ); |
70 | 70 | ||
71 | sdButton = new QToolButton( 0, "SDButton"); | 71 | sdButton = new QToolButton( 0, "SDButton"); |
72 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | 72 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); |
73 | sdButton->setAutoRaise( true ); | 73 | sdButton->setAutoRaise( true ); |
74 | menuBar->insertItem( sdButton ); | 74 | menuBar->insertItem( sdButton ); |
75 | 75 | ||
76 | docButton = new QToolButton( 0,"docsButton"); | 76 | docButton = new QToolButton( 0,"docsButton"); |
77 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 77 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); |
78 | docButton->setAutoRaise( true ); | 78 | docButton->setAutoRaise( true ); |
79 | menuBar->insertItem( docButton ); | 79 | menuBar->insertItem( docButton ); |
80 | 80 | ||
81 | homeButton = new QToolButton( 0, "homeButton"); | 81 | homeButton = new QToolButton( 0, "homeButton"); |
82 | homeButton->setPixmap(Resource::loadPixmap("home")); | 82 | homeButton->setPixmap(Resource::loadPixmap("home")); |
83 | homeButton->setAutoRaise( true ); | 83 | homeButton->setAutoRaise( true ); |
84 | menuBar->insertItem( homeButton ); | 84 | menuBar->insertItem( homeButton ); |
85 | 85 | ||
86 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 86 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
87 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 87 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
88 | fileMenu->insertSeparator(); | 88 | fileMenu->insertSeparator(); |
89 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 89 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
90 | fileMenu->insertSeparator(); | 90 | fileMenu->insertSeparator(); |
91 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 91 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
92 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 92 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
93 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 93 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
94 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 94 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
95 | fileMenu->insertSeparator(); | 95 | fileMenu->insertSeparator(); |
96 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 96 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
97 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 97 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
98 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 98 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |
99 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 99 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
100 | fileMenu->setCheckable(TRUE); | 100 | fileMenu->setCheckable(TRUE); |
101 | 101 | ||
102 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); | 102 | viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); |
103 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); | 103 | viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); |
104 | viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); | ||
104 | // viewMenu->insertSeparator(); | 105 | // viewMenu->insertSeparator(); |
105 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 106 | // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
106 | viewMenu->setCheckable(true); | 107 | viewMenu->setCheckable(true); |
107 | viewMenu->setItemChecked( viewMenu->idAt(0), true); | 108 | viewMenu->setItemChecked( viewMenu->idAt(0), true); |
108 | viewMenu->setItemChecked( viewMenu->idAt(1), false); | 109 | viewMenu->setItemChecked( viewMenu->idAt(1), false); |
109 | 110 | ||
110 | s_addBookmark = tr("Bookmark Directory"); | 111 | s_addBookmark = tr("Bookmark Directory"); |
111 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); | 112 | s_removeBookmark = tr("Remove Current Directory from Bookmarks"); |
112 | 113 | ||
113 | // menuButton->insertItem(""); | 114 | // menuButton->insertItem(""); |
114 | 115 | ||
115 | // customDirMenu->insertItem(tr("Add This Directory")); | 116 | // customDirMenu->insertItem(tr("Add This Directory")); |
116 | // customDirMenu->insertItem(tr("Remove This Directory")); | 117 | // customDirMenu->insertItem(tr("Remove This Directory")); |
117 | // customDirMenu->insertSeparator(); | 118 | // customDirMenu->insertSeparator(); |
118 | 119 | ||
119 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later | 120 | QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later |
120 | CBHB->setMargin( 0 ); | 121 | CBHB->setMargin( 0 ); |
121 | CBHB->setSpacing( 1 ); | 122 | CBHB->setSpacing( 1 ); |
122 | 123 | ||
123 | menuButton = new MenuButton( this ); | 124 | menuButton = new MenuButton( this ); |
124 | 125 | ||
125 | menuButton->setUseLabel(false); | 126 | menuButton->setUseLabel(false); |
126 | menuButton->setMaximumWidth( 20 ); | 127 | menuButton->setMaximumWidth( 20 ); |
127 | menuButton->insertItem( s_addBookmark); | 128 | menuButton->insertItem( s_addBookmark); |
128 | menuButton->insertItem( s_removeBookmark); | 129 | menuButton->insertItem( s_removeBookmark); |
129 | menuButton->insertSeparator(); | 130 | menuButton->insertSeparator(); |
130 | menuButton->setFocusPolicy(NoFocus); | 131 | menuButton->setFocusPolicy(NoFocus); |
131 | CBHB->addWidget( menuButton ); | 132 | CBHB->addWidget( menuButton ); |
132 | 133 | ||
133 | customDirsToMenu(); | 134 | customDirsToMenu(); |
134 | 135 | ||
135 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 136 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
136 | currentPathCombo->setEditable(TRUE); | 137 | currentPathCombo->setEditable(TRUE); |
137 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 138 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
138 | currentPathCombo->setFocusPolicy(NoFocus); | 139 | currentPathCombo->setFocusPolicy(NoFocus); |
139 | CBHB->addWidget( currentPathCombo ); | 140 | CBHB->addWidget( currentPathCombo ); |
140 | 141 | ||
141 | layout->addLayout( CBHB ); | 142 | layout->addLayout( CBHB ); |
142 | 143 | ||
143 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); | 144 | TabWidget = new OSplitter( Horizontal, this, "TabWidget" ); |
144 | // TabWidget = new QTabWidget( this, "TabWidget" ); | 145 | // TabWidget = new QTabWidget( this, "TabWidget" ); |
145 | layout->addWidget( TabWidget, 4 ); | 146 | layout->addWidget( TabWidget, 4 ); |
146 | 147 | ||
147 | tab = new QWidget( TabWidget, "tab" ); | 148 | tab = new QWidget( TabWidget, "tab" ); |
148 | tabLayout = new QGridLayout( tab ); | 149 | tabLayout = new QGridLayout( tab ); |
149 | tabLayout->setSpacing( 2); | 150 | tabLayout->setSpacing( 2); |
150 | tabLayout->setMargin( 2); | 151 | tabLayout->setMargin( 2); |
151 | 152 | ||
152 | Local_View = new QListView( tab, "Local_View" ); | 153 | Local_View = new QListView( tab, "Local_View" ); |
153 | Local_View->addColumn( tr("File"),130); | 154 | Local_View->addColumn( tr("File"),130); |
154 | Local_View->addColumn( tr("Size"),-1); | 155 | Local_View->addColumn( tr("Size"),-1); |
155 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 156 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
156 | Local_View->addColumn( tr("Date"),-1); | 157 | Local_View->addColumn( tr("Date"),-1); |
157 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 158 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
158 | Local_View->setAllColumnsShowFocus(TRUE); | 159 | Local_View->setAllColumnsShowFocus(TRUE); |
159 | Local_View->setMultiSelection( TRUE ); | 160 | Local_View->setMultiSelection( TRUE ); |
160 | Local_View->setSelectionMode(QListView::Extended); | 161 | Local_View->setSelectionMode(QListView::Extended); |
161 | Local_View->setFocusPolicy(StrongFocus); | 162 | Local_View->setFocusPolicy(StrongFocus); |
162 | Local_View->installEventFilter( this ); | 163 | Local_View->installEventFilter( this ); |
163 | 164 | ||
164 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); | 165 | QPEApplication::setStylusOperation( Local_View->viewport() , QPEApplication::RightOnHold); |
165 | 166 | ||
166 | tabLayout->addWidget( Local_View, 0, 0 ); | 167 | tabLayout->addWidget( Local_View, 0, 0 ); |
167 | 168 | ||