- First commit to gitea
This commit is contained in:
41
application.cpp
Normal file
41
application.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "application.h"
|
||||
|
||||
//#include "model.h"
|
||||
//#include "console.h"
|
||||
|
||||
namespace Application
|
||||
{
|
||||
bool quit {false};
|
||||
char dirty {1};
|
||||
|
||||
const bool& ShouldQuit()
|
||||
{
|
||||
return quit;
|
||||
}
|
||||
|
||||
void Quit()
|
||||
{
|
||||
//if (Model::IsModified()) {
|
||||
// Console::Ask("SAVE BEFORE QUITTING (YES/NO/CANCEL)?", Application::QuitHandler);
|
||||
//} else {
|
||||
quit = true;
|
||||
//}
|
||||
}
|
||||
|
||||
void QuitHandler(const char* reply)
|
||||
{
|
||||
//if (reply[0] == 'Y') {
|
||||
// Model::Save();
|
||||
//} else if (reply[0] == 'N') {
|
||||
// quit = true;
|
||||
//}
|
||||
}
|
||||
|
||||
bool NeedsUpdate(const char cycles)
|
||||
{
|
||||
if (cycles > 0 and cycles > dirty) dirty = cycles;
|
||||
return dirty > 0;
|
||||
}
|
||||
|
||||
void Updated() { if (dirty > 0) dirty--; }
|
||||
}
|
||||
Reference in New Issue
Block a user