summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2002-10-20 15:51:08 (UTC)
committer llornkcor <llornkcor>2002-10-20 15:51:08 (UTC)
commit0535df00106c4e4c78e6ae8dde8f4f41f8487dae (patch) (side-by-side diff)
treea00836456d62b54a2959c76276879d12efc5501e /noncore
parent1a583682e8a49e65d5c478ab72dffb78d120c850 (diff)
downloadopie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.zip
opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.gz
opie-0535df00106c4e4c78e6ae8dde8f4f41f8487dae.tar.bz2
converted to otab, and updated show hidden dir functions
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp56
-rw-r--r--noncore/apps/advancedfm/advancedfm.h5
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro2
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp14
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp80
5 files changed, 99 insertions, 58 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index f23fd86..08dc24e 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -7,16 +7,17 @@
* 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/otabwidget.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>
@@ -82,26 +83,29 @@ void AdvancedFm::cleanUp() {
else
sfile+="._temp";
QFile file( sfile);
if(file.exists())
file.remove();
}
void AdvancedFm::tabChanged(QWidget *) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
viewMenu->setItemChecked(viewMenu->idAt(0),TRUE);
viewMenu->setItemChecked(viewMenu->idAt(1),FALSE);
QString fs= getFileSystemType((const QString &) currentDir.canonicalPath());
setCaption("AdvancedFm :: "+fs+" :: "
+checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" );
}
- if (TabWidget->currentPageIndex() == 1) {
+ if (TabWidget->getCurrentTab() == 1) {
+
+// if (TabWidget->currentPageIndex() == 1) {
currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath());
viewMenu->setItemChecked(viewMenu->idAt(1),TRUE);
viewMenu->setItemChecked(viewMenu->idAt(0),FALSE);
QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath());
setCaption("AdvancedFm :: "+fs+" :: "
+checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" );
}
}
@@ -409,55 +413,58 @@ void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, in
menuTimer.start( 500, TRUE );
qDebug("Start menu timer");
break;
};
}
void AdvancedFm::switchToLocalTab() {
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
Local_View->setFocus();
}
void AdvancedFm::switchToRemoteTab() {
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
Remote_View->setFocus();
}
void AdvancedFm::readConfig() {
Config cfg("AdvancedFm");
}
void AdvancedFm::writeConfig() {
Config cfg("AdvancedFm");
}
void AdvancedFm::currentPathComboChanged() {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// 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 (TabWidget->getCurrentTab() == 0) {
+// 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) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentPathCombo->lineEdit()->setText( currentPath);
if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
currentPathCombo->clear();
localDirPathStringList.prepend( currentPath );
currentPathCombo->insertStringList( localDirPathStringList,-1);
}
} else {
currentPathCombo->lineEdit()->setText( currentPath);
@@ -465,32 +472,34 @@ void AdvancedFm::fillCombo(const QString &currentPath) {
currentPathCombo->clear();
remoteDirPathStringList.prepend( currentPath );
currentPathCombo->insertStringList( remoteDirPathStringList,-1);
}
}
}
void AdvancedFm::currentPathComboActivated(const QString & currentPath) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
chdir( currentPath.latin1() );
currentDir.cd( currentPath, TRUE);
populateLocalView();
update();
} else {
chdir( currentPath.latin1() );
currentRemoteDir.cd( currentPath, TRUE);
populateRemoteView();
update();
}
}
QStringList AdvancedFm::getPath() {
QStringList strList;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
QList<QListViewItem> * getSelectedItems( QListView * Local_View );
QListViewItemIterator it( Local_View );
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
strList << it.current()->text(0);
qDebug(it.current()->text(0));
}
}
@@ -507,43 +516,47 @@ QStringList AdvancedFm::getPath() {
return strList;
}
return "";
}
void AdvancedFm::homeButtonPushed() {
QString current = QDir::homeDirPath();
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
} else {
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
}
update();
}
void AdvancedFm::docButtonPushed() {
QString current = QPEApplication::documentDir();
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+
+ if (TabWidget->getCurrentTab() == 0) {
+//if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
} else {
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
}
update();
}
void AdvancedFm::SDButtonPushed() {
QString current = "/mnt/card";// this can change so fix
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
} else {
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
}
update();
@@ -552,17 +565,18 @@ void AdvancedFm::SDButtonPushed() {
void AdvancedFm::CFButtonPushed() {
QString current;
if(zaurusDevice)
current= "/mnt/cf"; //zaurus
else
current = "/mnt/hda"; //ipaq
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
} else {
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
}
update();
}
@@ -640,17 +654,18 @@ void AdvancedFm::keyReleaseEvent( QKeyEvent *e) {
break;
}
}
void AdvancedFm::QPEButtonPushed() {
QString current = QPEApplication::qpeDir();
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
} else {
currentRemoteDir.cd( current, TRUE);
populateRemoteView();
}
update();
}
@@ -712,31 +727,35 @@ QString AdvancedFm::getDiskSpace( const QString &path) {
return "";
}
void AdvancedFm::showFileMenu() {
QString curApp;
bool isLocalView = false;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
isLocalView = TRUE;
curApp = Local_View->currentItem()->text(0);
} else {
curApp = Remote_View->currentItem()->text(0);
}
MimeType mt( curApp );
const AppLnk* app = mt.application();
QFile fi(curApp);
QPopupMenu *m = new QPopupMenu(0);
QPopupMenu *n = new QPopupMenu(0);
// QPopupMenu *o = new QPopupMenu(0);
- m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
-
+ if (TabWidget->getCurrentTab() == 0)
+ m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
+ else
+ m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showRemoteHidden() ));
+
if ( QFileInfo(fi).isDir() ) {
m->insertSeparator();
m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
} else {
if ( app )
m->insertItem( app->pixmap(), tr( "Open in "
+ app->name() ), this, SLOT( runThis() ) );
@@ -824,17 +843,18 @@ QString AdvancedFm::checkDiskSpace(const QString &path) {
}
return "";
}
void AdvancedFm::addToDocs() {
QStringList strListPaths = getPath();
if( strListPaths.count() > 0) {
QString curFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
curFile = currentDir.canonicalPath()+"/"+(*it);
qDebug(curFile);
DocLnk f;
// curFile.replace(QRegExp("\\..*"),"");
f.setName((*it));
f.setFile( curFile);
f.writeLink();
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index f846c66..12ebbf2 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -9,27 +9,29 @@
* 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 <opie/otabwidget.h>
#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 OTabWidget;
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QComboBox;
class QListView;
class QListviewItem;
class QLabel;
class QProgressBar;
@@ -48,17 +50,18 @@ class Ir;
class AdvancedFm : public QMainWindow
{
Q_OBJECT
public:
AdvancedFm();
~AdvancedFm();
- QTabWidget *TabWidget;
+ OTabWidget *TabWidget;
+// 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;
QDir currentDir, currentRemoteDir;
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro
index eb4f122..3896f50 100644
--- a/noncore/apps/advancedfm/advancedfm.pro
+++ b/noncore/apps/advancedfm/advancedfm.pro
@@ -2,17 +2,17 @@ TEMPLATE = app
CONFIG += qt warn_on release
HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h
SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp
TARGET = advancedfm
REQUIRES=medium-config
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
DESTDIR = $(OPIEDIR)/bin
-LIBS += -lqpe
+LIBS += -lqpe -lopie
TRANSLATIONS = ../../../i18n/de/advancedfm.ts \
../../../i18n/en/advancedfm.ts \
../../../i18n/es/advancedfm.ts \
../../../i18n/fr/advancedfm.ts \
../../../i18n/hu/advancedfm.ts \
../../../i18n/ja/advancedfm.ts \
../../../i18n/ko/advancedfm.ts \
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 619a7a9..7188640 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -6,28 +6,28 @@
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 <opie/otabwidget.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() {
#if defined(QT_QWS_OPIE)
@@ -103,17 +103,18 @@ void AdvancedFm::init() {
layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
layout->addMultiCellWidget( currentPathCombo, 1, 1, 0, 7);
- TabWidget = new QTabWidget( this, "TabWidget" );
+ TabWidget = new OTabWidget( this, "TabWidget",/* OTabWidget::Global | */OTabWidget::IconTab);
+// TabWidget = new QTabWidget( this, "TabWidget" );
layout->addMultiCellWidget( TabWidget, 2, 2, 0, 7);
tab = new QWidget( TabWidget, "tab" );
tabLayout = new QGridLayout( tab );
tabLayout->setSpacing( 2);
tabLayout->setMargin( 2);
Local_View = new QListView( tab, "Local_View" );
@@ -125,17 +126,18 @@ void AdvancedFm::init() {
Local_View->setAllColumnsShowFocus(TRUE);
Local_View->setMultiSelection( TRUE );
Local_View->setSelectionMode(QListView::Extended);
QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
tabLayout->addWidget( Local_View, 0, 0 );
- TabWidget->insertTab( tab, tr("1"));
+ TabWidget->addTab( tab,"advancedfm/smFileBrowser.png", tr("1"));
+// TabWidget->insertTab( tab, tr("1"));
tab_2 = new QWidget( TabWidget, "tab_2" );
tabLayout_2 = new QGridLayout( tab_2 );
tabLayout_2->setSpacing( 2);
tabLayout_2->setMargin( 2);
Remote_View = new QListView( tab_2, "Remote_View" );
Remote_View->addColumn( tr("File"),130);
@@ -147,18 +149,18 @@ void AdvancedFm::init() {
Remote_View->setMultiSelection( TRUE );
Remote_View->setSelectionMode(QListView::Extended);
QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
tabLayout_2->addWidget( Remote_View, 0, 0 );
-
- TabWidget->insertTab( tab_2, tr( "2"));
+ TabWidget->addTab( tab_2, "advancedfm/smFileBrowser.png",tr( "2"));
+// TabWidget->insertTab( tab_2, tr( "2"));
/* tab_3 = new QWidget( TabWidget, "tab_3" );
tabLayout_3 = new QGridLayout( tab_3 );
tabLayout_3->setSpacing( 2);
tabLayout_3->setMargin( 2);
// OFileDialog fileDialog;
@@ -194,17 +196,17 @@ void AdvancedFm::init() {
currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
currentRemoteDir.setPath( QDir::currentDirPath());
b = TRUE;
filterStr="*";
b=FALSE;
-
+ TabWidget->setCurrentTab(0);
}
void AdvancedFm::initConnections() {
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) );
connect( cfButton ,SIGNAL(released()),this,SLOT( CFButtonPushed()) );
connect( sdButton ,SIGNAL(released()),this,SLOT( SDButtonPushed()) );
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 5fa8d0c..27a119f 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -9,16 +9,18 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "advancedfm.h"
#include "inputDialog.h"
#include "output.h"
#include "filePermissions.h"
+#include <opie/otabwidget.h>
+
#include <qpe/lnkproperties.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/applnk.h>
#include <qpe/ir.h>
@@ -48,33 +50,47 @@ void AdvancedFm::doLocalCd() {
localListClicked( Local_View->currentItem());
}
void AdvancedFm::doRemoteCd() {
localListClicked( Remote_View->currentItem());
}
void AdvancedFm::showMenuHidden() {
- if(TabWidget->currentPageIndex() == 0)
- showHidden();
- else
- showRemoteHidden();
+ if (b) {
+ currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
+ currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
+ fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
+// b=FALSE;
+
+ } else {
+ currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
+ currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
+ fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
+// b=TRUE;
+ }
+ populateLocalView();
+ populateRemoteView();
+// if(TabWidget->getCurrentTab() == 0)
+// showHidden();
+// else
+// showRemoteHidden();
// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true");
if(b) b = false; else b = true;
}
void AdvancedFm::showHidden() {
if (b) {
currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
- fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
+// fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
// b=FALSE;
} else {
currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
- fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
+// fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
// b=TRUE;
}
populateLocalView();
}
void AdvancedFm::showRemoteHidden() {
if (b) {
currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
@@ -84,17 +100,17 @@ void AdvancedFm::showRemoteHidden() {
currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
// b=FALSE;
}
populateRemoteView();
}
void AdvancedFm::runThis() {
QString fs;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString curFile = Local_View->currentItem()->text(0);
if(curFile != "../") {
fs= getFileSystemType((const QString &) currentDir.canonicalPath());
QFileInfo fileInfo( currentDir.canonicalPath()+"/"+curFile);
qDebug( fileInfo.owner());
if( (fileInfo.permission( QFileInfo::ExeUser)
| fileInfo.permission( QFileInfo::ExeGroup)
@@ -136,17 +152,17 @@ void AdvancedFm::runThis() {
nf.execute();
}
}
}
}
}
void AdvancedFm::runText() {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString curFile = Local_View->currentItem()->text(0);
if(curFile != "../") {
curFile = currentDir.canonicalPath()+"/"+curFile;
QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
e << curFile;
}
} else {
QString curFile = Remote_View->currentItem()->text(0);
@@ -318,44 +334,44 @@ void AdvancedFm::remoteRename()
}
void AdvancedFm::filePerms() {
QStringList curFileList = getPath();
QString filePath;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 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) {
+ if (TabWidget->getCurrentTab() == 0) {
populateLocalView();
} else {
populateRemoteView();
}
}
void AdvancedFm::doProperties() {
#if defined(QT_QWS_OPIE)
QStringList curFileList = getPath();
QString filePath;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
filePath = currentDir.canonicalPath()+"/";
} else {
filePath= currentRemoteDir.canonicalPath()+"/";
}
qDebug("%d",curFileList.count());
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
qDebug((filePath+*it));
@@ -364,17 +380,17 @@ void AdvancedFm::doProperties() {
prop.showMaximized();
prop.exec();
}
#endif
}
void AdvancedFm::upDir() {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString current = currentDir.canonicalPath();
QDir dir(current);
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateLocalView();
update();
@@ -390,17 +406,17 @@ void AdvancedFm::upDir() {
}
}
void AdvancedFm::copy() {
qApp->processEvents();
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
QString curFile, item, destFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 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);
@@ -422,17 +438,17 @@ void AdvancedFm::copy() {
};
}
if(!copyFile(destFile, curFile) ) {
QMessageBox::message("AdvancedFm","Could not copy\n"+curFile +"to\n"+destFile);
return;
}
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
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));
@@ -458,29 +474,29 @@ void AdvancedFm::copy() {
if(!copyFile(destFile, curFile) ) {
QMessageBox::message("AdvancedFm",tr("Could not copy\n")
+curFile +tr("to\n")+destFile);
return;
}
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
}
void AdvancedFm::copyAs() {
qApp->processEvents();
QStringList curFileList = getPath();
QString curFile;
InputDialog *fileDlg;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
qDebug("tab 1");
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString destFile;
curFile = currentDir.canonicalPath()+"/"+(*it);
fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0);
fileDlg->setInputText((const QString &) destFile );
fileDlg->exec();
@@ -507,17 +523,17 @@ void AdvancedFm::copyAs() {
+curFile +tr("to\n")+destFile);
return;
}
}
delete fileDlg;
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
fileDlg = new InputDialog( this,tr("Copy "+curFile+" As"), TRUE, 0);
QString destFile;
@@ -547,27 +563,27 @@ void AdvancedFm::copyAs() {
return;
}
}
delete fileDlg;
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
void AdvancedFm::copySameDir() {
qApp->processEvents();
QStringList curFileList = getPath();
QString curFile, item, destFile;
InputDialog *fileDlg;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item=(*it);
curFile = currentDir.canonicalPath()+"/"+ item;
fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0);
fileDlg->setInputText((const QString &) destFile );
fileDlg->exec();
@@ -644,17 +660,17 @@ void AdvancedFm::copySameDir() {
void AdvancedFm::move() {
qApp->processEvents();
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
QString curFile, destFile, item;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item=(*it);
QString destFile = currentRemoteDir.canonicalPath();
if(destFile.right(1).find("/",0,TRUE) == -1)
destFile+="/";
destFile += item;
@@ -673,17 +689,17 @@ void AdvancedFm::move() {
if(!copyFile( destFile, curFile) ) {
QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
return;
} else
QFile::remove(curFile);
}
}
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else { //view 2
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
item = (*it);
QString destFile = currentDir.canonicalPath();
if(destFile.right(1).find("/",0,TRUE) == -1)
@@ -703,17 +719,17 @@ void AdvancedFm::move() {
QFile f( curFile);
if( f.exists()) {
if(!copyFile( destFile, curFile) ) {
QMessageBox::message(tr("Note"),tr("Could not move\n") + curFile);
return;
} else
QFile::remove( curFile);
}
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
populateRemoteView();
populateLocalView();
}
}
bool AdvancedFm::copyFile( const QString & dest, const QString & src ) {
@@ -744,17 +760,17 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src ) {
chmod( (const char *) dest, status.st_mode );
}
return success;
}
void AdvancedFm::runCommand() {
QString curFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
if( Local_View->currentItem())
curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0);
} else {
if(Remote_View->currentItem())
curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0);
}
InputDialog *fileDlg;
@@ -790,17 +806,17 @@ void AdvancedFm::runCommand() {
}
pclose(fp);
}
}
void AdvancedFm::runCommandStd() {
QString curFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
if( Local_View->currentItem())
curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0);
} else {
if(Remote_View->currentItem())
curFile = currentRemoteDir.canonicalPath() +"/"
+ Remote_View->currentItem()->text(0);
}
@@ -813,17 +829,17 @@ void AdvancedFm::runCommandStd() {
qApp->processEvents();
command = fileDlg->LineEdit1->text() + " &";
system(command.latin1());
}
}
void AdvancedFm::fileStatus() {
QString curFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
curFile = Local_View->currentItem()->text(0);
} else {
curFile = Remote_View->currentItem()->text(0);
}
QString command = " stat -l "+ curFile +" 2>&1";
Output *outDlg;
outDlg = new Output(this, tr("AdvancedFm Output"),FALSE);
outDlg->showMaximized();
@@ -845,83 +861,83 @@ void AdvancedFm::fileStatus() {
}
}
pclose(fp);
}
void AdvancedFm::mkDir() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localMakDir();
else
remoteMakDir();
}
void AdvancedFm::rn() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localRename();
else
remoteRename();
}
void AdvancedFm::del() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localDelete();
else
remoteDelete();
}
void AdvancedFm::mkSym() {
QString cmd;
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString destName = currentRemoteDir.canonicalPath()+"/"+(*it);
if(destName.right(1) == "/") destName = destName.left( destName.length() -1);
QString curFile = currentDir.canonicalPath()+"/"+(*it);
if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
cmd = "ln -s "+curFile+" "+destName;
qDebug(cmd);
system(cmd.latin1() );
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString destName = currentDir.canonicalPath()+"/"+(*it);
if(destName.right(1) == "/") destName = destName.left( destName.length() -1);
QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
cmd = "ln -s "+curFile+" "+destName;
qDebug(cmd);
system(cmd.latin1() );
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
}
void AdvancedFm::doBeam() {
Ir ir;
if(!ir.supported()){
} else {
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
QString curFile = currentDir.canonicalPath()+"/"+(*it);
if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
Ir *file = new Ir(this, "IR");
connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
file->send( curFile, curFile );
}