merging from SMARTUPDATE_BRANCH

This commit is contained in:
dveditz 1998-06-07 10:38:53 +00:00
parent aaae76e5aa
commit 0fd64b60c2
10 changed files with 563 additions and 25 deletions

View File

@ -33,6 +33,10 @@ DEFINE_GUID(IID_IBrowserPrefs,
DEFINE_GUID(IID_IEnumHelpers,
0xfee0f8a0, 0xf7dc, 0x11d0, 0xb0, 0x99, 0x00, 0x80, 0x5f, 0x8a, 0x1d, 0xb7);
// {55BA2BC1-EA7C-11d1-826D-00805F2AB103}
DEFINE_GUID(IID_IAdvancedPrefs,
0x55ba2bc1, 0xea7c, 0x11d1, 0x82, 0x6d, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
/* 0bd1d720-f7dd-11d0-b099-00805f8a1db7 */
DEFINE_GUID(CLSID_AppearancePrefs,
0x0bd1d720, 0xf7dd, 0x11d0, 0xb0, 0x99, 0x00, 0x80, 0x5f, 0x8a, 0x1d, 0xb7);
@ -45,6 +49,18 @@ DEFINE_GUID(CLSID_BrowserPrefs,
DEFINE_GUID(CLSID_AdvancedPrefs,
0x2221ca00, 0xf7dd, 0x11d0, 0xb0, 0x99, 0x00, 0x80, 0x5f, 0x8a, 0x1d, 0xb7);
#ifdef MOZ_SMARTUPDATE
// {56073CA0-DFAD-11d1-826B-00805F2AB103}
DEFINE_GUID(IID_ISmartUpdatePrefs,
0x56073ca0, 0xdfad, 0x11d1, 0x82, 0x6b, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
// {577AB0B0-DFAE-11d1-826B-00805F2AB103}
DEFINE_GUID(CLSID_SmartUpdatePrefs,
0x577ab0b0, 0xdfae, 0x11d1, 0x82, 0x6b, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
#endif /* MOZ_SMARTUPDATE */
#else /* MOZ_COMMUNICATOR_IIDS */
// {C98D0190-7D81-11d0-BF8D-00A02468FAB6}
@ -59,6 +75,11 @@ DEFINE_GUID(IID_IBrowserPrefs,
DEFINE_GUID(IID_IEnumHelpers,
0x913a4a20, 0x8ebf, 0x11d0, 0xbf, 0xab, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6);
// {6C708031-EA7C-11d1-826D-00805F2AB103}
DEFINE_GUID(IID_IAdvancedPrefs,
0x6c708031, 0xea7c, 0x11d1, 0x82, 0x6d, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
// {7865A9A1-33A8-11d0-BED9-00A02468FAB6}
DEFINE_GUID(CLSID_AppearancePrefs,
0x7865a9a1, 0x33a8, 0x11d0, 0xbe, 0xd9, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6);
@ -71,6 +92,18 @@ DEFINE_GUID(CLSID_BrowserPrefs,
DEFINE_GUID(CLSID_AdvancedPrefs,
0x543ec0d1, 0x6ab7, 0x11d0, 0xbf, 0x56, 0x0, 0xa0, 0x24, 0x68, 0xfa, 0xb6);
#ifdef MOZ_SMARTUPDATE
// {40B18000-DFAA-11d1-826B-00805F2AB103}
DEFINE_GUID(IID_ISmartUpdatePrefs,
0x40b18000, 0xdfaa, 0x11d1, 0x82, 0x6b, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
// {744C3DF0-DFAE-11d1-826B-00805F2AB103}
DEFINE_GUID(CLSID_SmartUpdatePrefs,
0x744c3df0, 0xdfae, 0x11d1, 0x82, 0x6b, 0x0, 0x80, 0x5f, 0x2a, 0xb1, 0x3);
#endif /* MOZ_SMARTUPDATE */
#endif /* MOZ_COMMUNICATOR_IIDS */
#endif /* __BRPREFID_H_ */

View File

@ -92,5 +92,68 @@ DECLARE_INTERFACE_(IBrowserPrefs, IUnknown)
STDMETHOD(RemoveFileType)(THIS_ NET_cdataStruct *) PURE;
};
/////////////////////////////////////////////////////////////////////////////
// IAdvancedPrefs interface
#ifdef __cplusplus
interface IAdvancedPrefs;
#else
typedef interface IAdvancedPrefs IAdvancedPrefs;
#endif
typedef IAdvancedPrefs FAR* LPADVANCEDPREFS;
#undef INTERFACE
#define INTERFACE IAdvancedPrefs
DECLARE_INTERFACE_(IAdvancedPrefs, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
};
#ifdef MOZ_SMARTUPDATE
/////////////////////////////////////////////////////////////////////////////
// ISmartUpdatePrefs interface
#ifdef __cplusplus
interface ISmartUpdatePrefs;
#else
typedef interface ISmartUpdatePrefs ISmartUpdatePrefs;
#endif
typedef ISmartUpdatePrefs FAR* LPSMARTUPDATEPREFS;
#undef INTERFACE
#define INTERFACE ISmartUpdatePrefs
typedef struct _PACKAGEINFO {
char userPackageName[MAX_PATH];
char regPackageName[MAX_PATH];
} PACKAGEINFO, FAR *LPPACKAGEINFO;
// IBrowserPrefs provides the preference UI code with a way to get at
// various state maintained by the Navigator
DECLARE_INTERFACE_(ISmartUpdatePrefs, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
// IBrowserPrefs methods
STDMETHOD_(LONG,RegPack)(THIS) PURE;
STDMETHOD_(LONG,Uninstall)(THIS_ char* regPackageName) PURE;
STDMETHOD_(LONG,EnumUninstall)(THIS_ void** context, char* packageName,
LONG len1, char*regPackageName, LONG len2) PURE;
};
#endif /* MOZ_SMARTUPDATE */
#endif /* __IBRPREFS_H_ */

View File

@ -25,6 +25,10 @@
#include "xp_help.h"
#include "net.h"
#include "prefapi.h"
#include "brprefid.h"
#ifdef MOZ_SMARTUPDATE
#include "VerReg.h"
#endif /* MOZ_SMARTUPDATE */
#ifdef _WIN32
#include <shlobj.h>
#endif
@ -64,7 +68,6 @@ CAdvancedPrefs::InitDialog()
CheckIfLockedPref("security.enable_java", IDC_CHECK2);
CheckIfLockedPref("javascript.enabled", IDC_CHECK3);
CheckIfLockedPref("browser.enable_style_sheets", IDC_CHECK4);
CheckIfLockedPref("autoupdate.enabled", IDC_CHECK5);
CheckIfLockedPref("security.email_as_ftp_password", IDC_CHECK6);
if (PREF_PrefIsLocked("network.cookie.cookieBehavior")) {
@ -86,7 +89,6 @@ CAdvancedPrefs::Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal)
PREF_GetBoolPref("security.enable_java", &m_bEnableJava);
PREF_GetBoolPref("javascript.enabled", &m_bEnableJavaScript);
PREF_GetBoolPref("browser.enable_style_sheets", &m_bEnableStyleSheets);
PREF_GetBoolPref("autoupdate.enabled", &m_bEnableAutoInstall);
PREF_GetBoolPref("security.email_as_ftp_password", &m_bSendEmailAddressForFTPPassword);
int32 n;
@ -107,7 +109,6 @@ CAdvancedPrefs::DoTransfer(BOOL bSaveAndValidate)
CheckBoxTransfer(IDC_CHECK2, m_bEnableJava, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK3, m_bEnableJavaScript, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK4, m_bEnableStyleSheets, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK5, m_bEnableAutoInstall, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK6, m_bSendEmailAddressForFTPPassword, bSaveAndValidate);
RadioButtonTransfer(IDC_RADIO1, m_nCookieAcceptance, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK7, m_bWarnAboutCookies, bSaveAndValidate);
@ -122,7 +123,6 @@ CAdvancedPrefs::ApplyChanges()
PREF_SetBoolPref("security.enable_java", m_bEnableJava);
PREF_SetBoolPref("javascript.enabled", m_bEnableJavaScript);
PREF_SetBoolPref("browser.enable_style_sheets", m_bEnableStyleSheets);
PREF_SetBoolPref("autoupdate.enabled", m_bEnableAutoInstall);
PREF_SetBoolPref("security.email_as_ftp_password", m_bSendEmailAddressForFTPPassword);
PREF_SetIntPref("network.cookie.cookieBehavior", (int32)m_nCookieAcceptance);
PREF_SetBoolPref("network.cookie.warnAboutCookies", m_bWarnAboutCookies);
@ -785,3 +785,204 @@ CDiskSpacePrefs::OnCommand(int id, HWND hwndCtl, UINT notifyCode)
}
return CBrowserPropertyPage::OnCommand(id, hwndCtl, notifyCode);
}
#ifdef MOZ_SMARTUPDATE
/////////////////////////////////////////////////////////////////////////////
// CSmartUpdatePrefs implementation
CSmartUpdatePrefs::CSmartUpdatePrefs()
: CBrowserPropertyPage(IDD_SMARTUPDATE, HELP_PREFS_ADVANCED_SMARTUPDATE)
{
}
// Initialize member data using XP preferences
STDMETHODIMP
CSmartUpdatePrefs::Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal)
{
if (!m_bHasBeenActivated) {
PREF_GetBoolPref("autoupdate.enabled", &m_bEnableAutoInstall);
PREF_GetBoolPref("autoupdate.confirm_install", &m_bEnableConfirmInstall);
}
return CBrowserPropertyPage::Activate(hwndParent, lprc, bModal);
}
BOOL
CSmartUpdatePrefs::DoTransfer(BOOL bSaveAndValidate)
{
CheckBoxTransfer(IDC_CHECK1, m_bEnableAutoInstall, bSaveAndValidate);
CheckBoxTransfer(IDC_CHECK2, m_bEnableConfirmInstall, bSaveAndValidate);
return TRUE;
}
// Apply changes using XP preferences
BOOL
CSmartUpdatePrefs::ApplyChanges()
{
PREF_SetBoolPref("autoupdate.enabled", m_bEnableAutoInstall);
PREF_SetBoolPref("autoupdate.confirm_install", m_bEnableConfirmInstall);
return TRUE;
}
BOOL
CSmartUpdatePrefs::InitDialog()
{
// Check for locked preferences
CheckIfLockedPref("autoupdate.enabled", IDC_CHECK1);
CheckIfLockedPref("autoupdate.confirm_install", IDC_CHECK2);
HWND hList = GetDlgItem(m_hwndDlg, IDC_LIST1);
int nIndex;
// Fill the list box with the list of helper applications
assert(m_pObject);
if (m_pObject) {
LPADVANCEDPREFS lpAdvancedPrefs;
if (SUCCEEDED(m_pObject->QueryInterface(IID_IAdvancedPrefs, (void **)&lpAdvancedPrefs))) {
LPSMARTUPDATEPREFS lpSmartUpdatePrefs;
// Request the ISmartUpdatePrefs interface from our data object
if (SUCCEEDED(lpAdvancedPrefs->QueryInterface(IID_ISmartUpdatePrefs, (void **)&lpSmartUpdatePrefs))) {
LONG err;
void* context = NULL;
LPPACKAGEINFO packageInfo = new PACKAGEINFO;
LPPACKAGEINFO pInfo;
*(packageInfo->userPackageName) = '\0';
*(packageInfo->regPackageName) = '\0';
if (packageInfo != NULL) {
err = lpSmartUpdatePrefs->EnumUninstall(&context, packageInfo->userPackageName, sizeof(packageInfo->userPackageName),
packageInfo->regPackageName, sizeof(packageInfo->regPackageName));
while (err == REGERR_OK) {
if (*(packageInfo->regPackageName) != '\0' &&
strcmp(packageInfo->regPackageName, UNINSTALL_NAV_STR) !=0 )
{
pInfo = new PACKAGEINFO;
if (*(packageInfo->userPackageName) != '\0') {
lstrcpy(pInfo->userPackageName, packageInfo->userPackageName);
} else {
lstrcpy(pInfo->userPackageName, packageInfo->regPackageName);
}
lstrcpy(pInfo->regPackageName, packageInfo->regPackageName);
nIndex = ListBox_AddString(hList, pInfo->userPackageName);
int lvalue;
lvalue = ListBox_SetItemData(hList, nIndex, pInfo);
if (lvalue == LB_ERR) {
delete pInfo;
}
}
*(packageInfo->regPackageName) = '\0';
*(packageInfo->userPackageName) = '\0';
err = lpSmartUpdatePrefs->EnumUninstall(&context, packageInfo->userPackageName, sizeof(packageInfo->userPackageName),
packageInfo->regPackageName, sizeof(packageInfo->regPackageName));
}
}
lpSmartUpdatePrefs->Release();
}
}
}
// Select the first item in the list
ListBox_SetCurSel(hList, 0);
return CBrowserPropertyPage::InitDialog();
}
BOOL
CSmartUpdatePrefs::OnCommand(int id, HWND hwndCtl, UINT notifyCode)
{
if (id == IDC_BUTTON1 && notifyCode == BN_CLICKED) {
assert(m_pObject);
if (m_pObject) {
LPADVANCEDPREFS lpAdvancedPrefs;
if (SUCCEEDED(m_pObject->QueryInterface(IID_IAdvancedPrefs, (void **)&lpAdvancedPrefs))) {
LPSMARTUPDATEPREFS lpSmartUpdatePrefs;
if (SUCCEEDED(lpAdvancedPrefs->QueryInterface(IID_ISmartUpdatePrefs, (void **)&lpSmartUpdatePrefs))) {
lpSmartUpdatePrefs->RegPack();
lpSmartUpdatePrefs->Release();
}
}
}
return TRUE;
} else if (id == IDC_BUTTON2 && notifyCode == BN_CLICKED) {
LPPACKAGEINFO packageInfo = NULL;
HWND hList = GetDlgItem(m_hwndDlg, IDC_LIST1);
int nIndex = 0;
int count = 0;
int err;
char szCaption[256];
char szMessage[256];
LPSTR lpszText;
// Get the currently selected item
nIndex = ListBox_GetCurSel(hList);
if (nIndex != LB_ERR) {
// Get the packageInfo data structure
packageInfo = (LPPACKAGEINFO)ListBox_GetItemData(hList, nIndex);
if (packageInfo != NULL) {
if (*(packageInfo->regPackageName) != '\0') {
// Load the caption for the message box and message string
LoadString(m_hInstance, IDS_CONTINUE_UNINSTALL, szMessage, sizeof(szMessage));
LoadString(m_hInstance, IDS_UNINSTALL, szCaption, sizeof(szCaption));
// Format the text
lpszText = (LPSTR)CoTaskMemAlloc(lstrlen(szMessage) + sizeof(packageInfo->userPackageName));
wsprintf(lpszText, szMessage, (LPCSTR)(packageInfo->userPackageName));
if (MessageBox(GetParent(m_hwndDlg), (LPCSTR)lpszText, (LPCSTR)szCaption,
MB_YESNO | MB_ICONQUESTION) == IDYES) {
CoTaskMemFree(lpszText);
assert(m_pObject);
if (m_pObject) {
LPADVANCEDPREFS lpAdvancedPrefs;
if (SUCCEEDED(m_pObject->QueryInterface(IID_IAdvancedPrefs, (void **)&lpAdvancedPrefs))) {
LPSMARTUPDATEPREFS lpSmartUpdatePrefs;
if (SUCCEEDED(lpAdvancedPrefs->QueryInterface(IID_ISmartUpdatePrefs, (void **)&lpSmartUpdatePrefs))) {
err = lpSmartUpdatePrefs->Uninstall(packageInfo->regPackageName);
if (err == REGERR_OK) {
count = ListBox_GetCount(hList);
ListBox_DeleteString(hList, nIndex);
delete packageInfo;
if ((count == LB_ERR) || (nIndex == 0))
ListBox_SetCurSel(hList, 0);
else if (nIndex < count-1)
ListBox_SetCurSel(hList, nIndex);
else
ListBox_SetCurSel(hList, nIndex-1);
} else {
LoadString(m_hInstance, IDS_UNINSTALL, szCaption, sizeof(szCaption));
LoadString(m_hInstance, IDS_ERROR_UNINSTALL, szMessage, sizeof(szMessage));
MessageBox(GetParent(m_hwndDlg), (LPCSTR)szMessage, (LPCSTR)szCaption, MB_OK );
}
lpSmartUpdatePrefs->Release();
}
}
}
}
}
}
}
return TRUE;
}
return CBrowserPropertyPage::OnCommand(id, hwndCtl, notifyCode);
}
#endif /* MOZ_SMARTUPDATE */

View File

@ -354,20 +354,27 @@ CAdvancedCategory::CSpecifyAdvancedPageObjects::GetPageObjects(CAPPAGE *pPages)
if (!pPages)
return ResultFromScode(E_POINTER);
#ifdef MOZ_MAIL_NEWS
pPages->cElems = 4;
#else
pPages->cElems = 3;
#ifdef MOZ_SMARTUPDATE
pPages->cElems++;
#endif /* MOZ_SMARTUPDATE */
#ifdef MOZ_MAIL_NEWS
pPages->cElems++;
#endif /* MOZ_MAIL_NEWS */
pPages->pElems = (LPPROPERTYPAGE *)CoTaskMemAlloc(pPages->cElems * sizeof(LPPROPERTYPAGE));
if (!pPages->pElems)
return ResultFromScode(E_OUTOFMEMORY);
pPages->pElems[0] = new CAdvancedPrefs;
pPages->pElems[1] = new CCachePrefs;
pPages->pElems[2] = new CProxiesPrefs;
ULONG j = 0;
pPages->pElems[j++] = new CAdvancedPrefs;
pPages->pElems[j++] = new CCachePrefs;
pPages->pElems[j++] = new CProxiesPrefs;
#ifdef MOZ_SMARTUPDATE
pPages->pElems[j++] = new CSmartUpdatePrefs;
#endif /* MOZ_SMARTUPDATE */
#ifdef MOZ_MAIL_NEWS
pPages->pElems[3] = new CDiskSpacePrefs;
pPages->pElems[j++] = new CDiskSpacePrefs;
#endif /* MOZ_MAIL_NEWS */
for (ULONG i = 0; i < pPages->cElems; i++)
@ -502,8 +509,10 @@ CGeneralPrefsDll::GetClassObject(REFCLSID rClsid, REFIID riid, LPVOID *ppObj)
// See if we have that particular class object.
if (rClsid == CLSID_AppearancePrefs ||
rClsid == CLSID_BrowserPrefs ||
#ifdef MOZ_SMARTUPDATE
rClsid == CLSID_SmartUpdatePrefs ||
#endif /* MOZ_SMARTUPDATE */
rClsid == CLSID_AdvancedPrefs) {
// Create a class object
CPropertyPageFactory *pFactory = new CPropertyPageFactory(rClsid);
@ -528,13 +537,22 @@ CGeneralPrefsDll::GetClassObject(REFCLSID rClsid, REFIID riid, LPVOID *ppObj)
const CLSID **
CGeneralPrefsDll::GetCLSIDs()
{
#ifndef MOZ_SMARTUPDATE
const CLSID **ppRetval = (const CLSID **)CoTaskMemAlloc(sizeof(CLSID *) * 4);
#else
const CLSID **ppRetval = (const CLSID **)CoTaskMemAlloc(sizeof(CLSID *) * 5);
#endif /* MOZ_SMARTUPDATE */
if (ppRetval) {
ppRetval[0] = &CLSID_AppearancePrefs;
ppRetval[1] = &CLSID_BrowserPrefs;
ppRetval[2] = &CLSID_AdvancedPrefs;
#ifndef MOZ_SMARTUPDATE
ppRetval[3] = NULL;
#else
ppRetval[3] = &CLSID_SmartUpdatePrefs;
ppRetval[4] = NULL;
#endif /* MOZ_SMARTUPDATE */
}
return ppRetval;

View File

@ -145,7 +145,7 @@ IDD_ADVANCED DIALOG DISCARDABLE 0, 0, 256, 190
STYLE WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "",-1,7,7,242,93,WS_GROUP
GROUPBOX "",-1,7,7,242,81,WS_GROUP
CONTROL "Automatically load &images",IDC_CHECK1,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,18,97,10
CONTROL "Enable &Java",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
@ -154,20 +154,18 @@ BEGIN
WS_TABSTOP,17,44,73,10
CONTROL "Enable &style sheets",IDC_CHECK4,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,57,147,10
CONTROL "Enable Au&toInstall",IDC_CHECK5,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,70,73,10
CONTROL "Send &email address as anonymous FTP password",
IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,83,
IDC_CHECK6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,71,
172,10
GROUPBOX "Cookies",-1,7,108,242,72
GROUPBOX "Cookies",-1,7,98,242,80
CONTROL "&Accept all cookies",IDC_RADIO1,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,17,119,74,10
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,17,117,74,10
CONTROL "Accept &only cookies that get sent back to the originating server",
IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,17,132,215,10
IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,17,130,215,10
CONTROL "&Disable cookies",IDC_RADIO3,"Button",
BS_AUTORADIOBUTTON,17,145,66,10
BS_AUTORADIOBUTTON,17,143,66,10
CONTROL "&Warn me before accepting a cookie",IDC_CHECK7,"Button",
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,18,163,139,10
BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,18,161,139,10
END
IDD_CACHE DIALOG DISCARDABLE 0, 0, 256, 190
@ -433,6 +431,28 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,159,101,50,14
END
#ifdef MOZ_SMARTUPDATE
IDD_SMARTUPDATE DIALOG DISCARDABLE 0, 0, 256, 212
STYLE WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Compress Client Registry",IDC_BUTTON1,7,55,122,14
PUSHBUTTON "Uninstall",IDC_BUTTON2,189,96,50,14
GROUPBOX "",IDC_STATIC,7,7,242,40
CONTROL "Enable SmartUpdate",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,17,17,226,10
CONTROL "Require manual confirmation of each install",IDC_CHECK2,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,30,225,10
GROUPBOX "",IDC_STATIC,7,72,242,127
LISTBOX IDC_LIST1,15,95,169,99,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
LTEXT "To uninstall, select from the following list and click the Uninstall button.",
IDC_STATIC,13,83,230,10
END
#endif /* MOZ_SMARTUPDATE */
IDD_SMARTBROWSING DIALOG DISCARDABLE 0, 0, 256, 211
STYLE WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Sans Serif"
@ -447,6 +467,8 @@ BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
@ -575,6 +597,16 @@ BEGIN
BOTTOMMARGIN, 119
END
#ifdef MOZ_SMARTUPDATE
IDD_SMARTUPDATE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 249
TOPMARGIN, 7
BOTTOMMARGIN, 205
END
#endif /* MOZ_SMARTUPDATE */
IDD_SMARTBROWSING, DIALOG
BEGIN
LEFTMARGIN, 7
@ -764,6 +796,17 @@ BEGIN
IDD_SMARTBROWSING "Smart Browsing\nConfigure browsing aids"
END
#ifdef MOZ_SMARTUPDATE
STRINGTABLE DISCARDABLE
BEGIN
IDD_SMARTUPDATE "SmartUpdate\nEnable and uninstall SmartUpdates"
IDS_CONTINUE_UNINSTALL "Are you sure you want to uninstall ""%s"" ?"
IDS_UNINSTALL "Uninstall"
IDS_ERROR_UNINSTALL "Error in uninstall."
END
#endif /* MOZ_SMARTUPDATE */
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -50,7 +50,7 @@ LLIBS = $(LLIBS) $(LLIBS16)
MODULE=winprefs
DEPTH=..\..\..\..\..
REQUIRES=dllcom winprefs pref dbm nspr js
REQUIRES=dllcom winprefs pref dbm nspr js libreg
CPPSRCS=brpref.cpp pages.cpp brpages.cpp appages.cpp advpages.cpp
CPP_OBJS=.\$(OBJDIR)\brpref.obj .\$(OBJDIR)\pages.obj \
.\$(OBJDIR)\brpages.obj .\$(OBJDIR)\appages.obj \
@ -58,7 +58,8 @@ CPP_OBJS=.\$(OBJDIR)\brpref.obj .\$(OBJDIR)\pages.obj \
!if "$(MOZ_BITS)" != "16"
LINCS=-I$(XPDIST)\public\dllcom -I$(XPDIST)\public\winprefs \
-I$(XPDIST)\public\pref -I$(XPDIST)\public\dbm \
-I$(XPDIST)\public\nspr -I$(XPDIST)\public\js
-I$(XPDIST)\public\nspr -I$(XPDIST)\public\js \
-I$(XPDIST)\public\libreg
!endif
!include "$(DEPTH)\config\rules.mak"

View File

@ -277,7 +277,6 @@ class CAdvancedPrefs : public CBrowserPropertyPage {
BOOL m_bEnableJavaScript;
BOOL m_bEnableStyleSheets;
BOOL m_bSendEmailAddressForFTPPassword;
BOOL m_bEnableAutoInstall;
int m_nCookieAcceptance;
BOOL m_bWarnAboutCookies;
};
@ -362,5 +361,30 @@ class CDiskSpacePrefs : public CBrowserPropertyPage {
int m_nRemoveDays;
};
#ifdef MOZ_SMARTUPDATE
/////////////////////////////////////////////////////////////////////////////
// CSmartUpdatePrefs
class CSmartUpdatePrefs : public CBrowserPropertyPage {
public:
CSmartUpdatePrefs();
protected:
STDMETHODIMP Activate(HWND hwndParent, LPCRECT lprc, BOOL bModal);
BOOL DoTransfer(BOOL bSaveAndValidate);
BOOL ApplyChanges();
BOOL InitDialog();
// Event Processing
BOOL OnCommand(int id, HWND hwndCtl, UINT notifyCode);
private:
BOOL m_bEnableAutoInstall;
BOOL m_bEnableConfirmInstall;
};
#endif /* MOZ_SMARTUPDATE */
#endif /* __PAGES_H_ */

View File

@ -124,7 +124,13 @@
#define IDS_DISK_SPACE 140
#define IDS_NUMERIC_ONLY 141
#define IDS_MORE_DISK_SPACE 142
#define IDD_SMARTBROWSING 143
#ifdef MOZ_SMARTUPDATE
#define IDD_SMARTUPDATE 143
#define IDS_CONTINUE_UNINSTALL 144
#define IDS_UNINSTALL 145
#define IDS_ERROR_UNINSTALL 146
#endif /* MOZ_SMARTUPDATE */
#define IDD_SMARTBROWSING 147
#define IDC_EXTENSION 309
#define IDC_ICON1 316
#define IDC_ICON2 317

101
cmd/winfe/winprog.cpp Normal file
View File

@ -0,0 +1,101 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
Windows progress functions
*/
#include "stdafx.h"
#include "winprog.h"
BOOL CXPProgressDialog::OnInitDialog( )
{
m_ProgressMeter.SubclassDlgItem( IDC_PROGRESSMETER, this );
return CDialog::OnInitDialog();
}
BEGIN_MESSAGE_MAP(CXPProgressDialog, CDialog)
ON_WM_CREATE()
END_MESSAGE_MAP()
CXPProgressDialog::CXPProgressDialog(CWnd* pParent /*=NULL*/)
: CDialog(IDD_XPPROGRESS, pParent)
{
m_Min =0;
m_Max =100;
m_Range = 100;
m_cancelCallback = NULL;
m_cancelClosure = NULL;
}
void CXPProgressDialog::SetCancelCallback(PW_CancelCallback cb, void*closure)
{
m_cancelCallback= cb;
m_cancelClosure =closure;
}
int CXPProgressDialog::SetRange(int32 min,int32 max)
{
m_Min = min;
m_Max = max;
m_Range = max-min;
return TRUE;
}
BOOL CXPProgressDialog::PreTranslateMessage( MSG* pMsg )
{
return CDialog::PreTranslateMessage(pMsg);
}
int CXPProgressDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
int res = CDialog::OnCreate(lpCreateStruct);
return res;
}
void CXPProgressDialog::OnCancel()
{
if (m_cancelCallback)
m_cancelCallback(m_cancelClosure);
DestroyWindow();
}
void CXPProgressDialog::DoDataExchange(CDataExchange *pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_PERCENTCOMPLETE, m_PercentComplete);
}
void CXPProgressDialog::SetProgressValue(int32 value)
{
if (m_Range > 0) {
int iPer = min(100,abs((int)(value*100/m_Range)));
m_ProgressMeter.StepItTo(iPer);
}
}
CWnd *FE_GetDialogOwnerFromContext(MWContext *context)
{
if (!context || !ABSTRACTCX(context) )
return NULL;
return ABSTRACTCX(context)->GetDialogOwner();
}

48
cmd/winfe/winprog.h Normal file
View File

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "widgetry.h"
#include "pw_public.h"
class CXPProgressDialog: public CDialog
{
public:
CXPProgressDialog(CWnd *pParent =NULL);
void SetCancelCallback(PW_CancelCallback cb, void*closure);
void SetProgressValue(int32 value);
int SetRange(int32 min,int32 max);
virtual BOOL OnInitDialog( );
BOOL PreTranslateMessage( MSG* pMsg );
CProgressMeter m_ProgressMeter;
CStatic m_PercentComplete;
int32 m_Min;
int32 m_Max;
int32 m_Range;
PW_CancelCallback m_cancelCallback;
void * m_cancelClosure;
protected:
virtual void OnCancel();
virtual void DoDataExchange(CDataExchange*);
afx_msg int OnCreate( LPCREATESTRUCT );
DECLARE_MESSAGE_MAP()
};
extern CWnd *FE_GetDialogOwnerFromContext(MWContext *context);