Cygwin build fix - removed unused function which currently duplicates wxLaunchDefaultBrowser.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-30 09:53:21 +00:00
parent b58a81c465
commit 10dd0cfa58
2 changed files with 9 additions and 62 deletions

View File

@@ -172,56 +172,6 @@ int apFindNotebookPage(wxNotebook* notebook, const wxString& name)
return -1;
}
/*
* View an HTML file
*/
void apViewHTMLFile(const wxString& url)
{
#ifdef __WXMSW__
HKEY hKey;
TCHAR szCmdName[1024];
DWORD dwType, dw = sizeof(szCmdName);
LONG lRes;
lRes = RegOpenKey(HKEY_CLASSES_ROOT, _T("htmlfile\\shell\\open\\command"), &hKey);
if(lRes == ERROR_SUCCESS && RegQueryValueEx(hKey,(LPTSTR)NULL, NULL,
&dwType, (LPBYTE)szCmdName, &dw) == ERROR_SUCCESS)
{
wxStrcat(szCmdName, (const wxChar*) url);
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
memset(&siStartInfo, 0, sizeof(STARTUPINFO));
siStartInfo.cb = sizeof(STARTUPINFO);
CreateProcess(NULL, szCmdName, NULL, NULL, false, 0, NULL,
NULL, &siStartInfo, &piProcInfo );
}
if(lRes == ERROR_SUCCESS)
RegCloseKey(hKey);
#else
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html"));
if ( !ft )
{
wxLogError(_T("Impossible to determine the file type for extension html. Please edit your MIME types."));
return ;
}
wxString cmd;
bool ok = ft->GetOpenCommand(&cmd,
wxFileType::MessageParameters(url, wxEmptyString));
delete ft;
if (!ok)
{
// TODO: some kind of configuration dialog here.
wxMessageBox(_("Could not determine the command for running the browser."),
wxT("Browsing problem"), wxOK|wxICON_EXCLAMATION);
return ;
}
ok = (wxExecute(cmd, false) != 0);
#endif
}
wxString wxGetTempDir()
{
wxString dir;

View File

@@ -74,9 +74,6 @@ wxFont apStringToFont(const wxString& str);
/// Get the index of the given named wxNotebook page
int apFindNotebookPage(wxNotebook* notebook, const wxString& name);
/// View the given URL
void apViewHTMLFile(const wxString& url);
/// Returns the system temporary directory.
wxString wxGetTempDir();