b79df5
diff -Nur qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.cpp qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.cpp
b79df5
--- qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.cpp	2004-09-14 22:13:07.000000000 +0200
f611c4
+++ qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.cpp	2005-04-05 15:40:25.000000000 +0200
dac2b9
@@ -27,6 +27,9 @@
dac2b9
 #include "qc_applicationwindow.h"
dac2b9
 
dac2b9
 #include <fstream>
dac2b9
+#include <sys types.h="">
dac2b9
+#include <sys wait.h="">
dac2b9
+#include <unistd.h>
dac2b9
 
dac2b9
 #include <qaccel.h>
dac2b9
 #include <qaction.h>
f611c4
@@ -2774,11 +2777,44 @@
b79df5
 #if QT_VERSION>=0x030200 
b79df5
         assistant->setArguments(args);
b79df5
 #endif
b79df5
+        connect( assistant, SIGNAL(error(const QString&)), this, SLOT(slotAssistantError(const QString&)) );
b79df5
     }
b79df5
     assistant->openAssistant();
b79df5
     //assistant->showPage("index.html");
b79df5
 }
b79df5
 
dac2b9
+void QC_ApplicationWindow::slotAssistantError(const QString&) {
b79df5
+    if ( !assistant->isOpen() ) {
dac2b9
+        pid_t pid;
dac2b9
+	if ( (pid = fork()) < 0 ) {
dac2b9
+	    perror( "fork" );
dac2b9
+	    QMessageBox::critical( this, QC_APPNAME, "Could not fork child process." );
dac2b9
+	    return;
dac2b9
+	}
dac2b9
+	if ( pid==0 ) {  // child
dac2b9
+  	    pid_t gcpid;
dac2b9
+	    if ( (gcpid = fork()) < 0 ) {
dac2b9
+	        perror( "fork" );
dac2b9
+		_exit(1);
dac2b9
+	    }
dac2b9
+	    if ( gcpid==0 ) {  // grandchild
dac2b9
+	        char* argv[] = { "gnome-open",
dac2b9
+				 "/usr/share/qcad/doc/cad/index.html",
dac2b9
+				 0
dac2b9
+		};
dac2b9
+		execvp( argv[0], argv);
dac2b9
+		perror( "execvp" );
dac2b9
+		_exit(1);
dac2b9
+	    }
f611c4
+	    int status;
f611c4
+	    waitpid( pid, &status, 0 );
dac2b9
+	    _exit(0);
dac2b9
+	}
dac2b9
+	// parent
f611c4
+	int status;
f611c4
+	waitpid( pid, &status, 0 );
b79df5
+    }
b79df5
+}
b79df5
 
b79df5
 
b79df5
 /**
b79df5
diff -Nur qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.h qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.h
b79df5
--- qcad-2.0.4.0-1.src-orig/qcad/src/qc_applicationwindow.h	2004-09-14 22:13:07.000000000 +0200
b79df5
+++ qcad-2.0.4.0-1.src/qcad/src/qc_applicationwindow.h	2005-02-14 23:03:46.000000000 +0100
b79df5
@@ -224,6 +224,8 @@
b79df5
     /** resizes window to 640x480 for screen shots */
b79df5
     void slotTestResize1024();
b79df5
 
b79df5
+    void slotAssistantError(const QString&);
b79df5
+
b79df5
 signals:
b79df5
     void gridChanged(bool on);
b79df5
     void draftChanged(bool on);