author | llornkcor <llornkcor> | 2004-09-25 01:51:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-25 01:51:26 (UTC) |
commit | 40e681bf20db4f1e02212ae6e42a349ee000cf14 (patch) (side-by-side diff) | |
tree | 86eea5377011775ff87ca50e1fd125ff8f30622f | |
parent | 0fe000754035c737ff0de97e5b2bd2cf03c16337 (diff) | |
download | opie-40e681bf20db4f1e02212ae6e42a349ee000cf14.zip opie-40e681bf20db4f1e02212ae6e42a349ee000cf14.tar.gz opie-40e681bf20db4f1e02212ae6e42a349ee000cf14.tar.bz2 |
fix stuff
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 79 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 77 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 60 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 73 |
5 files changed, 138 insertions, 153 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 4de7d38..02898de 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -52,4 +52,3 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) channel = new QCopChannel( "QPE/Application/advancedfm", this ); - connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), - this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); + connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); @@ -78,12 +77,15 @@ void AdvancedFm::cleanUp() { void AdvancedFm::tabChanged(QWidget *wd) { - if(wd == tab) - odebug << "LOCAL VIEW SHOWN"<< oendl; - else if(wd == tab_2) - odebug<< "REMOTE VIEW SHOWN"<< oendl; - +// qDebug("tabChanged"); + if(wd == tab) { + whichTab = 1; +// qDebug("tabchanged: LOCAL VIEW SHOWN"); + } + else if(wd == tab_2) { + whichTab = 2; +// qDebug("tabchanged: REMOTE VIEW SHOWN"); + } + qApp->processEvents(); QString path = CurrentDir()->canonicalPath(); - currentPathCombo->lineEdit()->setText( path ); - +// qDebug(path); if ( TabWidget->currentWidget() == tab) { -// if(whichTab == 1) { viewMenu->setItemChecked(viewMenu->idAt(0), true); @@ -100,8 +102,3 @@ void AdvancedFm::tabChanged(QWidget *wd) { chdir( path.latin1()); - if( wd == Local_View) { - Remote_View->clearFocus(); - } else { - Local_View->clearFocus(); - } - + currentPathCombo->lineEdit()->setText(path); } @@ -220,2 +217,3 @@ void AdvancedFm::populateView() { void AdvancedFm::rePopulate() { +// qDebug("repopulate views"); populateView(); @@ -235,6 +233,6 @@ void AdvancedFm::rePopulate() { void AdvancedFm::ListClicked(QListViewItem *selectedItem) { - if ( TabWidget->currentWidget() == tab) - qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); - else - qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); +// if ( TabWidget->currentWidget() == tab) +// qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); +// else +// qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); @@ -294,4 +292,6 @@ void AdvancedFm::refreshCurrentTab() { void AdvancedFm::switchToLocalTab() { + qDebug("switchToLocal "); TabWidget->setCurrentWidget(0); Local_View->setFocus(); + whichTab = 1; @@ -300,4 +300,6 @@ void AdvancedFm::switchToLocalTab() { void AdvancedFm::switchToRemoteTab() { + qDebug("switchToRemoteTab() "); TabWidget->setCurrentWidget(1); Remote_View->setFocus(); + whichTab = 2; } @@ -400,6 +402,3 @@ void AdvancedFm::CFButtonPushed() { void AdvancedFm::doAbout() { - QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" - "is copyright 2002-2003 by\n" - "L.J.Potter<llornkcor@handhelds.org>\n" - "and is licensed by the GPL")); + 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>")); } @@ -584,4 +583,3 @@ void AdvancedFm::showFileMenu() { if ( app ) - m->insertItem( app->pixmap(), tr( "Open in " - + app->name() ), this, SLOT( runThis() ) ); + m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis())); else if( QFileInfo(fi).isExecutable() ) //damn opie doesnt like this @@ -599,6 +597,6 @@ void AdvancedFm::showFileMenu() { - n->insertItem( tr( "Copy" ), this, SLOT( copy() )); - n->insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); - n->insertItem( tr( "Copy Same Dir" ), this, SLOT( copySameDir() )); - n->insertItem( tr( "Move" ), this, SLOT( move() )); + n->insertItem(tr("Copy"),this,SLOT(copyTimer())); + n->insertItem(tr("Copy As"),this,SLOT(copyAsTimer())); + n->insertItem(tr("Copy Same Dir"),this,SLOT(copySameDirTimer())); + n->insertItem(tr("Move"),this,SLOT(moveTimer())); @@ -790,11 +788,7 @@ void AdvancedFm::gotoCustomDir(const QString &dir) { QDir *AdvancedFm::CurrentDir() { - - if ( TabWidget->currentWidget() == tab) - qDebug("CurrentTab is Local"); - else - qDebug("CurrentTab is Remote"); - if ( whichTab == 1) { +// qDebug("CurrentTab is Local"); return ¤tDir; } else { +// qDebug("CurrentTab is Remote"); return ¤tRemoteDir; @@ -813,7 +807,5 @@ QDir *AdvancedFm::OtherDir() { QListView * AdvancedFm::CurrentView() { - if ( TabWidget->currentWidget() == tab) - odebug << "CurrentView local" << oendl; - // if ( TabWidget->currentWidget() == tab) { if ( whichTab == 1) { +// qDebug("CurrentView: local"); return Local_View; @@ -821,2 +813,3 @@ QListView * AdvancedFm::CurrentView() { // owarn << "CurrentView Tab 2" << oendl; +// qDebug("CurrentView: remote"); return Remote_View; @@ -833,3 +826,3 @@ QListView * AdvancedFm::OtherView() { void AdvancedFm::setOtherTabCurrent() { - qDebug("setOtherTabCurrent() %d",whichTab); +// qDebug("setOtherTabCurrent() %d",whichTab); if ( whichTab == 1) { @@ -860,3 +853,3 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::gotoDirectory(const QString &file) { - qDebug("goto dir "+file); +// qDebug("goto dir "+file); QString curDir = file; @@ -895,4 +888,4 @@ void AdvancedFm::findFile(const QString &fileName) { -void AdvancedFm::slotSwitchMenu(int ) { -// odebug << "Switch " << item << "" << oendl; +void AdvancedFm::slotSwitchMenu(int item) { +// qDebug( "Switch %d",item); // viewMenu->setItemChecked(item, true); diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index def6fe2..2234b3c 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -59,34 +59,2 @@ public: ~AdvancedFm(); -protected slots: - void slotSwitchMenu(int); - void selectAll(); - void addToDocs(); - void doDirChange(); - void mkDir(); - void del(); - void rn(); - void populateView(); - void rePopulate(); - void showHidden(); - void showMenuHidden(); - void writeConfig(); - void readConfig(); - void ListClicked(QListViewItem *); - void ListPressed( int, QListViewItem *, const QPoint&, int); - void makeDir(); - void doDelete(); - void tabChanged(QWidget*); - void cleanUp(); - void renameIt(); - void runThis(); - void runText(); - void filePerms(); - void doProperties(); - void runCommand(); - void runCommandStd(); - QStringList getPath(); - void mkSym(); - void switchToLocalTab(); - void switchToRemoteTab(); - void refreshCurrentTab(); protected: @@ -132,3 +100,37 @@ protected: +//protected signals: +// void newPath(QString); + protected slots: + void slotSwitchMenu(int); + void selectAll(); + void addToDocs(); + void doDirChange(); + void mkDir(); + void del(); + void rn(); + void populateView(); + void rePopulate(); + void showHidden(); + void showMenuHidden(); + void writeConfig(); + void readConfig(); + void ListClicked(QListViewItem *); + void ListPressed( int, QListViewItem *, const QPoint&, int); + void makeDir(); + void doDelete(); + void tabChanged(QWidget*); + void cleanUp(); + void renameIt(); + void runThis(); + void runText(); + void filePerms(); + void doProperties(); + void runCommand(); + void runCommandStd(); + QStringList getPath(); + void mkSym(); + void switchToLocalTab(); + void switchToRemoteTab(); + void refreshCurrentTab(); @@ -144,5 +146,12 @@ protected slots: void currentPathComboChanged(); + void copy(); + void copyTimer(); void copyAs(); + void copyAsTimer(); void copySameDir(); + void copySameDirTimer(); + void move(); + void moveTimer(); + void currentPathComboActivated(const QString &); @@ -150,3 +159,2 @@ protected slots: bool copyFile( const QString & , const QString & ); - void move(); void fileStatus(); @@ -163,3 +171,3 @@ private: MenuButton *menuButton; - QString oldName; + QString oldName, localViewDir, remoteViewDir; void startProcess(const QString &); @@ -182,2 +190,3 @@ private slots: void setDocument(const QString &); +// void doMenu(int diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index 0644edb..713f61c 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro @@ -1,3 +1,3 @@ TEMPLATE = app -CONFIG += qt warn_on quick-app +CONFIG += qte warn_on quick-app HEADERS = advancedfm.h filePermissions.h output.h diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 1802571..d2e1d8e 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -250,40 +250,24 @@ void AdvancedFm::initConnections() - connect( qApp,SIGNAL( aboutToQuit()), - this, SLOT( cleanUp()) ); - connect( qpeDirButton ,SIGNAL(released()), - this,SLOT( QPEButtonPushed()) ); - connect( cfButton ,SIGNAL(released()), - this,SLOT( CFButtonPushed()) ); - connect( sdButton ,SIGNAL(released()), - this,SLOT( SDButtonPushed()) ); - connect( cdUpButton ,SIGNAL(released()), - this,SLOT( upDir()) ); - connect( docButton,SIGNAL(released()), - this,SLOT( docButtonPushed()) ); - connect( homeButton,SIGNAL(released()), - this,SLOT( homeButtonPushed()) ); - connect( currentPathCombo, SIGNAL( activated(const QString&) ), - this, SLOT( currentPathComboActivated(const QString&) ) ); - - connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), - this,SLOT(currentPathComboChanged())); - - connect( Local_View, SIGNAL( clicked(QListViewItem*)), - this,SLOT( ListClicked(QListViewItem*)) ); - - connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), - this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); - - connect( Remote_View, SIGNAL( clicked(QListViewItem*)), - this,SLOT( ListClicked(QListViewItem*)) ); - connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), - this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); - - connect( TabWidget,SIGNAL(currentChanged(QWidget*)), - this,SLOT(tabChanged(QWidget*))); - - connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), - this, SLOT(showFileMenu())); - connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), - this, SLOT(showFileMenu())); + connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); + connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); + connect( cfButton ,SIGNAL(released()), this,SLOT( CFButtonPushed()) ); + connect( sdButton ,SIGNAL(released()), this,SLOT( SDButtonPushed()) ); + connect( cdUpButton ,SIGNAL(released()), this,SLOT( upDir()) ); + connect( docButton,SIGNAL(released()), this,SLOT( docButtonPushed()) ); + connect( homeButton,SIGNAL(released()), this,SLOT( homeButtonPushed()) ); + connect( currentPathCombo, SIGNAL( activated(const QString&) ), this, SLOT( currentPathComboActivated(const QString&) ) ); + + connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); + + connect( Local_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); + + connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); + + connect( Remote_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); + connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); + + connect( TabWidget,SIGNAL(currentChanged(QWidget*)), this,SLOT(tabChanged(QWidget*))); + + connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), this, SLOT(showFileMenu())); + connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), this, SLOT(showFileMenu())); diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 8d04c68..5a46579 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -273,4 +273,7 @@ void AdvancedFm::upDir() { +void AdvancedFm::copyTimer() { + QTimer::singleShot(125,this,SLOT(copy())); +} + void AdvancedFm::copy() { - qApp->processEvents(); QStringList curFileList = getPath(); @@ -314,3 +317,3 @@ void AdvancedFm::copy() { switch ( QMessageBox::warning(this,tr("File Exists!"), - tr("%1 exists. Ok to overwrite?").arg( item ), + tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), tr("Yes"),tr("No"),0,0,1) ) { @@ -326,3 +329,3 @@ void AdvancedFm::copy() { QMessageBox::message("AdvancedFm", - tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); + tr( "<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); return; @@ -330,3 +333,2 @@ void AdvancedFm::copy() { } - setOtherTabCurrent(); rePopulate(); @@ -335,2 +337,6 @@ void AdvancedFm::copy() { +void AdvancedFm::copyAsTimer() { + QTimer::singleShot(125,this,SLOT(copyAs())); +} + void AdvancedFm::copyAs() { @@ -348,3 +354,3 @@ void AdvancedFm::copyAs() { curFile = thisDir->canonicalPath()+"/"+(*it); - fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); + fileDlg = new InputDialog( this, tr("Copy %1 As").arg(curFile), TRUE, 0); @@ -360,3 +366,3 @@ void AdvancedFm::copyAs() { switch (QMessageBox::warning(this,tr("File Exists!"), - item+tr("\nexists. Ok to overwrite?"), + tr("<P> %1 already exists. Ok to overwrite?</p>").arg(item), tr("Yes"),tr("No"),0,0,1) ) { @@ -371,4 +377,3 @@ void AdvancedFm::copyAs() { if( !copyFile( curFile, destFile) ) { - QMessageBox::message("AdvancedFm",tr("Could not copy\n") - +curFile +tr("to\n")+destFile); + QMessageBox::message("AdvancedFm",tr("<p>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); return; @@ -380,3 +385,3 @@ void AdvancedFm::copyAs() { rePopulate(); - setOtherTabCurrent(); +// setOtherTabCurrent(); qApp->processEvents(); @@ -385,2 +390,6 @@ void AdvancedFm::copyAs() { +void AdvancedFm::copySameDirTimer() { + QTimer::singleShot(125,this,SLOT(copySameDir())); +} + void AdvancedFm::copySameDir() { @@ -409,3 +418,3 @@ void AdvancedFm::copySameDir() { switch (QMessageBox::warning(this,tr("Delete"), - destFile+tr(" already exists.\nDo you really want to delete it?"), + tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), tr("Yes"),tr("No"),0,0,1) ) { @@ -421,4 +430,3 @@ void AdvancedFm::copySameDir() { if(!copyFile( curFile,destFile) ) { - QMessageBox::message("AdvancedFm",tr("Could not copy\n") - +curFile +tr("to\n")+destFile); + QMessageBox::message("AdvancedFm",tr("<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); return; @@ -433,4 +441,7 @@ void AdvancedFm::copySameDir() { +void AdvancedFm::moveTimer() { + QTimer::singleShot(125,this,SLOT(move())); +} + void AdvancedFm::move() { - qApp->processEvents(); @@ -462,3 +473,2 @@ void AdvancedFm::move() { } - QFile f( curFile); @@ -475,3 +485,3 @@ void AdvancedFm::move() { rePopulate(); - setOtherTabCurrent(); +// setOtherTabCurrent(); } @@ -508,8 +518,6 @@ bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { - - if(QFileInfo(src).isDir()) { if( copyDirectory( src, dest )) { - setOtherTabCurrent(); - populateView(); +// setOtherTabCurrent(); + rePopulate(); return true; @@ -710,7 +718,5 @@ void AdvancedFm::startProcess(const QString & cmd) { process = new OProcess(); - connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), - this, SLOT( processEnded(Opie::Core::OProcess*))); + connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), this, SLOT( processEnded(Opie::Core::OProcess*))); - connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), - this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); + connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); @@ -756,9 +762,9 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { if ( e->type() == QEvent::FocusIn ) { - if( o == Local_View) { //keep track of which view - qDebug("local view"); - whichTab = 1; - } else { - whichTab = 2; - qDebug("remote view"); - } +// if( o == Local_View) { //keep track of which view +// qDebug("local view"); +// whichTab = 1; +// } else { +// whichTab = 2; +// qDebug("remote view"); +// } } @@ -791,3 +797,2 @@ void AdvancedFm::doRename(QListView * view) { r.setX( view->contentsX() ); - if ( r.width() > view->visibleWidth() ) @@ -797,14 +802,8 @@ void AdvancedFm::doRename(QListView * view) { renameBox->setFrame(true); - renameBox->setText( view->currentItem()->text(0) ); - renameBox->selectAll(); renameBox->installEventFilter( this ); - view->addChild( renameBox, r.x(), r.y() ); - renameBox->resize( r.size() ); - view->viewport()->setFocusProxy( renameBox ); - renameBox->setFocus(); |