From 412b0c54e417edf13898c5c3df4c507159dcd35e Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 10 Apr 2014 23:51:36 +0000 Subject: [PATCH] [NEW_FEATURE] Automatic Backup System (in progress). git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1219 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 3 ++- PowerEditor/src/Parameters.cpp | 13 +++++++++++++ PowerEditor/src/Parameters.h | 1 - 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 0118cf4cc..6e3aac410 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5241,7 +5241,7 @@ struct Quote{ const char *_quote; }; -const int nbQuote = 197; +const int nbQuote = 198; Quote quotes[nbQuote] = { {"Notepad++", "Good programmers use Notepad++ to code.\nExtreme programmers use MS Word to code, in Comic Sans, center aligned."}, {"Martin Golding", "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."}, @@ -5438,6 +5438,7 @@ Quote quotes[nbQuote] = { {"Confucius", "It's good to meet girl in park.\nBut better to park meat in girl."}, {"Mark Twain", "Censorship is telling a man he can't have a steak just because a baby can't chew it."}, {"Friedrich Nietzsche", "There is not enough love and goodness in the world to permit giving any of it away to imaginary beings."}, +{"Dhalsim", "Pain is a state of mind and I don't mind your pain."}, {"Elie Wiesel", "Human beings can be beautiful or more beautiful,\nthey can be fat or skinny, they can be right or wrong,\nbut illegal? How can a human being be illegal?"}, {"Chewbacca", "Uuuuuuuuuur Ahhhhrrrrrr\nUhrrrr Ahhhhrrrrrr\nAaaarhg..."} }; diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 0d7735b8b..fd97c5b5b 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -3859,6 +3859,13 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) const TCHAR *pDir = element->Attribute(TEXT("dir")); if (pDir) _nppGUI._backupDir = pDir; + + const TCHAR *isBackupMode = element->Attribute(TEXT("isBackupMode")); + _nppGUI._isBackupMode = (isBackupMode && !lstrcmp(isBackupMode, TEXT("yes"))); + + int timing; + if (element->Attribute(TEXT("backupTiming"), &timing)) + _nppGUI._backupTiming = timing; } else if (!lstrcmp(nm, TEXT("DockingManager"))) @@ -4711,6 +4718,9 @@ bool NppParameters::writeGUIParams() element->SetAttribute(TEXT("action"), _nppGUI._backup); element->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir?TEXT("yes"):TEXT("no")); element->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str()); + + element->SetAttribute(TEXT("isBackupMode"), _nppGUI._isBackupMode?TEXT("yes"):TEXT("no")); + element->SetAttribute(TEXT("backupTiming"), _nppGUI._backupTiming); backExist = true; } else if (!lstrcmp(nm, TEXT("MRU"))) @@ -4986,6 +4996,9 @@ bool NppParameters::writeGUIParams() GUIConfigElement->SetAttribute(TEXT("action"), _nppGUI._backup); GUIConfigElement->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir?TEXT("yes"):TEXT("no")); GUIConfigElement->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str()); + + GUIConfigElement->SetAttribute(TEXT("isBackupMode"), _nppGUI._isBackupMode?TEXT("yes"):TEXT("no")); + GUIConfigElement->SetAttribute(TEXT("backupTiming"), _nppGUI._backupTiming); } if (!doTaskListExist) diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 34de419c6..df7e1f9c4 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -814,7 +814,6 @@ struct NppGUI generic_string _themeName; MultiInstSetting _multiInstSetting; bool _fileSwitcherWithoutExtColumn; - /* bool isBackupMode() const {return _isBackupMode;}; void setBackupMode(bool doBackup) {_isBackupMode = doBackup;};