Changeset 999 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 20, 2007 11:15:18 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp
r992 r999 42 42 #include <qwidgetstack.h> 43 43 #include <qbutton.h> 44 #include <qprocess.h> 44 45 45 46 #include <qlayout.h> … … 747 748 } 748 749 749 #if defined (Q_WS_X11)750 /**751 * Start the kchmviewer application with the VBox help file.752 *753 * @param pvUser an array of strings which are the path to and the arguments for kchmviewer754 */755 DECLCALLBACK(int) showHelpContentsThread(RTTHREAD /* ThreadSelf */, void *pvUser)756 {757 char **papszArgs = reinterpret_cast<char **>(pvUser);758 int rc;759 RTPROCESS hProcess;760 761 rc = RTProcCreate(papszArgs[0], papszArgs, 0, 0, &hProcess);762 if (rc == VINF_SUCCESS)763 {764 RTPROCSTATUS ProcStatus;765 766 return RTProcWait(hProcess, RTPROCWAIT_FLAGS_BLOCK, &ProcStatus);767 }768 return rc;769 }770 #endif771 772 750 void VBoxSelectorWnd::showHelpContents() 773 751 { … … 782 760 if (RTPathProgram(szPathProg, sizeof(szPathProg)) == VINF_SUCCESS) 783 761 { 784 const char szViewer[] = "/kchmviewer"; 785 const char szHelpFile[] = "/VirtualBox.chm"; 786 char szViewerPath[RTPATH_MAX], szFilePath[RTPATH_MAX]; 787 char *papszArgs[3] = { szViewerPath, szFilePath, 0 }; 788 RTTHREAD hThread; 789 int cPathLen; 790 791 cPathLen = strlen(szPathProg); 792 AssertReturn(cPathLen + sizeof(szHelpFile) < RTPATH_MAX, (void) 0); /* is there a cleaner way? */ 793 strcpy(szViewerPath, szPathProg); 794 strncpy(szViewerPath + cPathLen, szViewer, sizeof(szViewerPath) - cPathLen); 795 szViewerPath[sizeof(szViewerPath) - 1] = 0; 796 strcpy(szFilePath, szPathProg); 797 strncpy(szFilePath + cPathLen, szHelpFile, sizeof(szFilePath) - cPathLen); 798 szFilePath[sizeof(szFilePath) - 1] = 0; 799 /* For now we just start the process and do not worry about anything else. */ 800 RTThreadCreate(&hThread, showHelpContentsThread, papszArgs, 0, 801 RTTHREADTYPE_INFREQUENT_POLLER, 0, "HelpViewer"); 762 QString kchmViewerName(QString (szPathProg) + "/kchmviewer"); 763 QString kchmViewerArg (QString (szPathProg) + "/VirtualBox.chm"); 764 QProcess kchmViewer(kchmViewerName); 765 kchmViewer.addArgument(kchmViewerArg); 766 kchmViewer.launch(""); 802 767 } 803 768 # endif
Note:
See TracChangeset
for help on using the changeset viewer.