[DEBUG] correct the bug of close file and open again ar seg-fault when write

This commit is contained in:
2016-03-15 22:33:06 +01:00
parent a265735cd1
commit c251a419ad
3 changed files with 14 additions and 17 deletions

View File

@@ -70,24 +70,24 @@ void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
destroy();
return;
}
tmpPopUp->setTitle("<bold>Close un-saved file:</bold>");
tmpPopUp->setComment("The file named : <i>\"" + m_buffer->getFileName() + "\"</i> is curently modify. <br/>If you don't saves these modifications,<br/>they will be definitly lost...");
tmpPopUp->setTitle("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->setComment("_T{The file named:} <i>'" + m_buffer->getFileName() + "'</i> _T{is curently modify.}<br/>_T{If you don't saves these modifications,}<br/>_T{they will be definitly lost...}");
std::shared_ptr<ewol::widget::Button> bt = nullptr;
if (m_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("Save", true);
bt = tmpPopUp->addButton("_T{Save}", true);
if (bt != nullptr) {
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveValidate);
}
}
bt = tmpPopUp->addButton("Save As", true);
bt = tmpPopUp->addButton("_T{Save As}", true);
if (bt != nullptr) {
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackSaveAsValidate);
}
bt = tmpPopUp->addButton("Close", true);
bt = tmpPopUp->addButton("_T{Close}", true);
if (bt != nullptr) {
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackClose);
}
bt = tmpPopUp->addButton("Cancel", true);
bt = tmpPopUp->addButton("_T{Cancel}", true);
if (bt != nullptr) {
bt->signalPressed.connect(shared_from_this(), &appl::WorkerCloseFile::onCallbackCancel);
}

View File

@@ -66,8 +66,8 @@ void appl::WorkerSaveFile::init() {
destroy();
return;
}
m_chooser->propertyLabelTitle.set("Save files As...");
m_chooser->propertyLabelValidate.set("Save");
m_chooser->propertyLabelTitle.set("_T{Save files As...}");
m_chooser->propertyLabelValidate.set("_T{Save}");
etk::FSNode tmpName(*propertyBufferName);
m_chooser->propertyPath.set(tmpName.getNameFolder());
m_chooser->propertyFile.set(tmpName.getNameFile());