Skip to content

Commit c5a41fb

Browse files
authored
Add a "Defaults" button to the "Options (Archive Support)" dialog. (#2362)
1 parent 594a180 commit c5a41fb

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

Src/Merge.rc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,7 @@ BEGIN
20352035
CONTROL "&Enable archive file support",IDC_ARCHIVE_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,6,271,10
20362036
CONTROL "&Detect archive type from file signature",IDC_ARCHIVE_DETECTTYPE,
20372037
"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_GROUP | WS_TABSTOP,7,18,271,10
2038+
PUSHBUTTON "Defaults", IDC_COMPARE_DEFAULTS, 191, 228, 88, 14
20382039
END
20392040

20402041
IDD_PROPPAGE_PROJECT DIALOGEX 0, 0, 285, 242
@@ -2829,7 +2830,8 @@ IDD_PROPPAGE_ARCHIVE AFX_DIALOG_LAYOUT
28292830
BEGIN
28302831
0,
28312832
0, 0, 100, 0,
2832-
0, 0, 100, 0
2833+
0, 0, 100, 0,
2834+
100, 0, 0, 0
28332835
END
28342836

28352837
IDD_PROPPAGE_BACKUPS AFX_DIALOG_LAYOUT

Src/PropArchive.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void PropArchive::DoDataExchange(CDataExchange* pDX)
3636

3737

3838
BEGIN_MESSAGE_MAP(PropArchive, OptionsPanel)
39+
ON_BN_CLICKED(IDC_COMPARE_DEFAULTS, OnDefaults)
3940
ON_BN_CLICKED(IDC_ARCHIVE_ENABLE, OnEnableClicked)
4041
END_MESSAGE_MAP()
4142

@@ -57,6 +58,16 @@ void PropArchive::WriteOptions()
5758
GetOptionsMgr()->SaveOption(OPT_ARCHIVE_PROBETYPE, m_bProbeType);
5859
}
5960

61+
/**
62+
* @brief Sets options to defaults
63+
*/
64+
void PropArchive::OnDefaults()
65+
{
66+
m_bEnableSupport = GetOptionsMgr()->GetDefault<bool>(OPT_ARCHIVE_ENABLE);
67+
m_bProbeType = GetOptionsMgr()->GetDefault<bool>(OPT_ARCHIVE_PROBETYPE);
68+
UpdateData(FALSE);
69+
}
70+
6071
/**
6172
* @brief Called when archive support is enabled or disabled.
6273
*/

Src/PropArchive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class PropArchive : public OptionsPanel
2929
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
3030
void UpdateControls();
3131

32+
afx_msg void OnDefaults();
3233
afx_msg void OnEnableClicked();
3334

3435
DECLARE_MESSAGE_MAP()

0 commit comments

Comments
 (0)