Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 215 |
1 files changed, 116 insertions, 99 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index f89ad30..0a9f921 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -1,29 +1,29 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | AdvancedFm.cpp | 2 | AdvancedFm.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | #include "inputDialog.h" | ||
14 | #include "output.h" | 13 | #include "output.h" |
15 | #include "filePermissions.h" | 14 | #include "filePermissions.h" |
16 | 15 | ||
17 | #include <opie/otabwidget.h> | 16 | #include <opie/otabwidget.h> |
17 | #include <opie/oprocess.h> | ||
18 | 18 | ||
19 | #include <qpe/lnkproperties.h> | 19 | #include <qpe/lnkproperties.h> |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
22 | #include <qpe/qpetoolbar.h> | 22 | #include <qpe/qpetoolbar.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
26 | #include <qpe/ir.h> | 26 | #include <qpe/ir.h> |
27 | 27 | ||
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | #include <qmultilineedit.h> | 29 | #include <qmultilineedit.h> |
@@ -224,47 +224,46 @@ void AdvancedFm::localDelete() { | |||
224 | 224 | ||
225 | QString f = currentDir.canonicalPath(); | 225 | QString f = currentDir.canonicalPath(); |
226 | if(f.right(1).find("/",0,TRUE) == -1) | 226 | if(f.right(1).find("/",0,TRUE) == -1) |
227 | f+="/"; | 227 | f+="/"; |
228 | f+=myFile; | 228 | f+=myFile; |
229 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { | 229 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
230 | switch ( QMessageBox::warning(this,tr("Delete Directory?"),tr("Really delete\n")+f+ | 230 | switch ( QMessageBox::warning(this,tr("Delete Directory?"),tr("Really delete\n")+f+ |
231 | "\nand all it's contents ?" | 231 | "\nand all it's contents ?" |
232 | ,tr("Yes"),tr("No"),0,0,1) ) { | 232 | ,tr("Yes"),tr("No"),0,0,1) ) { |
233 | case 0: { | 233 | case 0: { |
234 | f=f.left(f.length()-1); | 234 | f=f.left(f.length()-1); |
235 | QString cmd="rm -rf "+f; | 235 | QString cmd="rm -rf "+f; |
236 | system( cmd.latin1()); | 236 | startProcess( (const QString)cmd.latin1() ); |
237 | populateLocalView(); | 237 | populateLocalView(); |
238 | } | 238 | } |
239 | break; | 239 | break; |
240 | case 1: | 240 | case 1: |
241 | // exit | 241 | // exit |
242 | break; | 242 | break; |
243 | }; | 243 | }; |
244 | 244 | ||
245 | } else { | 245 | } else { |
246 | if(doMsg) { | 246 | if(doMsg) { |
247 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f | 247 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f |
248 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { | 248 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { |
249 | case 1: | 249 | case 1: |
250 | return; | 250 | return; |
251 | break; | 251 | break; |
252 | }; | 252 | }; |
253 | } | 253 | } |
254 | QString cmd="rm "+f; | 254 | QString cmd="rm "+f; |
255 | QFile file(f); | 255 | QFile file(f); |
256 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) | 256 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) |
257 | file.remove(); | 257 | file.remove(); |
258 | // system( cmd.latin1()); | ||
259 | } | 258 | } |
260 | } | 259 | } |
261 | } | 260 | } |
262 | populateLocalView(); | 261 | populateLocalView(); |
263 | } | 262 | } |
264 | 263 | ||
265 | void AdvancedFm::remoteDelete() { | 264 | void AdvancedFm::remoteDelete() { |
266 | QStringList curFileList = getPath(); | 265 | QStringList curFileList = getPath(); |
267 | bool doMsg=true; | 266 | bool doMsg=true; |
268 | int count=curFileList.count(); | 267 | int count=curFileList.count(); |
269 | if( count > 0) { | 268 | if( count > 0) { |
270 | if(count > 1 ){ | 269 | if(count > 1 ){ |
@@ -289,47 +288,46 @@ void AdvancedFm::remoteDelete() { | |||
289 | myFile = myFile.left(myFile.find(" -> ",0,TRUE)); | 288 | myFile = myFile.left(myFile.find(" -> ",0,TRUE)); |
290 | QString f = currentRemoteDir.canonicalPath(); | 289 | QString f = currentRemoteDir.canonicalPath(); |
291 | if(f.right(1).find("/",0,TRUE) == -1) | 290 | if(f.right(1).find("/",0,TRUE) == -1) |
292 | f+="/"; | 291 | f+="/"; |
293 | f+=myFile; | 292 | f+=myFile; |
294 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { | 293 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { |
295 | switch ( QMessageBox::warning(this,tr("Delete Directory"),tr("Really delete\n")+f+ | 294 | switch ( QMessageBox::warning(this,tr("Delete Directory"),tr("Really delete\n")+f+ |
296 | "\nand all it's contents ?", | 295 | "\nand all it's contents ?", |
297 | tr("Yes"),tr("No"),0,0,1) ) { | 296 | tr("Yes"),tr("No"),0,0,1) ) { |
298 | case 0: { | 297 | case 0: { |
299 | f=f.left(f.length()-1); | 298 | f=f.left(f.length()-1); |
300 | QString cmd="rm -rf "+f; | 299 | QString cmd="rm -rf "+f; |
301 | system( cmd.latin1()); | 300 | startProcess( (const QString)cmd ); |
302 | populateRemoteView(); | 301 | populateRemoteView(); |
303 | } | 302 | } |
304 | break; | 303 | break; |
305 | case 1: | 304 | case 1: |
306 | // exit | 305 | // exit |
307 | break; | 306 | break; |
308 | }; | 307 | }; |
309 | 308 | ||
310 | } else { | 309 | } else { |
311 | if(doMsg) { | 310 | if(doMsg) { |
312 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f | 311 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f |
313 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { | 312 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { |
314 | case 1: | 313 | case 1: |
315 | return; | 314 | return; |
316 | break; | 315 | break; |
317 | }; | 316 | }; |
318 | } | 317 | } |
319 | QString cmd="rm "+f; | 318 | QString cmd="rm "+f; |
320 | QFile file(f); | 319 | QFile file(f); |
321 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) | 320 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) |
322 | file.remove(); | 321 | file.remove(); |
323 | // system( cmd.latin1()); | ||
324 | } | 322 | } |
325 | } | 323 | } |
326 | } | 324 | } |
327 | populateRemoteView(); | 325 | populateRemoteView(); |
328 | } | 326 | } |
329 | 327 | ||
330 | void AdvancedFm::localRename() { | 328 | void AdvancedFm::localRename() { |
331 | QString curFile = Local_View->currentItem()->text(0); | 329 | QString curFile = Local_View->currentItem()->text(0); |
332 | qDebug("currentItem "+curFile); | 330 | qDebug("currentItem "+curFile); |
333 | if( curFile !="../") { | 331 | if( curFile !="../") { |
334 | InputDialog *fileDlg; | 332 | InputDialog *fileDlg; |
335 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); | 333 | fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); |
@@ -801,182 +799,181 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src ) { | |||
801 | success = FALSE; | 799 | success = FALSE; |
802 | } | 800 | } |
803 | 801 | ||
804 | // Set file permissions | 802 | // Set file permissions |
805 | if( stat( (const char *) src, &status ) == 0 ){ | 803 | if( stat( (const char *) src, &status ) == 0 ){ |
806 | chmod( (const char *) dest, status.st_mode ); | 804 | chmod( (const char *) dest, status.st_mode ); |
807 | } | 805 | } |
808 | 806 | ||
809 | return success; | 807 | return success; |
810 | } | 808 | } |
811 | 809 | ||
812 | void AdvancedFm::runCommand() { | 810 | void AdvancedFm::runCommand() { |
813 | QString curFile; | 811 | QString curFile; |
814 | if (TabWidget->getCurrentTab() == 0) { | 812 | if (TabWidget->getCurrentTab() == 0) { |
815 | if( Local_View->currentItem()) | 813 | if( Local_View->currentItem()) |
816 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); | 814 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); |
817 | } else { | ||
818 | if(Remote_View->currentItem()) | ||
819 | curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0); | ||
820 | } | ||
821 | |||
822 | InputDialog *fileDlg; | ||
823 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | ||
824 | fileDlg->setInputText(curFile); | ||
825 | fileDlg->exec(); | ||
826 | QString command; | ||
827 | if( fileDlg->result() == 1 ) { | ||
828 | command = fileDlg->LineEdit1->text(); | ||
829 | |||
830 | Output *outDlg; | ||
831 | outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); | ||
832 | outDlg->showMaximized(); | ||
833 | outDlg->show(); | ||
834 | qApp->processEvents(); | ||
835 | FILE *fp; | ||
836 | char line[130]; | ||
837 | sleep(1); | ||
838 | command +=" 2>&1"; | ||
839 | fp = popen( (const char *) command, "r"); | ||
840 | if ( !fp ) { | ||
841 | qDebug("Could not execute '" + command + "'! err=%d", fp); | ||
842 | QMessageBox::warning( this, "AdvancedFm", tr("command failed!"), tr("&OK") ); | ||
843 | pclose(fp); | ||
844 | return; | ||
845 | } else { | 815 | } else { |
846 | while ( fgets( line, sizeof line, fp)) { | 816 | if(Remote_View->currentItem()) |
847 | QString lineStr = line; | 817 | curFile = currentRemoteDir.canonicalPath() + "/"+Remote_View->currentItem()->text(0); |
848 | lineStr=lineStr.left(lineStr.length()-1); | ||
849 | outDlg->OutputEdit->append(lineStr); | ||
850 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | ||
851 | } | ||
852 | } | 818 | } |
853 | pclose(fp); | ||
854 | 819 | ||
855 | } | 820 | InputDialog *fileDlg; |
821 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | ||
822 | fileDlg->setInputText(curFile); | ||
823 | fileDlg->exec(); | ||
824 | //QString command; | ||
825 | |||
826 | if( fileDlg->result() == 1 ) { | ||
827 | qDebug(fileDlg->LineEdit1->text()); | ||
828 | QStringList command; | ||
829 | |||
830 | command << "/bin/sh"; | ||
831 | command << "-c"; | ||
832 | command << fileDlg->LineEdit1->text(); | ||
833 | Output *outDlg; | ||
834 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | ||
835 | outDlg->showMaximized(); | ||
836 | outDlg->exec(); | ||
837 | qApp->processEvents(); | ||
838 | |||
839 | } | ||
856 | } | 840 | } |
857 | 841 | ||
858 | void AdvancedFm::runCommandStd() { | 842 | void AdvancedFm::runCommandStd() { |
859 | QString curFile; | 843 | QString curFile; |
860 | if (TabWidget->getCurrentTab() == 0) { | 844 | if (TabWidget->getCurrentTab() == 0) { |
861 | if( Local_View->currentItem()) | 845 | if( Local_View->currentItem()) |
862 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); | 846 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); |
863 | } else { | 847 | } else { |
864 | if(Remote_View->currentItem()) | 848 | if(Remote_View->currentItem()) |
865 | curFile = currentRemoteDir.canonicalPath() +"/" | 849 | curFile = currentRemoteDir.canonicalPath() +"/" |
866 | + Remote_View->currentItem()->text(0); | 850 | + Remote_View->currentItem()->text(0); |
867 | } | 851 | } |
868 | 852 | ||
869 | InputDialog *fileDlg; | 853 | InputDialog *fileDlg; |
870 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 854 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
871 | fileDlg->setInputText(curFile); | 855 | fileDlg->setInputText(curFile); |
872 | fileDlg->exec(); | 856 | fileDlg->exec(); |
873 | QString command; | 857 | |
874 | if( fileDlg->result() == 1 ) { | 858 | if( fileDlg->result() == 1 ) { |
875 | qApp->processEvents(); | 859 | qApp->processEvents(); |
876 | command = fileDlg->LineEdit1->text() + " &"; | 860 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); |
877 | system(command.latin1()); | ||
878 | } | 861 | } |
879 | } | 862 | } |
880 | 863 | ||
881 | void AdvancedFm::fileStatus() { | 864 | void AdvancedFm::fileStatus() { |
882 | QString curFile; | 865 | QString curFile; |
883 | if (TabWidget->getCurrentTab() == 0) { | 866 | if (TabWidget->getCurrentTab() == 0) { |
884 | curFile = Local_View->currentItem()->text(0); | 867 | curFile = Local_View->currentItem()->text(0); |
885 | } else { | 868 | } else { |
886 | curFile = Remote_View->currentItem()->text(0); | 869 | curFile = Remote_View->currentItem()->text(0); |
887 | } | 870 | } |
888 | QString command = " stat -l "+ curFile +" 2>&1"; | ||
889 | Output *outDlg; | ||
890 | outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); | ||
891 | outDlg->showMaximized(); | ||
892 | outDlg->show(); | ||
893 | qApp->processEvents(); | ||
894 | FILE *fp; | ||
895 | char line[130]; | ||
896 | sleep(1); | ||
897 | fp = popen( (const char *) command, "r"); | ||
898 | if ( !fp ) { | ||
899 | qDebug("Could not execute '" + command + "'! err=%d", fp); | ||
900 | QMessageBox::warning( this, "AdvancedFm", tr("command failed!"), tr("&OK") ); | ||
901 | pclose(fp); | ||
902 | return; | ||
903 | } else { | ||
904 | while ( fgets( line, sizeof line, fp)) { | ||
905 | outDlg->OutputEdit->append(line); | ||
906 | outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | ||
907 | 871 | ||
908 | } | 872 | QStringList command; |
873 | command << "/bin/sh"; | ||
874 | command << "-c"; | ||
875 | command << "stat -l "+ curFile; | ||
909 | 876 | ||
910 | } | 877 | Output *outDlg; |
911 | pclose(fp); | 878 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
879 | outDlg->showMaximized(); | ||
880 | outDlg->exec(); | ||
881 | qApp->processEvents(); | ||
882 | |||
883 | |||
884 | // Output *outDlg; | ||
885 | // outDlg = new Output(this, tr("AdvancedFm Output"),FALSE); | ||
886 | // outDlg->showMaximized(); | ||
887 | // outDlg->show(); | ||
888 | // qApp->processEvents(); | ||
889 | |||
890 | // FILE *fp; | ||
891 | // char line[130]; | ||
892 | // sleep(1); | ||
893 | // fp = popen( (const char *) command, "r"); | ||
894 | // if ( !fp ) { | ||
895 | // qDebug("Could not execute '" + command + "'! err=%d", fp); | ||
896 | // QMessageBox::warning( this, "AdvancedFm", tr("command failed!"), tr("&OK") ); | ||
897 | // pclose(fp); | ||
898 | // return; | ||
899 | // } else { | ||
900 | // while ( fgets( line, sizeof line, fp)) { | ||
901 | // outDlg->OutputEdit->append(line); | ||
902 | // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); | ||
903 | |||
904 | // } | ||
905 | |||
906 | // } | ||
907 | // pclose(fp); | ||
912 | } | 908 | } |
913 | 909 | ||
910 | |||
914 | void AdvancedFm::mkDir() { | 911 | void AdvancedFm::mkDir() { |
915 | if (TabWidget->getCurrentTab() == 0) | 912 | if (TabWidget->getCurrentTab() == 0) |
916 | localMakDir(); | 913 | localMakDir(); |
917 | else | 914 | else |
918 | remoteMakDir(); | 915 | remoteMakDir(); |
919 | 916 | ||
920 | } | 917 | } |
921 | 918 | ||
922 | void AdvancedFm::rn() { | 919 | void AdvancedFm::rn() { |
923 | if (TabWidget->getCurrentTab() == 0) | 920 | if (TabWidget->getCurrentTab() == 0) |
924 | localRename(); | 921 | localRename(); |
925 | else | 922 | else |
926 | remoteRename(); | 923 | remoteRename(); |
927 | 924 | ||
928 | } | 925 | } |
929 | 926 | ||
930 | void AdvancedFm::del() { | 927 | void AdvancedFm::del() { |
931 | if (TabWidget->getCurrentTab() == 0) | 928 | if (TabWidget->getCurrentTab() == 0) |
932 | localDelete(); | 929 | localDelete(); |
933 | else | 930 | else |
934 | remoteDelete(); | 931 | remoteDelete(); |
935 | } | 932 | } |
936 | 933 | ||
937 | void AdvancedFm::mkSym() { | 934 | void AdvancedFm::mkSym() { |
938 | QString cmd; | 935 | QString cmd; |
939 | QStringList curFileList = getPath(); | 936 | QStringList curFileList = getPath(); |
940 | if( curFileList.count() > 0) { | 937 | if( curFileList.count() > 0) { |
941 | 938 | ||
942 | if (TabWidget->getCurrentTab() == 0) { | 939 | if (TabWidget->getCurrentTab() == 0) { |
943 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 940 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
944 | 941 | ||
945 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); | 942 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); |
946 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | 943 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); |
947 | QString curFile = currentDir.canonicalPath()+"/"+(*it); | 944 | QString curFile = currentDir.canonicalPath()+"/"+(*it); |
948 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | 945 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); |
949 | cmd = "ln -s "+curFile+" "+destName; | 946 | cmd = "ln -s "+curFile+" "+destName; |
950 | qDebug(cmd); | 947 | qDebug(cmd); |
951 | system(cmd.latin1() ); | 948 | startProcess( (const QString)cmd ); |
952 | } | 949 | } |
953 | populateRemoteView(); | 950 | populateRemoteView(); |
954 | TabWidget->setCurrentTab(1); | 951 | TabWidget->setCurrentTab(1); |
955 | } else { | 952 | } else { |
956 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 953 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
957 | 954 | ||
958 | QString destName = currentDir.canonicalPath()+"/"+(*it); | 955 | QString destName = currentDir.canonicalPath()+"/"+(*it); |
959 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | 956 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); |
960 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 957 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
961 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | 958 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); |
962 | 959 | ||
963 | cmd = "ln -s "+curFile+" "+destName; | 960 | cmd = "ln -s "+curFile+" "+destName; |
964 | qDebug(cmd); | 961 | qDebug(cmd); |
965 | system(cmd.latin1() ); | 962 | startProcess( (const QString)cmd ); |
966 | } | 963 | } |
967 | populateLocalView(); | 964 | populateLocalView(); |
968 | TabWidget->setCurrentTab(0); | 965 | TabWidget->setCurrentTab(0); |
966 | } | ||
969 | } | 967 | } |
970 | } | ||
971 | } | 968 | } |
972 | 969 | ||
973 | void AdvancedFm::doBeam() { | 970 | void AdvancedFm::doBeam() { |
974 | Ir ir; | 971 | Ir ir; |
975 | if(!ir.supported()){ | 972 | if(!ir.supported()){ |
976 | } else { | 973 | } else { |
977 | 974 | ||
978 | QStringList curFileList = getPath(); | 975 | QStringList curFileList = getPath(); |
979 | if( curFileList.count() > 0) { | 976 | if( curFileList.count() > 0) { |
980 | 977 | ||
981 | if (TabWidget->getCurrentTab() == 0) { | 978 | if (TabWidget->getCurrentTab() == 0) { |
982 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 979 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
@@ -1009,12 +1006,32 @@ void AdvancedFm::fileBeamFinished( Ir *) { | |||
1009 | 1006 | ||
1010 | } | 1007 | } |
1011 | 1008 | ||
1012 | void AdvancedFm::selectAll() { | 1009 | void AdvancedFm::selectAll() { |
1013 | if (TabWidget->getCurrentTab() == 0) { | 1010 | if (TabWidget->getCurrentTab() == 0) { |
1014 | Local_View->selectAll(true); | 1011 | Local_View->selectAll(true); |
1015 | Local_View->setSelected( Local_View->firstChild(),false); | 1012 | Local_View->setSelected( Local_View->firstChild(),false); |
1016 | } else { | 1013 | } else { |
1017 | Remote_View->selectAll(true); | 1014 | Remote_View->selectAll(true); |
1018 | Remote_View->setSelected( Remote_View->firstChild(),false); | 1015 | Remote_View->setSelected( Remote_View->firstChild(),false); |
1019 | } | 1016 | } |
1020 | } | 1017 | } |
1018 | |||
1019 | void AdvancedFm::startProcess(const QString & cmd) { | ||
1020 | QStringList command; | ||
1021 | OProcess *process; | ||
1022 | process = new OProcess(); | ||
1023 | connect(process, SIGNAL(processExited(OProcess *)), | ||
1024 | this, SLOT( processEnded())); | ||
1025 | |||
1026 | command << "/bin/sh"; | ||
1027 | command << "-c"; | ||
1028 | command << cmd.latin1(); | ||
1029 | *process << command; | ||
1030 | if(!process->start(OProcess::NotifyOnExit) ) | ||
1031 | qDebug("could not start process"); | ||
1032 | } | ||
1033 | |||
1034 | void AdvancedFm::processEnded() { | ||
1035 | populateLocalView(); | ||
1036 | populateRemoteView(); | ||
1037 | } | ||