[NEW_FEATURE] Automatic Backup System (in progress).
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1213 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
026aaf94a4
commit
db0489c8ed
@ -235,7 +235,7 @@ public:
|
||||
};
|
||||
|
||||
bool fileClose(BufferID id = BUFFER_INVALID, int curView = -1); //use curView to override view to close from
|
||||
bool fileCloseAll(bool doDeleteBackup);
|
||||
bool fileCloseAll(bool doDeleteBackup, bool isBackupMode = false);
|
||||
bool fileCloseAllButCurrent();
|
||||
bool fileCloseAllGiven(const std::vector<int> &krvecBufferIndexes);
|
||||
bool fileCloseAllToLeft();
|
||||
|
@ -1407,7 +1407,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
//Causing them to show on restart even though they are loaded by session
|
||||
_lastRecentFileList.setLock(true); //only lock when the session is remembered
|
||||
}
|
||||
bool allClosed = fileCloseAll(false); //try closing files before doing anything else
|
||||
bool allClosed = fileCloseAll(false, true); //try closing files before doing anything else
|
||||
|
||||
if (nppgui._rememberLastSession)
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ void Notepad_plus::command(int id)
|
||||
break;
|
||||
|
||||
case IDM_FILE_CLOSEALL:
|
||||
fileCloseAll(true);
|
||||
fileCloseAll(true, false);
|
||||
checkDocState();
|
||||
break;
|
||||
|
||||
|
@ -582,7 +582,7 @@ bool Notepad_plus::fileClose(BufferID id, int curView)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isBackupMode)
|
||||
{
|
||||
//closes all documents, makes the current view the only one visible
|
||||
|
||||
@ -597,19 +597,26 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
}
|
||||
else if (buf->isDirty())
|
||||
{
|
||||
activateBuffer(id, MAIN_VIEW);
|
||||
if(!activateBuffer(id, SUB_VIEW))
|
||||
switchEditViewTo(MAIN_VIEW);
|
||||
if (isBackupMode)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
activateBuffer(id, MAIN_VIEW);
|
||||
if(!activateBuffer(id, SUB_VIEW))
|
||||
switchEditViewTo(MAIN_VIEW);
|
||||
|
||||
int res = doSaveOrNot(buf->getFullPathName());
|
||||
if (res == IDYES)
|
||||
{
|
||||
if (!fileSave(id))
|
||||
return false; //abort entire procedure
|
||||
}
|
||||
else if (res == IDCANCEL)
|
||||
{
|
||||
return false;
|
||||
int res = doSaveOrNot(buf->getFullPathName());
|
||||
if (res == IDYES)
|
||||
{
|
||||
if (!fileSave(id))
|
||||
return false; //abort entire procedure
|
||||
}
|
||||
else if (res == IDCANCEL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -623,19 +630,26 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
}
|
||||
else if (buf->isDirty())
|
||||
{
|
||||
activateBuffer(id, SUB_VIEW);
|
||||
switchEditViewTo(SUB_VIEW);
|
||||
|
||||
int res = doSaveOrNot(buf->getFullPathName());
|
||||
if (res == IDYES)
|
||||
if (isBackupMode)
|
||||
{
|
||||
if (!fileSave(id))
|
||||
return false; //abort entire procedure
|
||||
|
||||
}
|
||||
else if (res == IDCANCEL)
|
||||
else
|
||||
{
|
||||
return false;
|
||||
//otherwise continue (IDNO)
|
||||
activateBuffer(id, SUB_VIEW);
|
||||
switchEditViewTo(SUB_VIEW);
|
||||
|
||||
int res = doSaveOrNot(buf->getFullPathName());
|
||||
if (res == IDYES)
|
||||
{
|
||||
if (!fileSave(id))
|
||||
return false; //abort entire procedure
|
||||
}
|
||||
else if (res == IDCANCEL)
|
||||
{
|
||||
return false;
|
||||
//otherwise continue (IDNO)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user