[NEW] Add backup folder information so user can get back the modified file while crashing.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1244 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-06-04 18:10:27 +00:00
parent e402928e45
commit f210407165
3 changed files with 23 additions and 12 deletions

View File

@ -289,21 +289,25 @@ IDD_PREFERENCE_BACKUP_BOX DIALOGEX 0, 0, 455, 185
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1 FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
GROUPBOX "Session snapshot and periodic backup",IDC_BACKUPDIR_RESTORESESSION_GRP_STATIC,79,1,289,59,BS_CENTER GROUPBOX "Session snapshot and periodic backup",IDC_BACKUPDIR_RESTORESESSION_GRP_STATIC,79,1,289,75,BS_CENTER
CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,10,270,10 CONTROL "Remember current session for next launch",IDC_CHECK_REMEMBERSESSION,
CONTROL "Enable session snapshot and periodic backup",IDC_BACKUPDIR_RESTORESESSION_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,25,270,10 "Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,10,270,10
CONTROL "Enable session snapshot and periodic backup",IDC_BACKUPDIR_RESTORESESSION_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,25,270,10
EDITTEXT IDC_BACKUPDIR_RESTORESESSION_EDIT,164,40,21,14,ES_NUMBER EDITTEXT IDC_BACKUPDIR_RESTORESESSION_EDIT,164,40,21,14,ES_NUMBER
RTEXT "Backup in every",IDD_BACKUPDIR_RESTORESESSION_STATIC1,82,42,78,8 RTEXT "Backup in every",IDD_BACKUPDIR_RESTORESESSION_STATIC1,82,42,78,8
LTEXT "seconds",IDD_BACKUPDIR_RESTORESESSION_STATIC2,190,42,66,8 LTEXT "seconds",IDD_BACKUPDIR_RESTORESESSION_STATIC2,190,42,66,8
GROUPBOX "Backup on save",IDC_BACKUPDIR_GRP_STATIC,79,69,289,110,BS_CENTER GROUPBOX "Backup on save",IDC_BACKUPDIR_GRP_STATIC,79,81,289,101,BS_CENTER
CONTROL "None",IDC_RADIO_BKNONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,104,80,87,10 CONTROL "None",IDC_RADIO_BKNONE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,104,90,87,10
CONTROL "Simple backup",IDC_RADIO_BKSIMPLE,"Button",BS_AUTORADIOBUTTON,104,94,111,10 CONTROL "Simple backup",IDC_RADIO_BKSIMPLE,"Button",BS_AUTORADIOBUTTON,104,104,111,10
CONTROL "Verbose backup",IDC_RADIO_BKVERBOSE,"Button",BS_AUTORADIOBUTTON,104,108,111,10 CONTROL "Verbose backup",IDC_RADIO_BKVERBOSE,"Button",BS_AUTORADIOBUTTON,104,117,111,10
GROUPBOX "Custom Backup Directory",IDC_BLINKRATE_STATIC,95,129,260,40 GROUPBOX "Custom Backup Directory",IDC_BLINKRATE_STATIC,95,135,260,40
CONTROL "",IDC_BACKUPDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,129,8,10 CONTROL "",IDC_BACKUPDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,132,8,10
RTEXT "Directory :",IDD_BACKUPDIR_STATIC,99,146,40,8 RTEXT "Directory :",IDD_BACKUPDIR_STATIC,99,152,40,8
EDITTEXT IDC_BACKUPDIR_EDIT,146,144,179,14,ES_AUTOHSCROLL EDITTEXT IDC_BACKUPDIR_EDIT,146,150,179,14,ES_AUTOHSCROLL
PUSHBUTTON "...",IDD_BACKUPDIR_BROWSE_BUTTON,332,144,16,14 PUSHBUTTON "...",IDD_BACKUPDIR_BROWSE_BUTTON,332,150,16,14
RTEXT "Backup path:",IDD_BACKUPDIR_RESTORESESSION_PATHLABEL_STATIC,85,60,61,8
EDITTEXT IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT,153,58,208,14,ES_AUTOHSCROLL | ES_READONLY
END END
IDD_PREFERENCE_AUTOCOMPLETION_BOX DIALOGEX 0, 0, 455, 185 IDD_PREFERENCE_AUTOCOMPLETION_BOX DIALOGEX 0, 0, 455, 185

View File

@ -2185,6 +2185,9 @@ BOOL CALLBACK BackupDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_RESTORESESSION_CHECK, BM_SETCHECK, snapshotCheck?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_BACKUPDIR_RESTORESESSION_CHECK, BM_SETCHECK, snapshotCheck?BST_CHECKED:BST_UNCHECKED, 0);
int periodicBackupInSec = nppGUI._snapshotBackupTiming/1000; int periodicBackupInSec = nppGUI._snapshotBackupTiming/1000;
::SetDlgItemInt(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, periodicBackupInSec, FALSE); ::SetDlgItemInt(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, periodicBackupInSec, FALSE);
generic_string backupFilePath = NppParameters::getInstance()->getUserPath();
backupFilePath += TEXT("\\backup\\");
::SetDlgItemText(_hSelf, IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT, backupFilePath.c_str());
int ID2CheckBackupOnSave = 0; int ID2CheckBackupOnSave = 0;
@ -2342,6 +2345,8 @@ void BackupDlg::updateBackupGUI()
::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_STATIC1), isSnapshot); ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_STATIC1), isSnapshot);
::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT), isSnapshot); ::EnableWindow(::GetDlgItem(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT), isSnapshot);
::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_STATIC2), isSnapshot); ::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_STATIC2), isSnapshot);
::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_PATHLABEL_STATIC), isSnapshot);
::EnableWindow(::GetDlgItem(_hSelf, IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT), isSnapshot);
bool noBackup = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_BKNONE, BM_GETCHECK, 0, 0); bool noBackup = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_BKNONE, BM_GETCHECK, 0, 0);
bool isEnableGlobableCheck = false; bool isEnableGlobableCheck = false;

View File

@ -290,6 +290,8 @@
#define IDD_BACKUPDIR_RESTORESESSION_STATIC1 (IDD_PREFERENCE_BACKUP_BOX + 19) #define IDD_BACKUPDIR_RESTORESESSION_STATIC1 (IDD_PREFERENCE_BACKUP_BOX + 19)
#define IDC_BACKUPDIR_RESTORESESSION_EDIT (IDD_PREFERENCE_BACKUP_BOX + 20) #define IDC_BACKUPDIR_RESTORESESSION_EDIT (IDD_PREFERENCE_BACKUP_BOX + 20)
#define IDD_BACKUPDIR_RESTORESESSION_STATIC2 (IDD_PREFERENCE_BACKUP_BOX + 21) #define IDD_BACKUPDIR_RESTORESESSION_STATIC2 (IDD_PREFERENCE_BACKUP_BOX + 21)
#define IDD_BACKUPDIR_RESTORESESSION_PATHLABEL_STATIC (IDD_PREFERENCE_BACKUP_BOX + 22)
#define IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT (IDD_PREFERENCE_BACKUP_BOX + 23)
#define IDD_PREFERENCE_AUTOCOMPLETION_BOX 6850 //(IDD_PREFERENCE_BOX + 850) #define IDD_PREFERENCE_AUTOCOMPLETION_BOX 6850 //(IDD_PREFERENCE_BOX + 850)
#define IDD_AUTOCINSERT_GRPSTATIC (IDD_PREFERENCE_AUTOCOMPLETION_BOX + 1) #define IDD_AUTOCINSERT_GRPSTATIC (IDD_PREFERENCE_AUTOCOMPLETION_BOX + 1)