Skip to content

Commit

Permalink
Add a "Defaults" button to the "Options (Backup Files)" dialog. (WinM…
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmprm77 authored Aug 12, 2024
1 parent 99d2607 commit 711a3b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,7 @@ BEGIN
LTEXT "Backup filename:",IDC_STATIC,7,96,269,10
CONTROL "&Append .bak extension",IDC_BACKUP_APPEND_BAK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,108,259,10
CONTROL "A&ppend timestamp",IDC_BACKUP_APPEND_TIME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,120,259,10
PUSHBUTTON "Defaults", IDC_COMPARE_DEFAULTS, 191, 228, 88, 14
END

IDD_CONFIRM_COPY DIALOGEX 0, 0, 285, 115
Expand Down
16 changes: 16 additions & 0 deletions Src/PropBackups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void PropBackups::DoDataExchange(CDataExchange* pDX)


BEGIN_MESSAGE_MAP(PropBackups, OptionsPanel)
ON_BN_CLICKED(IDC_COMPARE_DEFAULTS, OnDefaults)
ON_BN_CLICKED(IDC_BACKUP_BROWSE, OnBnClickedBackupBrowse)
END_MESSAGE_MAP()

Expand Down Expand Up @@ -77,6 +78,21 @@ void PropBackups::WriteOptions()
GetOptionsMgr()->SaveOption(OPT_BACKUP_ADD_TIME, m_bAppendTime);
}

/**
* @brief Sets options to defaults.
*/
void PropBackups::OnDefaults()
{
m_bCreateForFolderCmp = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_FOLDERCMP);
m_bCreateForFileCmp = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_FILECMP);
m_nBackupFolder = GetOptionsMgr()->GetDefault<unsigned>(OPT_BACKUP_LOCATION);
m_sGlobalFolder = GetOptionsMgr()->GetDefault<String>(OPT_BACKUP_GLOBALFOLDER);
m_bAppendBak = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_ADD_BAK);
m_bAppendTime = GetOptionsMgr()->GetDefault<bool>(OPT_BACKUP_ADD_TIME);

UpdateData(FALSE);
}

/**
* @brief Called when user selects Browse-button.
*/
Expand Down
1 change: 1 addition & 0 deletions Src/PropBackups.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class PropBackups : public OptionsPanel

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
afx_msg void OnDefaults();
afx_msg void OnBnClickedBackupBrowse();

DECLARE_MESSAGE_MAP()
Expand Down

0 comments on commit 711a3b8

Please sign in to comment.