summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp5
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp6
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp10
4 files changed, 15 insertions, 7 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 7fba0af..d7bad51 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1,61 +1,60 @@
/***************************************************************************
AdvancedFm.cpp
-------------------
** Created: Sat Mar 9 23:33:09 2002
copyright : (C) 2002 by ljp
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#define DEVELOPERS_VERSION
-
#include "advancedfm.h"
// #include <opie/ofileselector.h>
// #include <opie/ofiledialog.h>
#include <qpe/filemanager.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
#include <qpe/applnk.h>
#include <qpe/ir.h>
#include <qpe/resource.h>
#include <qtabwidget.h>
#include <qtextstream.h>
#include <qpushbutton.h>
#include <qdatetime.h>
#include <qdir.h>
#include <qfile.h>
#include <qstring.h>
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
#include <qmainwindow.h>
#include <qlabel.h>
#include <qprogressbar.h>
#include <qspinbox.h>
#include <qwidget.h>
#include <qlayout.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qregexp.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <dirent.h>
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
#include <mntent.h>
#include <string.h>
@@ -350,109 +349,109 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) {
void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) {
if(selectedItem) {
QString strItem=selectedItem->text(0);
QString strSize=selectedItem->text(1);
strSize=strSize.stripWhiteSpace();
if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
currentRemoteDir.cd(strItem2, TRUE);
populateRemoteView();
} else { // not a symlink
if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) {
if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) {
strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem);
currentRemoteDir.cd(strItem,FALSE);
populateRemoteView();
Remote_View->ensureItemVisible(Remote_View->firstChild());
} else {
currentRemoteDir.cdUp();
populateRemoteView();
Remote_View->ensureItemVisible(Remote_View->firstChild());
}
if(QDir(strItem).exists()){
currentRemoteDir.cd(strItem, TRUE);
populateRemoteView();
Remote_View->ensureItemVisible(Remote_View->firstChild());
}
} else {
strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem);
if( QFile::exists(strItem ) ) {
// qDebug("clicked item "+strItem);
// DocLnk doc( strItem, FALSE );
// doc.execute();
// Remote_View->clearSelection();
}
} //end not symlink
chdir(strItem.latin1());
}
}
}
void AdvancedFm::localListPressed( int mouse, QListViewItem *, const QPoint& , int ) {
// qDebug("list pressed");
switch (mouse) {
case 1:
break;
case 2:
- menuTimer.start( 750, TRUE );
+ menuTimer.start( 500, TRUE );
qDebug("Start menu timer\n");
break;
};
}
void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, int ) {
switch (mouse) {
case 1:
break;
case 2:
- menuTimer.start( 750, TRUE );
+ menuTimer.start( 500, TRUE );
qDebug("Start menu timer");
break;
};
}
void AdvancedFm::switchToLocalTab() {
TabWidget->setCurrentPage(0);
Local_View->setFocus();
}
void AdvancedFm::switchToRemoteTab() {
TabWidget->setCurrentPage(1);
Remote_View->setFocus();
}
void AdvancedFm::readConfig() {
Config cfg("AdvancedFm");
}
void AdvancedFm::writeConfig() {
Config cfg("AdvancedFm");
}
void AdvancedFm::currentPathComboChanged() {
if (TabWidget->currentPageIndex() == 0) {
if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
currentDir.setPath( currentPathCombo->lineEdit()->text() );
populateLocalView();
} else {
QMessageBox::message(tr("Note"),tr("That directory does not exist"));
}
}
if (TabWidget->currentPageIndex() == 0) {
if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() );
populateRemoteView();
} else {
QMessageBox::message(tr("Note"),tr("That directory does not exist"));
}
}
}
void AdvancedFm::fillCombo(const QString &currentPath) {
if (TabWidget->currentPageIndex() == 0) {
currentPathCombo->lineEdit()->setText( currentPath);
if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 12ad474..f846c66 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -1,62 +1,63 @@
/***************************************************************************
advancedfm.h
-------------------
** Created: Sat Mar 9 23:33:09 2002
copyright : (C) 2002 by ljp
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef ADVANCEDFM_H
#define ADVANCEDFM_H
#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
+#define QT_QWS_OPIE
#include <qpe/ir.h>
#include <qvariant.h>
#include <qdialog.h>
#include <qmainwindow.h>
#include <qstringlist.h>
#include <qdir.h>
#include <qstring.h>
#include <qpoint.h>
#include <qtimer.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QListView;
class QListviewItem;
class QLabel;
class QProgressBar;
class QSpinBox;
class QTabWidget;
class QWidget;
class QPEToolBar;
class QPEMenuBar;
class QPopupMenu;
class QFile;
class QListViewItem;
class QLineEdit;
//class QPushButton;
class QToolButton;
class Ir;
class AdvancedFm : public QMainWindow
{
Q_OBJECT
public:
AdvancedFm();
~AdvancedFm();
QTabWidget *TabWidget;
QWidget *tab, *tab_2, *tab_3;
QListView *Local_View, *Remote_View;
QLineEdit *currentPathEdit;
QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu;
QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
// QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton;
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 4c24e83..619a7a9 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -1,82 +1,84 @@
/***************************************************************************
advancedfmData.cpp
-------------------
** Created: Mon 09-23-2002 13:24:11
copyright : (C) 2002 by ljp
email : ljp@llornkcor.com
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "advancedfm.h"
#include <qpe/qpeapplication.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qcombobox.h>
#include <qpopupmenu.h>
#include <qtabwidget.h>
#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <sys/utsname.h>
void AdvancedFm::init() {
-
- setCaption( tr( "AdvancedFm" ) );
+#if defined(QT_QWS_OPIE)
+ qDebug("<<<<<<<<<<<<<<<<<<<<<<<< OPIE!!!");
+#endif
+ setCaption( tr( "AdvancedFm" ) );
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 2);
layout->setMargin( 2);
QPEMenuBar *menuBar = new QPEMenuBar(this);
fileMenu = new QPopupMenu( this );
viewMenu = new QPopupMenu( this );
layout->addMultiCellWidget( menuBar, 0, 0, 0, 1 );
menuBar->insertItem( tr( "File" ), fileMenu);
menuBar->insertItem( tr( "View" ), viewMenu);
qpeDirButton= new QToolButton(this,"QPEButton");
qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton");
qpeDirButton ->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( qpeDirButton , 0, 0, 2, 2);
cfButton = new QToolButton( this,"CFButton");
cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia"));
cfButton ->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( cfButton , 0, 0, 3, 3);
sdButton = new QToolButton( this,"SDButton");
sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard"));
sdButton->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( sdButton , 0, 0, 4, 4);
cdUpButton = new QToolButton( this,"cdUpButton");
cdUpButton->setPixmap(Resource::loadPixmap("up"));
cdUpButton ->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( cdUpButton , 0, 0, 5, 5);
docButton = new QToolButton( this,"docsButton");
docButton->setPixmap(Resource::loadPixmap("DocsIcon"));
docButton->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( docButton, 0, 0, 6, 6);
homeButton = new QToolButton( this,"homeButton");
homeButton->setPixmap(Resource::loadPixmap("home"));
homeButton->setFixedSize( QSize( 20, 20 ) );
layout->addMultiCellWidget( homeButton, 0, 0, 7, 7);
fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
fileMenu->insertSeparator();
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 7ee5065..6d37904 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -298,111 +298,117 @@ void AdvancedFm::localRename() {
void AdvancedFm::remoteRename()
{
QString curFile = Remote_View->currentItem()->text(0);
if( curFile !="../") {
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
fileDlg->setInputText((const QString &)curFile);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
QString oldname = currentRemoteDir.canonicalPath() + "/" + curFile;
QString newName = currentRemoteDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();
//+".playlist";
if( rename(oldname.latin1(), newName.latin1())== -1)
QMessageBox::message(tr("Note"),tr("Could not rename"));
}
populateRemoteView();
}
}
void AdvancedFm::filePerms() {
QStringList curFileList = getPath();
QString filePath;
if (TabWidget->currentPageIndex() == 0) {
filePath = currentDir.canonicalPath()+"/";
} else {
filePath= currentRemoteDir.canonicalPath()+"/";
}
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
filePermissions *filePerm;
filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
filePerm->showMaximized();
filePerm->exec();
if( filePerm)
delete filePerm;
}
if (TabWidget->currentPageIndex() == 0) {
populateLocalView();
} else {
populateRemoteView();
}
}
void AdvancedFm::doProperties() {
+#if defined(QT_QWS_OPIE)
+
QStringList curFileList = getPath();
+
QString filePath;
if (TabWidget->currentPageIndex() == 0) {
filePath = currentDir.canonicalPath()+"/";
} else {
filePath= currentRemoteDir.canonicalPath()+"/";
}
- // qDebug("%d",curFileList.count());
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
+ qDebug("%d",curFileList.count());
+
+ for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
qDebug((filePath+*it));
DocLnk lnk( (filePath+*it));
LnkProperties prop( &lnk );
prop.showMaximized();
prop.exec();
}
+#endif
+
}
void AdvancedFm::upDir() {
if (TabWidget->currentPageIndex() == 0) {
QString current = currentDir.canonicalPath();
QDir dir(current);
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateLocalView();
update();
} else {
QString current = currentRemoteDir.canonicalPath();
QDir dir(current);
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
update();
}
}
void AdvancedFm::copy() {
qApp->processEvents();
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
QString curFile, item, destFile;
if (TabWidget->currentPageIndex() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item=(*it);
if(item.find("->",0,TRUE)) //symlink
item = item.left(item.find("->",0,TRUE));
destFile = currentRemoteDir.canonicalPath()+"/"+ item;
qDebug("Destination file is "+destFile);
curFile = currentDir.canonicalPath()+"/"+ item;
qDebug("CurrentFile file is " + curFile);
QFile f(destFile);
if( f.exists()) {
switch ( QMessageBox::warning(this,tr("Delete"),
destFile+tr(" already exists\nDo you really want to delete it?"),
tr("Yes"),tr("No"),0,0,1) ) {
case 0: