Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "Defaults" button to the "Options (Backup Files)" dialog. #2406

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading