summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfmMenu.cpp
authorllornkcor <llornkcor>2002-11-15 14:20:40 (UTC)
committer llornkcor <llornkcor>2002-11-15 14:20:40 (UTC)
commitb35750b8fe75e055e014e0dd294c714976f5715f (patch) (side-by-side diff)
tree3a57c481f4b416e6bfe7ce6794077a2225165839 /noncore/apps/advancedfm/advancedfmMenu.cpp
parentab8d331905b59a86b50cd513123cdde67e4bfb8a (diff)
downloadopie-b35750b8fe75e055e014e0dd294c714976f5715f.zip
opie-b35750b8fe75e055e014e0dd294c714976f5715f.tar.gz
opie-b35750b8fe75e055e014e0dd294c714976f5715f.tar.bz2
added select all, and changed delete of multi files to ask only once. Changed some messagebox strings
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp130
1 files changed, 92 insertions, 38 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 27a119f..bef701a 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -201,3 +201,19 @@ void AdvancedFm::localDelete() {
QStringList curFileList = getPath();
- if(curFileList.count() > 0) {
+ bool doMsg=true;
+ int count=curFileList.count();
+ if( count > 0) {
+ if(count > 1 ){
+ QString msg;
+ msg=tr("Really delete\n%1 files?").arg(count);
+ switch ( QMessageBox::warning(this,tr("Delete"),msg
+ ,tr("Yes"),tr("No"),0,0,1) ) {
+ case 0:
+ doMsg=false;
+ break;
+ case 1:
+ return;
+ break;
+ };
+ }
+
QString myFile;
@@ -213,3 +229,3 @@ void AdvancedFm::localDelete() {
if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
- switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+
+ switch ( QMessageBox::warning(this,tr("Delete Directory?"),tr("Really delete\n")+f+
"\nand all it's contents ?"
@@ -229,14 +245,36 @@ void AdvancedFm::localDelete() {
} else {
- switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f
+ if(doMsg) {
+ switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f
+" ?",tr("Yes"),tr("No"),0,0,1) ) {
- case 0: {
+ case 1:
+ return;
+ break;
+ };
+ }
QString cmd="rm "+f;
QFile file(f);
+ if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1)
file.remove();
// system( cmd.latin1());
+ }
+ }
+ }
populateLocalView();
}
+
+void AdvancedFm::remoteDelete() {
+ QStringList curFileList = getPath();
+ bool doMsg=true;
+ int count=curFileList.count();
+ if( count > 0) {
+ if(count > 1 ){
+ QString msg;
+ msg=tr("Really delete\n%1 files?").arg(count);
+ switch ( QMessageBox::warning(this,tr("Delete"),msg
+ ,tr("Yes"),tr("No"),0,0,1) ) {
+ case 0:
+ doMsg=false;
break;
case 1:
- // exit
+ return;
break;
@@ -244,9 +282,3 @@ void AdvancedFm::localDelete() {
}
- }
- }
-}
-void AdvancedFm::remoteDelete() {
- QStringList curFileList = getPath();
- if( curFileList.count() > 0) {
QString myFile;
@@ -262,3 +294,3 @@ void AdvancedFm::remoteDelete() {
if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
- switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+
+ switch ( QMessageBox::warning(this,tr("Delete Directory"),tr("Really delete\n")+f+
"\nand all it's contents ?",
@@ -278,16 +310,15 @@ void AdvancedFm::remoteDelete() {
} else {
- switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f
+ if(doMsg) {
+ switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f
+" ?",tr("Yes"),tr("No"),0,0,1) ) {
- case 0: {
+ case 1:
+ return;
+ break;
+ };
+ }
QString cmd="rm "+f;
QFile file(f);
+ if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1)
file.remove();
// system( cmd.latin1());
- populateRemoteView();
- }
- break;
- case 1:
- // exit
- break;
- };
}
@@ -295,2 +326,3 @@ void AdvancedFm::remoteDelete() {
}
+ populateRemoteView();
}
@@ -411,3 +443,19 @@ void AdvancedFm::copy() {
QStringList curFileList = getPath();
- if( curFileList.count() > 0) {
+ bool doMsg=true;
+ int count=curFileList.count();
+ if( count > 0) {
+ if(count > 1 ){
+ QString msg;
+ msg=tr("Really copy\n%1 files?").arg(count);
+ switch ( QMessageBox::warning(this,tr("Delete"),msg
+ ,tr("Yes"),tr("No"),0,0,1) ) {
+ case 0:
+ doMsg=false;
+ break;
+ case 1:
+ return;
+ break;
+ };
+ }
+
QString curFile, item, destFile;
@@ -416,3 +464,2 @@ void AdvancedFm::copy() {
item=(*it);
-
if(item.find("->",0,TRUE)) //symlink
@@ -428,8 +475,6 @@ void AdvancedFm::copy() {
if( f.exists()) {
- switch ( QMessageBox::warning(this,tr("Delete"),
- destFile+tr(" already exists\nDo you really want to delete it?"),
+ if(doMsg) {
+ switch ( QMessageBox::warning(this,tr("File Exists!"),
+ item+tr("\nexists. Ok to overwrite?"),
tr("Yes"),tr("No"),0,0,1) ) {
- case 0:
- f.remove();
- break;
case 1:
@@ -439,2 +484,4 @@ void AdvancedFm::copy() {
}
+ f.remove();
+ }
if(!copyFile(destFile, curFile) ) {
@@ -450,3 +497,2 @@ void AdvancedFm::copy() {
item= (*it);
-
if(item.find("->",0,TRUE)) //symlink
@@ -462,8 +508,5 @@ void AdvancedFm::copy() {
if( f.exists()) {
- switch ( QMessageBox::warning(this,tr("Delete"),
- destFile+tr(" already exists\nDo you really want to delete it?"),
+ switch ( QMessageBox::warning(this,tr("File Exists!"),
+ item+tr("\nexists. Ok to overwrite?"),
tr("Yes"),tr("No"),0,0,1) ) {
- case 0:
- f.remove();
- break;
case 1:
@@ -472,2 +515,3 @@ void AdvancedFm::copy() {
};
+ f.remove();
}
@@ -509,4 +553,4 @@ void AdvancedFm::copyAs() {
if( f.exists()) {
- switch (QMessageBox::warning(this,tr("Delete"),
- destFile+tr(" already exists\nDo you really want to delete it?"),
+ switch (QMessageBox::warning(this,tr("File Exists!"),
+ item+tr("\nexists. Ok to overwrite?"),
tr("Yes"),tr("No"),0,0,1) ) {
@@ -548,4 +592,4 @@ void AdvancedFm::copyAs() {
if( f.exists()) {
- switch ( QMessageBox::warning(this,tr("Delete"),
- destFile+tr(" already exists\nDo you really want to delete it?"),
+ switch ( QMessageBox::warning(this,tr("File Exists!"),
+ item+tr("\nexists. Ok to overwrite?"),
tr("Yes"),tr("No"),0,0,1) ) {
@@ -964 +1008,11 @@ void AdvancedFm::fileBeamFinished( Ir *) {
}
+
+void AdvancedFm::selectAll() {
+ if (TabWidget->getCurrentTab() == 0) {
+ Local_View->selectAll(true);
+ Local_View->setSelected( Local_View->firstChild(),false);
+ } else {
+ Remote_View->selectAll(true);
+ Remote_View->setSelected( Remote_View->firstChild(),false);
+ }
+}