mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-10-31 22:23:54 +01:00 
			
		
		
		
	Steve's patch, modified by Richard, to sort out the modality of the help window, fixes bug 747.
This commit is contained in:
		| @@ -86,7 +86,8 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent, | ||||
| void HelpSystem::ShowHtmlText(wxWindow *pParent, | ||||
|                   const wxString &Title, | ||||
|                   const wxString &HtmlText, | ||||
|                   bool bIsFile = false, bool bModal = false) | ||||
|                   bool bIsFile, | ||||
|                   bool bModal) | ||||
| { | ||||
|    LinkingHtmlWindow *html; | ||||
|  | ||||
| @@ -172,7 +173,8 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent, | ||||
|  | ||||
| void HelpSystem::ShowHelpDialog(wxWindow *parent, | ||||
|                     const wxString &localFileName, | ||||
|                     const wxString &remoteURL) | ||||
|                     const wxString &remoteURL, | ||||
|                     bool bModal) | ||||
| { | ||||
|    AudacityProject * pProj = GetActiveProject(); | ||||
|    wxString HelpMode = wxT("Local"); | ||||
| @@ -209,10 +211,9 @@ void HelpSystem::ShowHelpDialog(wxWindow *parent, | ||||
|       wxASSERT( !remoteURL.IsEmpty() ); | ||||
|       // I can't find it'. | ||||
|       // Use Built-in browser to suggest you use the remote url. | ||||
| //use the remote link | ||||
|       wxString Text = HelpText( wxT("remotehelp") ); | ||||
|       Text.Replace( wxT("*URL*"), remoteURL ); | ||||
|       ShowHtmlText( parent, _("Help on the Internet"), Text ); | ||||
|       ShowHtmlText( parent, _("Help on the Internet"), Text, false, bModal ); | ||||
|    } | ||||
|    else if( HelpMode == wxT("Local") ) | ||||
|    { | ||||
| @@ -222,11 +223,13 @@ void HelpSystem::ShowHelpDialog(wxWindow *parent, | ||||
|    else | ||||
|    { | ||||
|       // Local file, Built-in browser | ||||
|       ShowHtmlText( parent, wxT(""), localFileName, true ); | ||||
|       ShowHtmlText( parent, wxT(""), localFileName, true, bModal ); | ||||
|    } | ||||
| } | ||||
|  | ||||
| void HelpSystem::ShowHelpDialog(wxWindow *parent, const wxString &PageName) | ||||
| void HelpSystem::ShowHelpDialog(wxWindow *parent, | ||||
|                                 const wxString &PageName, | ||||
|                                 bool bModal) | ||||
| { | ||||
|    wxString localHelpPage; | ||||
|    wxString webHelpPage; | ||||
| @@ -274,5 +277,6 @@ void HelpSystem::ShowHelpDialog(wxWindow *parent, const wxString &PageName) | ||||
|    HelpSystem::ShowHelpDialog( | ||||
|       parent,  | ||||
|       localHelpPage, | ||||
|       webHelpPage); | ||||
|       webHelpPage, | ||||
|       bModal); | ||||
| } | ||||
|   | ||||
| @@ -36,10 +36,17 @@ public: | ||||
|                      const int xSize, const int ySize); | ||||
|  | ||||
|    /// Displays a new window with wxHTML help. | ||||
|    /// @param HtmlText Either the literal HTML code to go into the window, | ||||
|    /// or the name of the file to read said HTML code from (see below). | ||||
|    /// @param bIsFile If true, treat HtmlText argument as a file name, if false | ||||
|    /// (default), then it is the HTML code to display. | ||||
|    /// @param bModal Whether the resulting window should be modal or not. | ||||
|    /// Default is modeless dialogue | ||||
|    static void ShowHtmlText( wxWindow * pParent,  | ||||
|                    const wxString &Title, | ||||
|                    const wxString &HtmlText, | ||||
|                    bool bIsFile, bool bModal); | ||||
|                    bool bIsFile = false, | ||||
|                    bool bModal = false); | ||||
|  | ||||
|    /// Displays a file in your browser, if it's available locally, | ||||
|    /// OR else links to the internet. Generally using this outside this class | ||||
| @@ -48,17 +55,23 @@ public: | ||||
|    /// @param localFileName Name and path of the file on the local machine | ||||
|    /// file system to be opened. file.name#anchor syntax is allowed, and therefore | ||||
|    /// file names containing a '#' are not (on any platform). | ||||
|    /// @param bModal Whether the resulting dialogue should be modal or not. | ||||
|    /// Default is modeless dialogue | ||||
|    static void ShowHelpDialog(wxWindow *parent, | ||||
|                      const wxString &localFileName, | ||||
|                      const wxString &remoteURL); | ||||
|                      const wxString &remoteURL, | ||||
|                      bool bModal = false); | ||||
|  | ||||
|    /// Displays a page from the Audacity manual  in your browser, if | ||||
|    /// it's available locally, OR else links to the internet. | ||||
|    /// @param PageName The name of the manual page to display as it is in | ||||
|    /// _development version_ of the manual (i.e. in MediaWiki), _not_ the | ||||
|    /// converted file name used for offline and released manuals | ||||
|    /// converted file name used for offline and released manuals. | ||||
|    /// @param bModal Whether the resulting dialogue should be modal or not. | ||||
|    /// Default is modeless dialogue | ||||
|    static void ShowHelpDialog(wxWindow *parent, | ||||
|                      const wxString &PageName); | ||||
|                      const wxString &PageName, | ||||
|                      bool bModal = false); | ||||
|  | ||||
|    /// Hostname (domain name including subdomain) of the server on which the | ||||
|    /// online help is available | ||||
|   | ||||
		Reference in New Issue
	
	Block a user