[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
|
||||
|
||||
@ -596,6 +596,12 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
// Do nothing
|
||||
}
|
||||
else if (buf->isDirty())
|
||||
{
|
||||
if (isBackupMode)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
activateBuffer(id, MAIN_VIEW);
|
||||
if(!activateBuffer(id, SUB_VIEW))
|
||||
@ -613,6 +619,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < _subDocTab.nbItem(); ++i)
|
||||
{
|
||||
BufferID id = _subDocTab.getBufferByIndex(i);
|
||||
@ -622,6 +629,12 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
// Do nothing
|
||||
}
|
||||
else if (buf->isDirty())
|
||||
{
|
||||
if (isBackupMode)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
activateBuffer(id, SUB_VIEW);
|
||||
switchEditViewTo(SUB_VIEW);
|
||||
@ -639,6 +652,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Then start closing, inactive view first so the active is left open
|
||||
if (bothActive())
|
||||
|
Loading…
Reference in New Issue
Block a user