summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 8a1eeec..2126745 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -1160,49 +1160,49 @@ bool AdvancedFm::copyFile( const QString & dest, const QString & src )
1160 1160
1161 return success; 1161 return success;
1162} 1162}
1163 1163
1164void AdvancedFm::runCommand() { 1164void AdvancedFm::runCommand() {
1165 QString curFile; 1165 QString curFile;
1166 if (TabWidget->currentPageIndex() == 0) { 1166 if (TabWidget->currentPageIndex() == 0) {
1167 if( Local_View->currentItem()) 1167 if( Local_View->currentItem())
1168 curFile = currentDir.canonicalPath() + Local_View->currentItem()->text(0); 1168 curFile = currentDir.canonicalPath() + Local_View->currentItem()->text(0);
1169 } else { 1169 } else {
1170 if(Remote_View->currentItem()) 1170 if(Remote_View->currentItem())
1171 curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0); 1171 curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0);
1172 } 1172 }
1173 1173
1174 InputDialog *fileDlg; 1174 InputDialog *fileDlg;
1175 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 1175 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
1176 fileDlg->setInputText(curFile); 1176 fileDlg->setInputText(curFile);
1177 fileDlg->exec(); 1177 fileDlg->exec();
1178 QString command; 1178 QString command;
1179 if( fileDlg->result() == 1 ) { 1179 if( fileDlg->result() == 1 ) {
1180 command = fileDlg->LineEdit1->text(); 1180 command = fileDlg->LineEdit1->text();
1181 1181
1182 int err=0; 1182 int err=0;
1183 Output *outDlg; 1183 Output *outDlg;
1184 outDlg = new Output(this, tr("Formatter Output"),FALSE); 1184 outDlg = new Output(this, tr("AdvancedFm Output"),FALSE);
1185 outDlg->showMaximized(); 1185 outDlg->showMaximized();
1186 outDlg->show(); 1186 outDlg->show();
1187 qApp->processEvents(); 1187 qApp->processEvents();
1188 FILE *fp; 1188 FILE *fp;
1189 char line[130]; 1189 char line[130];
1190 sleep(1); 1190 sleep(1);
1191// if(command.find("2>",0,TRUE) != -1) 1191// if(command.find("2>",0,TRUE) != -1)
1192 command +=" 2>&1"; 1192 command +=" 2>&1";
1193 fp = popen( (const char *) command, "r"); 1193 fp = popen( (const char *) command, "r");
1194 if ( !fp ) { 1194 if ( !fp ) {
1195 qDebug("Could not execute '" + command + "'! err=%d", fp); 1195 qDebug("Could not execute '" + command + "'! err=%d", fp);
1196 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1196 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1197 pclose(fp); 1197 pclose(fp);
1198 return; 1198 return;
1199 } else { 1199 } else {
1200 while ( fgets( line, sizeof line, fp)) { 1200 while ( fgets( line, sizeof line, fp)) {
1201 QString lineStr = line; 1201 QString lineStr = line;
1202 lineStr=lineStr.left(lineStr.length()-1); 1202 lineStr=lineStr.left(lineStr.length()-1);
1203 outDlg->OutputEdit->append(lineStr); 1203 outDlg->OutputEdit->append(lineStr);
1204 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1204 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1205 } 1205 }
1206 } 1206 }
1207 } 1207 }
1208} 1208}
@@ -1218,49 +1218,49 @@ void AdvancedFm::runCommandStd() {
1218 } 1218 }
1219 1219
1220 InputDialog *fileDlg; 1220 InputDialog *fileDlg;
1221 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 1221 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
1222 fileDlg->setInputText(curFile); 1222 fileDlg->setInputText(curFile);
1223 fileDlg->exec(); 1223 fileDlg->exec();
1224 QString command; 1224 QString command;
1225 if( fileDlg->result() == 1 ) { 1225 if( fileDlg->result() == 1 ) {
1226 qApp->processEvents(); 1226 qApp->processEvents();
1227 command = fileDlg->LineEdit1->text() + " &"; 1227 command = fileDlg->LineEdit1->text() + " &";
1228 system(command.latin1()); 1228 system(command.latin1());
1229 } 1229 }
1230} 1230}
1231 1231
1232void AdvancedFm::fileStatus() { 1232void AdvancedFm::fileStatus() {
1233 QString curFile; 1233 QString curFile;
1234 if (TabWidget->currentPageIndex() == 0) { 1234 if (TabWidget->currentPageIndex() == 0) {
1235 curFile = Local_View->currentItem()->text(0); 1235 curFile = Local_View->currentItem()->text(0);
1236 } else { 1236 } else {
1237 curFile = Remote_View->currentItem()->text(0); 1237 curFile = Remote_View->currentItem()->text(0);
1238 } 1238 }
1239 QString command = " stat -l "+ curFile +" 2>&1"; 1239 QString command = " stat -l "+ curFile +" 2>&1";
1240 int err=0; 1240 int err=0;
1241 Output *outDlg; 1241 Output *outDlg;
1242 outDlg = new Output(this, tr("Formatter Output"),FALSE); 1242 outDlg = new Output(this, tr("AdvancedFm Output"),FALSE);
1243 outDlg->showMaximized(); 1243 outDlg->showMaximized();
1244 outDlg->show(); 1244 outDlg->show();
1245 qApp->processEvents(); 1245 qApp->processEvents();
1246 FILE *fp; 1246 FILE *fp;
1247 char line[130]; 1247 char line[130];
1248 sleep(1); 1248 sleep(1);
1249 fp = popen( (const char *) command, "r"); 1249 fp = popen( (const char *) command, "r");
1250 if ( !fp ) { 1250 if ( !fp ) {
1251 qDebug("Could not execute '" + command + "'! err=%d", fp); 1251 qDebug("Could not execute '" + command + "'! err=%d", fp);
1252 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") ); 1252 QMessageBox::warning( this, tr("AdvancedFm"), tr("command failed!"), tr("&OK") );
1253 pclose(fp); 1253 pclose(fp);
1254 return; 1254 return;
1255 } else { 1255 } else {
1256 while ( fgets( line, sizeof line, fp)) { 1256 while ( fgets( line, sizeof line, fp)) {
1257 outDlg->OutputEdit->append(line); 1257 outDlg->OutputEdit->append(line);
1258 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 1258 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
1259 1259
1260 } 1260 }
1261 1261
1262 } 1262 }
1263} 1263}
1264 1264
1265void AdvancedFm::doAbout() { 1265void AdvancedFm::doAbout() {
1266 QMessageBox::message("AdvancedFm","Advanced FileManager\n" 1266 QMessageBox::message("AdvancedFm","Advanced FileManager\n"