summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-09-26 01:49:06 (UTC)
committer llornkcor <llornkcor>2004-09-26 01:49:06 (UTC)
commit358c159e5d4f28eedfbd8e539e4420324c565eba (patch) (side-by-side diff)
tree59a1280ed80b8b2ebdcf38b90ead208bfd18b628
parentff6c55833c0cba33469f668ca158e96b409b4967 (diff)
downloadopie-358c159e5d4f28eedfbd8e539e4420324c565eba.zip
opie-358c159e5d4f28eedfbd8e539e4420324c565eba.tar.gz
opie-358c159e5d4f28eedfbd8e539e4420324c565eba.tar.bz2
fix view menu
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 0dc822d..9aa0c77 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -27,111 +27,111 @@
#include <qpopupmenu.h>
#include <qlistview.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <sys/stat.h>
#include <time.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/vfs.h>
#include <mntent.h>
using namespace Opie::Ui;
AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
: QMainWindow( ) {
init();
renameBox = 0;
whichTab = 1;
unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() );
initConnections();
rePopulate();
channel = new QCopChannel( "QPE/Application/advancedfm", this );
connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&)));
switchToLocalTab();
}
AdvancedFm::~AdvancedFm() {
}
void AdvancedFm::cleanUp() {
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
sfile+="/._temp";
else
sfile+="._temp";
QFile file( sfile);
if(file.exists())
file.remove();
}
void AdvancedFm::tabChanged(QWidget *wd) {
// qDebug("tabChanged");
if(wd == tab) {
whichTab = 1;
+ viewMenu->setItemChecked(viewMenu->idAt(0), true);
+ viewMenu->setItemChecked(viewMenu->idAt(1), false);
// qDebug("tabchanged: LOCAL VIEW SHOWN");
}
else if(wd == tab_2) {
whichTab = 2;
+ viewMenu->setItemChecked(viewMenu->idAt(0), false);
+ viewMenu->setItemChecked(viewMenu->idAt(1), true);
// qDebug("tabchanged: REMOTE VIEW SHOWN");
}
qApp->processEvents();
QString path = CurrentDir()->canonicalPath();
// qDebug(path);
if ( TabWidget->currentWidget() == tab) {
- viewMenu->setItemChecked(viewMenu->idAt(0), true);
- viewMenu->setItemChecked(viewMenu->idAt(1), false);
} else {
- viewMenu->setItemChecked(viewMenu->idAt(0), false);
- viewMenu->setItemChecked(viewMenu->idAt(1), true);
}
chdir( path.latin1());
currentPathCombo->lineEdit()->setText(path);
}
void AdvancedFm::populateView() {
QPixmap pm;
QListView *thisView = CurrentView();
QDir *thisDir = CurrentDir();
QString path = thisDir->canonicalPath();
thisView->clear();
thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
thisDir->setMatchAllDirs(TRUE);
thisDir->setNameFilter(filterStr);
QString fileL, fileS, fileDate;
QString fs = getFileSystemType((const QString &) path);
setCaption(tr("AdvancedFm :: ")+fs+" :: "
+checkDiskSpace((const QString &) path)+ tr(" kB free") );
bool isDir = FALSE;
const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ) {
QString symLink = fi->readLink();
QFileInfo sym( symLink);
fileS.sprintf( "%10i", sym.size() );
fileL = fi->fileName() +" -> " + sym.filePath().data();
fileDate = sym.lastModified().toString();
} else {
fileS.sprintf( "%10i", fi->size() );
fileL = fi->fileName();
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) {
// if(fileL == "..")
fileL += "/";
isDir=TRUE;
}
}
QFileInfo fileInfo( path + "/" + fileL);
if(fileL !="./" && fi->exists()) {
@@ -320,97 +320,97 @@ QStringList AdvancedFm::getPath() {
}
return strList;
}
void AdvancedFm::changeTo(const QString &dir) {
chdir( dir.latin1());
CurrentDir()->cd(dir, TRUE);
populateView();
update();
}
void AdvancedFm::homeButtonPushed() {
changeTo(QDir::homeDirPath());
}
void AdvancedFm::docButtonPushed() {
changeTo(QPEApplication::documentDir());
}
void AdvancedFm::SDButtonPushed() {
Opie::Core::OStorageInfo info;
changeTo(info.sdPath());
}
void AdvancedFm::CFButtonPushed() {
Opie::Core::OStorageInfo info;
changeTo(info.cfPath());
}
void AdvancedFm::QPEButtonPushed() {
changeTo(QPEApplication::qpeDir());
}
void AdvancedFm::doAbout() {
QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>"));
}
void AdvancedFm::keyPressEvent( QKeyEvent *e) {
Q_UNUSED(e);
}
void AdvancedFm::keyReleaseEvent( QKeyEvent *e) {
// if( CurrentView()->hasFocus() )
// e->ignore();
if( currentPathCombo->lineEdit()->hasFocus()) {
// qDebug("shout!");
}
- else if( e->key() == Key_Left )
+ else if( e->key() == Key_Left )
upDir();
else if( e->key() == Key_Return || e->key() == Key_Enter)
navigateToSelected();
else if( e->key() == Key_Tab)
setOtherTabCurrent();
else if( e->key() == Key_Delete )
del();
else if( e->key() == Key_A)
copyAs();
else if( e->key() == Key_C)
copy();
else if( e->key() == Key_E)
runThis();
else if( e->key() == Key_G)
currentPathCombo->lineEdit()->setFocus();
else if( e->key() == Key_H )
showHidden();
else if( e->key() == Key_I)
fileStatus();
else if( e->key() == Key_M)
move();
else if( e->key() == Key_N )
mkDir();
else if( e->key() == Key_P)
filePerms();
else if( e->key() == Key_R )
rn();
else if( e->key() == Key_U )
upDir();
else if( e->key() == Key_1)
switchToLocalTab();
else if( e->key() == Key_2)
switchToRemoteTab();
else if( e->key() == Key_3)
CFButtonPushed();
else if( e->key() == Key_4)
SDButtonPushed();
else if( e->key() == Key_5 )
homeButtonPushed();
else if( e->key() == Key_6 )
docButtonPushed();
else
e->accept();
}
void AdvancedFm::parsetab(const QString &fileName) {