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
@@ -13,4 +13,5 @@
#include "advancedfm.h"
+ #include <opie/otabwidget.h>
// #include <opie/ofileselector.h>
// #include <opie/ofiledialog.h>
@@ -88,5 +89,6 @@ void AdvancedFm::cleanUp() {
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);
@@ -97,5 +99,7 @@ void AdvancedFm::tabChanged(QWidget *) {
}
- if (TabWidget->currentPageIndex() == 1) {
+ if (TabWidget->getCurrentTab() == 1) {
+
+// if (TabWidget->currentPageIndex() == 1) {
currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath());
viewMenu->setItemChecked(viewMenu->idAt(1),TRUE);
@@ -415,10 +419,10 @@ void AdvancedFm::remoteListPressed( int mouse, QListViewItem*, const QPoint&, in
void AdvancedFm::switchToLocalTab() {
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
Local_View->setFocus();
}
void AdvancedFm::switchToRemoteTab() {
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
Remote_View->setFocus();
}
@@ -433,5 +437,6 @@ void AdvancedFm::writeConfig() {
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() );
@@ -441,5 +446,6 @@ void AdvancedFm::currentPathComboChanged() {
}
}
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
currentRemoteDir.setPath( currentPathCombo->lineEdit()->text() );
@@ -453,5 +459,6 @@ void AdvancedFm::currentPathComboChanged() {
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() ) {
@@ -471,5 +478,6 @@ void AdvancedFm::fillCombo(const QString &currentPath) {
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);
@@ -486,5 +494,6 @@ void AdvancedFm::currentPathComboActivated(const QString & currentPath) {
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 );
@@ -513,5 +522,6 @@ 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();
@@ -526,5 +536,7 @@ 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();
@@ -539,5 +551,6 @@ 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();
@@ -558,5 +571,6 @@ void AdvancedFm::CFButtonPushed() {
chdir( current.latin1() );
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
+// if (TabWidget->currentPageIndex() == 0) {
currentDir.cd( current, TRUE);
populateLocalView();
@@ -646,5 +660,6 @@ 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();
@@ -718,5 +733,6 @@ 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);
@@ -731,6 +747,9 @@ void AdvancedFm::showFileMenu() {
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();
@@ -830,5 +849,6 @@ void AdvancedFm::addToDocs() {
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);
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
@@ -15,4 +15,5 @@
#define QT_QWS_OPIE
+//#include <opie/otabwidget.h>
#include <qpe/ir.h>
@@ -26,4 +27,5 @@
#include <qtimer.h>
+class OTabWidget;
class QVBoxLayout;
class QHBoxLayout;
@@ -54,5 +56,6 @@ public:
~AdvancedFm();
- QTabWidget *TabWidget;
+ OTabWidget *TabWidget;
+// QTabWidget *TabWidget;
QWidget *tab, *tab_2, *tab_3;
QListView *Local_View, *Remote_View;
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
@@ -8,5 +8,5 @@ INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
DESTDIR = $(OPIEDIR)/bin
-LIBS += -lqpe
+LIBS += -lqpe -lopie
TRANSLATIONS = ../../../i18n/de/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
@@ -12,4 +12,5 @@
#include "advancedfm.h"
+#include <opie/otabwidget.h>
#include <qpe/qpeapplication.h>
#include <qpe/qpemenubar.h>
@@ -23,5 +24,4 @@
#include <qtabwidget.h>
#include <qtoolbutton.h>
-#include <qtabwidget.h>
#include <qlineedit.h>
#include <qlistview.h>
@@ -109,5 +109,6 @@ void AdvancedFm::init() {
- 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);
@@ -131,5 +132,6 @@ void AdvancedFm::init() {
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" );
@@ -153,6 +155,6 @@ void AdvancedFm::init() {
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" );
@@ -200,5 +202,5 @@ void AdvancedFm::init() {
filterStr="*";
b=FALSE;
-
+ TabWidget->setCurrentTab(0);
}
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
@@ -15,4 +15,6 @@
#include "filePermissions.h"
+#include <opie/otabwidget.h>
+
#include <qpe/lnkproperties.h>
#include <qpe/qpeapplication.h>
@@ -54,8 +56,22 @@ void AdvancedFm::doRemoteCd() {
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;
@@ -65,10 +81,10 @@ 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;
}
@@ -90,5 +106,5 @@ void AdvancedFm::showRemoteHidden() {
void AdvancedFm::runThis() {
QString fs;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString curFile = Local_View->currentItem()->text(0);
if(curFile != "../") {
@@ -142,5 +158,5 @@ void AdvancedFm::runThis() {
void AdvancedFm::runText() {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString curFile = Local_View->currentItem()->text(0);
if(curFile != "../") {
@@ -324,5 +340,5 @@ void AdvancedFm::filePerms() {
QString filePath;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
filePath = currentDir.canonicalPath()+"/";
} else {
@@ -338,5 +354,5 @@ void AdvancedFm::filePerms() {
delete filePerm;
}
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
populateLocalView();
} else {
@@ -351,5 +367,5 @@ void AdvancedFm::doProperties() {
QString filePath;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
filePath = currentDir.canonicalPath()+"/";
} else {
@@ -370,5 +386,5 @@ void AdvancedFm::doProperties() {
void AdvancedFm::upDir() {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
QString current = currentDir.canonicalPath();
QDir dir(current);
@@ -396,5 +412,5 @@ void AdvancedFm::copy() {
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);
@@ -428,5 +444,5 @@ void AdvancedFm::copy() {
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
@@ -464,5 +480,5 @@ void AdvancedFm::copy() {
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
@@ -476,5 +492,5 @@ void AdvancedFm::copyAs() {
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 ) {
@@ -513,5 +529,5 @@ void AdvancedFm::copyAs() {
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
@@ -553,5 +569,5 @@ void AdvancedFm::copyAs() {
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
@@ -563,5 +579,5 @@ void AdvancedFm::copySameDir() {
InputDialog *fileDlg;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -650,5 +666,5 @@ void AdvancedFm::move() {
QString curFile, destFile, item;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -679,5 +695,5 @@ void AdvancedFm::move() {
}
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else { //view 2
@@ -709,5 +725,5 @@ void AdvancedFm::move() {
QFile::remove( curFile);
}
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
@@ -750,5 +766,5 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src ) {
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);
@@ -796,5 +812,5 @@ void AdvancedFm::runCommand() {
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);
@@ -819,5 +835,5 @@ void AdvancedFm::runCommandStd() {
void AdvancedFm::fileStatus() {
QString curFile;
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
curFile = Local_View->currentItem()->text(0);
} else {
@@ -851,5 +867,5 @@ void AdvancedFm::fileStatus() {
void AdvancedFm::mkDir() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localMakDir();
else
@@ -859,5 +875,5 @@ void AdvancedFm::mkDir() {
void AdvancedFm::rn() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localRename();
else
@@ -867,5 +883,5 @@ void AdvancedFm::rn() {
void AdvancedFm::del() {
- if (TabWidget->currentPageIndex() == 0)
+ if (TabWidget->getCurrentTab() == 0)
localDelete();
else
@@ -878,5 +894,5 @@ void AdvancedFm::mkSym() {
if( curFileList.count() > 0) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -890,5 +906,5 @@ void AdvancedFm::mkSym() {
}
populateRemoteView();
- TabWidget->setCurrentPage(1);
+ TabWidget->setCurrentTab(1);
} else {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -904,5 +920,5 @@ void AdvancedFm::mkSym() {
}
populateLocalView();
- TabWidget->setCurrentPage(0);
+ TabWidget->setCurrentTab(0);
}
}
@@ -917,5 +933,5 @@ void AdvancedFm::doBeam() {
if( curFileList.count() > 0) {
- if (TabWidget->currentPageIndex() == 0) {
+ if (TabWidget->getCurrentTab() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {