-
Notifications
You must be signed in to change notification settings - Fork 29
/
DlgCustomizeIEMenu.cpp
97 lines (79 loc) · 2.89 KB
/
DlgCustomizeIEMenu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "FdmApp.h"
#include "DlgCustomizeIEMenu.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CDlgCustomizeIEMenu::CDlgCustomizeIEMenu(CWnd* pParent )
: CDialog(CDlgCustomizeIEMenu::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCustomizeIEMenu)
//}}AFX_DATA_INIT
}
void CDlgCustomizeIEMenu::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCustomizeIEMenu)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCustomizeIEMenu, CDialog)
//{{AFX_MSG_MAP(CDlgCustomizeIEMenu)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CDlgCustomizeIEMenu::OnOK()
{
BOOL bDLThis = IsDlgButtonChecked (IDC_DLTHIS) == BST_CHECKED;
BOOL bDLPage = IsDlgButtonChecked (IDC_DLPAGE) == BST_CHECKED;
BOOL bDLAll = IsDlgButtonChecked (IDC_DLALL) == BST_CHECKED;
BOOL bDLSelected = IsDlgButtonChecked (IDC_DLSELECTED) == BST_CHECKED;
BOOL bDLVideo = IsDlgButtonChecked (IDC_DLVIDEO) == BST_CHECKED;
if (bDLThis || bDLPage || bDLAll || bDLSelected || bDLVideo)
{
_IECMM.DeleteIEMenus ();
_App.Monitor_IEMenu_DLThis (bDLThis);
_App.Monitor_IEMenu_DLPage (bDLPage);
_App.Monitor_IEMenu_DLAll (bDLAll);
_App.Monitor_IEMenu_DLSelected (bDLSelected);
_App.Monitor_IEMenu_DLFlashVideo (bDLVideo);
_IECMM.AddIEMenus ();
if (m_bDLThisWas != bDLThis || m_bDLPageWas != bDLPage ||
m_bDLAllWas != bDLAll || m_bDLSelectedWas != bDLSelected ||
m_bDLVideoWas != bDLVideo)
MessageBox (LS (L_BROWSERRESTARTREQ));
}
else
{
MessageBox (LS (L_ATLEAST1MENUITEMMUSTBESELECTED), LS (L_INPERR),
MB_ICONEXCLAMATION);
return;
}
CDialog::OnOK();
}
BOOL CDlgCustomizeIEMenu::OnInitDialog()
{
CDialog::OnInitDialog();
CheckDlgButton (IDC_DLTHIS, m_bDLThisWas = _App.Monitor_IEMenu_DLThis () ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton (IDC_DLPAGE, m_bDLPageWas = _App.Monitor_IEMenu_DLPage () ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton (IDC_DLALL, m_bDLAllWas = _App.Monitor_IEMenu_DLAll () ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton (IDC_DLSELECTED, m_bDLSelectedWas = _App.Monitor_IEMenu_DLSelected () ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton (IDC_DLVIDEO, m_bDLVideoWas = _App.Monitor_IEMenu_DLFlashVideo () ? BST_CHECKED : BST_UNCHECKED);
ApplyLanguage ();
return TRUE;
}
void CDlgCustomizeIEMenu::ApplyLanguage()
{
fsDlgLngInfo lnginfo [] = {
fsDlgLngInfo (IDC_DLTHIS, L_DLTHISIEMENU),
fsDlgLngInfo (IDC_DLPAGE, L_DLPAGEIEMENU),
fsDlgLngInfo (IDC_DLALL, L_DLALLIEMENU),
fsDlgLngInfo (IDC_DLSELECTED, L_DLSELECTEDIEMENU),
fsDlgLngInfo (IDC_DLVIDEO, L_DLFLASHVIDEOIEMENU),
fsDlgLngInfo (IDCANCEL, L_CANCEL),
};
_LngMgr.ApplyLanguage (this, lnginfo, sizeof (lnginfo) / sizeof (fsDlgLngInfo), L_CUSTOMIZEIEMENU);
}