зеркало из https://github.com/mozilla/pjs.git
r=jeffreyj, sr=blizzard (platform specific code), a=asa OS/2 only - save mime types in INI file so we don't keep popping up box
This commit is contained in:
Родитель
09c839447b
Коммит
05e172e6f4
|
@ -227,7 +227,7 @@ BOOL CPlugin::init(HWND hWndParent)
|
|||
WinShowWindow(m_hWnd, TRUE);
|
||||
}
|
||||
|
||||
// if(IsNewMimeType((PSZ)m_pNPMIMEType) || m_bHidden)
|
||||
if(IsNewMimeType((PSZ)m_pNPMIMEType) || m_bHidden)
|
||||
showGetPluginDialog();
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -111,14 +111,11 @@ public:
|
|||
#define DEFAULT_PLUGINFINDER_URL "http://plugins.netscape.com/plug-in_finder.adp"
|
||||
#define JVM_SMARTUPDATE_URL "http://home.netscape.com/plugins/jvm.html"
|
||||
|
||||
#ifdef WIN32
|
||||
#define REGISTRY_PLACE "Software\\Netscape\\Netscape Navigator\\Default Plugin"
|
||||
#else
|
||||
#define OS2INI_PLACE "Mozilla Default Plugin"
|
||||
#define GWL_USERDATA 0
|
||||
#define COLOR_3DSHADOW COLOR_BTNFACE
|
||||
#define COLOR_3DLIGHT COLOR_BTNHIGHLIGHT
|
||||
#define COLOR_3DDKSHADOW COLOR_BTNSHADOW
|
||||
#endif
|
||||
|
||||
#define CLASS_NULL_PLUGIN "NullPluginClass"
|
||||
|
||||
|
|
|
@ -36,44 +36,29 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define INCL_GPI
|
||||
#define INCL_WIN
|
||||
#include <os2.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
#ifdef OLDCODE
|
||||
// open the registry, create if necessary
|
||||
HKEY openRegistry()
|
||||
{
|
||||
HKEY phkResult;
|
||||
|
||||
if(RegCreateKey(HKEY_CURRENT_USER, REGISTRY_PLACE, &phkResult) != ERROR_SUCCESS)
|
||||
MessageBox(0, "Error creating Default Plugin registry key", "Default Plugin", MB_OK);
|
||||
|
||||
return phkResult;
|
||||
}
|
||||
|
||||
// return TRUE if we've never seen this MIME type before
|
||||
BOOL IsNewMimeType(PSZ mime)
|
||||
{
|
||||
HKEY hkey = openRegistry();
|
||||
DWORD dwType, keysize = 512;
|
||||
ULONG keysize = 512;
|
||||
char keybuf[512];
|
||||
|
||||
if(RegQueryValueEx(hkey, mime, 0, &dwType, (LPBYTE) &keybuf, &keysize) == ERROR_SUCCESS)
|
||||
{
|
||||
// key exists, must have already been here...
|
||||
PrfQueryProfileString(HINI_USERPROFILE, OS2INI_PLACE, mime, "", keybuf, keysize);
|
||||
if (keybuf[0] != '\0') {
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RegSetValueEx(hkey, mime, 0, REG_SZ, (LPBYTE) "(none)", 7) != ERROR_SUCCESS)
|
||||
MessageBox(0, "Error adding MIME type value", "Default Plugin", MB_OK);
|
||||
|
||||
if (!(PrfWriteProfileString(HINI_USERPROFILE, OS2INI_PLACE, mime, "(none)")))
|
||||
WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, "Error adding MIME type value", "Default Plugin", 0, MB_OK);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// string length in pixels for the specific window (selected font)
|
||||
static int getWindowStringLength(HWND hWnd, PSZ lpsz)
|
||||
|
|
|
@ -38,10 +38,7 @@
|
|||
#ifndef __UTILS_H__
|
||||
#define __UTILS_H__
|
||||
|
||||
#ifdef OLDCODE
|
||||
HKEY openRegistry();
|
||||
BOOL IsNewMimeType(PSZ szMimeType);
|
||||
#endif
|
||||
void SetDlgItemTextWrapped(HWND hWnd, int iID, PSZ szText);
|
||||
|
||||
#endif // __UTILS_H__
|
||||
|
|
Загрузка…
Ссылка в новой задаче