[DEBUG #2 #7] close file and save it whan needed

This commit is contained in:
2014-09-15 07:21:22 +02:00
parent 0a054c209f
commit 05ac6a9210
13 changed files with 144 additions and 80 deletions

View File

@@ -25,8 +25,11 @@ appl::WorkerCloseFile::WorkerCloseFile() :
m_bufferManager = appl::BufferManager::create();
}
void appl::WorkerCloseFile::init(const std::string& _bufferName) {
void appl::WorkerCloseFile::init() {
ewol::object::Worker::init();
}
void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
m_bufferName = _bufferName;
if (m_bufferManager == nullptr) {
APPL_ERROR("can not call unexistant buffer manager ... ");
@@ -38,7 +41,7 @@ void appl::WorkerCloseFile::init(const std::string& _bufferName) {
std::shared_ptr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == nullptr) {
APPL_ERROR("No selected buffer now ...");
autoDestroy();
destroy();
return;
}
m_bufferName = tmpp->getFileName();
@@ -57,12 +60,14 @@ void appl::WorkerCloseFile::init(const std::string& _bufferName) {
if (m_buffer->isModify() == false) {
signalCloseDone.emit();
m_buffer->destroy();
destroy();
return;
}
std::shared_ptr<ewol::widget::StdPopUp> tmpPopUp = ewol::widget::StdPopUp::create();
if (tmpPopUp == nullptr) {
APPL_ERROR("Can not create a simple pop-up");
destroy();
return;
}
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");