summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfmMenu.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp73
1 files changed, 36 insertions, 37 deletions
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
@@ -271,8 +271,11 @@ void AdvancedFm::upDir() {
update();
}
+void AdvancedFm::copyTimer() {
+ QTimer::singleShot(125,this,SLOT(copy()));
+}
+
void AdvancedFm::copy() {
- qApp->processEvents();
QStringList curFileList = getPath();
QDir *thisDir = CurrentDir();
@@ -312,7 +315,7 @@ void AdvancedFm::copy() {
if( f.exists()) {
if(doMsg) {
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) ) {
case 1:
return;
@@ -324,15 +327,18 @@ void AdvancedFm::copy() {
if( !copyFile( curFile, destFile) ) {
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;
}
}
- setOtherTabCurrent();
rePopulate();
}
}
+void AdvancedFm::copyAsTimer() {
+ QTimer::singleShot(125,this,SLOT(copyAs()));
+}
+
void AdvancedFm::copyAs() {
QStringList curFileList = getPath();
@@ -346,7 +352,7 @@ void AdvancedFm::copyAs() {
QString destFile;
item=(*it);
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);
fileDlg->setInputText((const QString &) destFile );
fileDlg->exec();
@@ -358,7 +364,7 @@ void AdvancedFm::copyAs() {
QFile f( destFile);
if( f.exists()) {
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) ) {
case 0:
f.remove();
@@ -369,8 +375,7 @@ 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;
}
}
@@ -378,11 +383,15 @@ void AdvancedFm::copyAs() {
}
rePopulate();
- setOtherTabCurrent();
+// setOtherTabCurrent();
qApp->processEvents();
}
+void AdvancedFm::copySameDirTimer() {
+ QTimer::singleShot(125,this,SLOT(copySameDir()));
+}
+
void AdvancedFm::copySameDir() {
qApp->processEvents();
QStringList curFileList = getPath();
@@ -407,7 +416,7 @@ void AdvancedFm::copySameDir() {
QFile f(destFile);
if( f.exists()) {
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) ) {
case 0:
@@ -419,8 +428,7 @@ 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;
}
@@ -431,8 +439,11 @@ void AdvancedFm::copySameDir() {
rePopulate();
}
+void AdvancedFm::moveTimer() {
+ QTimer::singleShot(125,this,SLOT(move()));
+}
+
void AdvancedFm::move() {
- qApp->processEvents();
QStringList curFileList = getPath();
if( curFileList.count() > 0) {
@@ -460,7 +471,6 @@ void AdvancedFm::move() {
rePopulate();
return;
}
-
QFile f( curFile);
if( f.exists()) {
if( !copyFile( curFile, destFile) ) {
@@ -473,7 +483,7 @@ void AdvancedFm::move() {
}
rePopulate();
- setOtherTabCurrent();
+// setOtherTabCurrent();
}
bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
@@ -506,12 +516,10 @@ 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;
}
else
@@ -708,11 +716,9 @@ void AdvancedFm::startProcess(const QString & cmd) {
QStringList command;
OProcess *process;
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)));
command << "/bin/sh";
command << "-c";
@@ -754,13 +760,13 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
}
if ( o->inherits( "QListView" ) ) {
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");
+// }
}
OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection
}
@@ -789,24 +795,17 @@ void AdvancedFm::doRename(QListView * view) {
QRect r = view->itemRect( view->currentItem( ));
r = QRect( view->viewportToContents( r.topLeft() ), r.size() );
r.setX( view->contentsX() );
-
if ( r.width() > view->visibleWidth() )
r.setWidth( view->visibleWidth() );
renameBox = new QLineEdit( view->viewport(), "qt_renamebox" );
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();
renameBox->show();
}