Diffstat (limited to 'noncore/apps/opie-gutenbrowser/gutenbrowser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-gutenbrowser/gutenbrowser.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index fac21da..c7cdd83 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp @@ -208,49 +208,60 @@ void Gutenbrowser::goGetit( const QString &url, bool showMsg) { filename+="etc/gutenbrowser/"; odebug << "filename "+filename << oendl; // QString filename = QDir::homeDirPath()+"/Applications/gutenbrowser/"; filename += url.right( url.length() - url.findRev("/",-1,TRUE) -1); Config config("Gutenbrowser"); config.setGroup( "Browser" ); QString brow = config.readEntry("Preferred", "Opera"); odebug << "Preferred browser is "+brow << oendl; if(!showMsg) { //if we just get the gutenindex.all cmd="wget -O " + filename +" " + url+" 2>&1" ; chdir(local_library); odebug << "Issuing the system command: " << cmd << "" << oendl; Output *outDlg; - outDlg = new Output(this, tr("Gutenbrowser Output"),FALSE); + + outDlg = new Output( 0, tr("Downloading Gutenberg Index...."),TRUE); + outDlg->showMaximized(); outDlg->show(); qApp->processEvents(); FILE *fp; char line[130]; outDlg->OutputEdit->append( tr("Running wget") ); + outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); sleep(1); fp = popen( (const char *) cmd, "r"); - odebug << "Issuing the command\n"+cmd << oendl; - // system(cmd); - while ( fgets( line, sizeof line, fp)) { - outDlg->OutputEdit->append(line); -// outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); + if ( !fp ) { + } else { + //odebug << "Issuing the command\n"+cmd << oendl; + // system(cmd); + while ( fgets( line, sizeof line, fp)) { + outDlg->OutputEdit->append(line); + outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); + } + pclose(fp); + outDlg->OutputEdit->append("Finished downloading\n"); + outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); + qApp->processEvents(); + } - pclose(fp); - outDlg->close(); + outDlg->close(); + if(outDlg) delete outDlg; } else { if( brow == "Konq") { cmd = "konqueror "+url+" &"; } if( brow == "Opera") { //for desktop testing cmd = "opera "+url+" &"; } // if( brow == "Opera") { // on Zaurus // cmd = "operagui "+url+" &"; // } if( brow == "Mozilla") { cmd = "mozilla "+url+" &"; } if( brow == "Netscape") { |