diff --git a/sources/appl/Gui/WorkerCloseFile.cpp b/sources/appl/Gui/WorkerCloseFile.cpp
index 0e33e55..83660ed 100644
--- a/sources/appl/Gui/WorkerCloseFile.cpp
+++ b/sources/appl/Gui/WorkerCloseFile.cpp
@@ -70,24 +70,24 @@ void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
destroy();
return;
}
- tmpPopUp->setTitle("Close un-saved file:");
- tmpPopUp->setComment("The file named : \"" + m_buffer->getFileName() + "\" is curently modify.
If you don't saves these modifications,
they will be definitly lost...");
+ tmpPopUp->setTitle("_T{Close un-saved file:}");
+ tmpPopUp->setComment("_T{The file named:} '" + m_buffer->getFileName() + "' _T{is curently modify.}
_T{If you don't saves these modifications,}
_T{they will be definitly lost...}");
std::shared_ptr 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);
}
diff --git a/sources/appl/Gui/WorkerSaveFile.cpp b/sources/appl/Gui/WorkerSaveFile.cpp
index c52eb03..3d0a9be 100644
--- a/sources/appl/Gui/WorkerSaveFile.cpp
+++ b/sources/appl/Gui/WorkerSaveFile.cpp
@@ -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());
diff --git a/sources/appl/TextPluginData.h b/sources/appl/TextPluginData.h
index 57c74ed..bab4e21 100644
--- a/sources/appl/TextPluginData.h
+++ b/sources/appl/TextPluginData.h
@@ -28,36 +28,33 @@ namespace appl {
for (size_t iii = 0; iii < m_specificData.size() ; ++iii) {
if (m_specificData[iii].second != nullptr) {
remove(*m_specificData[iii].second);
- delete(m_specificData[iii].second);
- m_specificData[iii].second = nullptr;
}
}
m_specificData.clear();
}
private:
- std::vector ,TYPE* >> m_specificData;
+ std::vector ,std::unique_ptr>> m_specificData;
protected:
TYPE* getDataRef(appl::TextViewer& _textDrawer) {
auto it = m_specificData.begin();
while(it != m_specificData.end()) {
std::shared_ptr buf = it->first.lock();
if (buf == nullptr) {
- delete(it->second);
- it->second = nullptr;
it = m_specificData.erase(it);
+ continue;
}
if (buf == _textDrawer.internalGetBuffer()) {
- return it->second;
+ return it->second.get();
}
++it;
}
- TYPE* data = new TYPE();
+ std::unique_ptr data(new TYPE());
if (data == nullptr) {
return nullptr;
}
- m_specificData.push_back(std::make_pair(_textDrawer.internalGetBuffer(), data));
+ m_specificData.push_back(std::make_pair(_textDrawer.internalGetBuffer(), std::move(data)));
// create a new one ...
- return data;
+ return data.get();
}
protected: // Wrap all element with their internal data: (do not use theses function)
bool onReceiveShortCut(appl::TextViewer& _textDrawer,