[DEV] update for build URI

This commit is contained in:
2018-09-29 21:59:06 +02:00
parent 1d65639191
commit a044d64f02
32 changed files with 245 additions and 278 deletions

View File

@@ -331,14 +331,14 @@ void MainWindows::onCallbackMenuEvent(const etk::String& _value) {
APPL_TODO("Event from Menu : " << _value);
} else if ( _value == "menu:color:color/black/"
|| _value == "menu:color:color/white/") {
etk::theme::setName("COLOR", etk::String(_value, 11));
EWOL_TODO("etk::theme::setName(\"COLOR\", etk::String(_value, 11));");
EWOL_ERROR("Select Shape or Color : 'COLOR'='" << etk::String(_value, 11) << "'");
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if ( _value == "menu:shape:shape/square/"
|| _value == "menu:shape:shape/round/") {
EWOL_ERROR("Select Shape or Color : 'GUI'='" << etk::String(_value, 11) << "'");
etk::theme::setName("GUI", etk::String(_value, 11));
EWOL_TODO("etk::theme::setName(\"GUI\", etk::String(_value, 11));");
ewol::getContext().getResourcesManager().reLoadResources();
ewol::getContext().forceRedrawAll();
} else if (_value == "menu:reloadShape") {
@@ -425,8 +425,7 @@ void MainWindows::displayOpen() {
// Get a ref on the buffer selected (if null, no buffer was selected ...)
ememory::SharedPtr<appl::Buffer> tmpBuffer = m_bufferManager->getBufferSelected();
if (tmpBuffer != null) {
etk::FSNode tmpFile = tmpBuffer->getFileName();
tmpWidget->propertyPath.set(tmpFile.getNameFolder());
tmpWidget->propertyPath.set(tmpBuffer->getFileName().getParent());
}
// apply widget pop-up ...
popUpWidgetPush(tmpWidget);
@@ -467,8 +466,8 @@ void MainWindows::displayProperty() {
#endif
}
void MainWindows::onCallbackselectNewFile(const etk::String& _value) {
APPL_INFO("onCallbackselectNewFile(" << _value << ")");
void MainWindows::onCallbackselectNewFile(const ememory::SharedPtr<appl::Buffer>& _value) {
APPL_INFO("onCallbackselectNewFile( ... )");
if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... ");
return;
@@ -477,15 +476,15 @@ void MainWindows::onCallbackselectNewFile(const etk::String& _value) {
m_connectionModify.disconnect();
m_connectionSaveName.disconnect();
onCallbackTitleUpdate();
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp != null) {
m_connectionSave = tmpp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionModify = tmpp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionSaveName = tmpp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate);
if (_value != null) {
ememory::SharedPtr<appl::Buffer> tmp = _value;
m_connectionSave = tmp->signalIsSave.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionModify = tmp->signalIsModify.connect(this, &MainWindows::onCallbackTitleUpdate);
m_connectionSaveName = tmp->signalChangeName.connect(this, &MainWindows::onCallbackTitleUpdate);
}
}
void MainWindows::onCallbackPopUpFileSelected(const etk::String& _value) {
void MainWindows::onCallbackPopUpFileSelected(const etk::Path& _value) {
APPL_INFO("onCallbackPopUpFileSelected(" << _value << ")");
APPL_DEBUG("Request opening the file : " << _value);
m_bufferManager->open(_value);
@@ -505,10 +504,9 @@ void MainWindows::onCallbackTitleUpdate() {
m_widgetLabelFileName->propertyValue.set("");
}
} else {
etk::String nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
propertyTitle.set(etk::String("Edn : ") + (tmpp->isModify()==true?" *":"") + tmpp->getFileName().getString());
if (m_widgetLabelFileName != null) {
m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":""));
m_widgetLabelFileName->propertyValue.set(tmpp->getFileName().getString() + (tmpp->isModify()==true?" *":""));
}
}
}
@@ -532,7 +530,7 @@ void MainWindows::closeNotSavedFile(const ememory::SharedPtr<appl::Buffer>& _buf
return;
}
tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->propertyComment.set("_T{The file named:} <i>\"" + _buffer->getFileName() + "\"</i> _T{is curently modify.} <br/>_T{If you don't saves these modifications,<br/>they will be definitly lost...}");
tmpPopUp->propertyComment.set("_T{The file named:} <i>\"" + _buffer->getFileName().getString() + "\"</i> _T{is curently modify.} <br/>_T{If you don't saves these modifications,<br/>they will be definitly lost...}");
ememory::SharedPtr<ewol::widget::Button> bt = null;
if (_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true);

View File

@@ -44,11 +44,11 @@ class MainWindows : public ewol::widget::Windows {
void displayOpen();
void displayProperty();
private:
void onCallbackPopUpFileSelected(const etk::String& _value);
void onCallbackPopUpFileSelected(const etk::Path& _value);
void onCallbackTitleUpdate();
void onCallbackMenuEvent(const etk::String& _value);
void onCallbackShortCut(const etk::String& _value);
void onCallbackselectNewFile(const etk::String& _value);
void onCallbackselectNewFile(const ememory::SharedPtr<appl::Buffer>& _value);
};

View File

@@ -14,7 +14,7 @@ appl::TagFileList::TagFileList() :
m_selectedLine = -1;
setMouseLimit(1);
// Load color properties: (use file list to be generic ...)
m_colorProperty = ewol::resource::ColorFile::create("THEME:COLOR:ListFileSystem.json");
m_colorProperty = ewol::resource::ColorFile::create("THEME_COLOR://ListFileSystem.json");
if (m_colorProperty != null) {
m_colorIdText = m_colorProperty->request("text");
m_colorIdBackground1 = m_colorProperty->request("background1");
@@ -50,7 +50,7 @@ fluorine::Variant appl::TagFileList::getData(int32_t _role, const ivec2& _pos) {
if (0 == _pos.x()) {
return etk::toString(m_list[_pos.y()]->fileLine);
}
return m_list[_pos.y()]->filename;
return m_list[_pos.y()]->filename.getString();
}
return "ERROR";
case ewol::widget::ListRole::FgColor:
@@ -82,9 +82,9 @@ bool appl::TagFileList::onItemEvent(const ewol::event::Input& _event, const ivec
&& m_selectedLine < (int64_t)m_list.size()
&& null != m_list[m_selectedLine] ) {
if (previousRaw != m_selectedLine) {
signalSelect.emit(etk::toString(m_list[_pos.y()]->fileLine)+":"+m_list[m_selectedLine]->filename);
signalSelect.emit(m_list[m_selectedLine]->filename, m_list[_pos.y()]->fileLine);
} else {
signalValidate.emit(etk::toString(m_list[_pos.y()]->fileLine)+":"+m_list[m_selectedLine]->filename);
signalValidate.emit(m_list[m_selectedLine]->filename, m_list[_pos.y()]->fileLine);
}
} else {
signalUnSelect.emit();
@@ -103,7 +103,7 @@ bool appl::TagFileList::onItemEvent(const ewol::event::Input& _event, const ivec
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void appl::TagFileList::add(etk::String& _file, int32_t _line) {
void appl::TagFileList::add(etk::Path& _file, int32_t _line) {
appl::TagListElement *tmpFile = ETK_NEW(appl::TagListElement, _file, _line);
if (null != tmpFile) {
m_list.pushBack(tmpFile);
@@ -112,3 +112,7 @@ void appl::TagFileList::add(etk::String& _file, int32_t _line) {
}
#include <esignal/details/Signal.hxx>
// declare for signal event
ESIGNAL_DECLARE_SIGNAL(etk::Path, int32_t);

View File

@@ -11,9 +11,9 @@
namespace appl {
class TagListElement {
public:
etk::String filename;
int32_t fileLine;
TagListElement(etk::String& _file, int32_t _line) :
etk::Path filename;
int32_t fileLine;
TagListElement(etk::Path& _file, int32_t _line) :
filename(_file),
fileLine(_line) {
@@ -24,8 +24,8 @@ namespace appl {
};
class TagFileList : public ewol::widget::List {
public:
esignal::Signal<etk::String> signalSelect;
esignal::Signal<etk::String> signalValidate;
esignal::Signal<etk::Path, int32_t> signalSelect;
esignal::Signal<etk::Path, int32_t> signalValidate;
esignal::Signal<> signalUnSelect;
private:
int32_t m_selectedLine;
@@ -53,7 +53,7 @@ namespace appl {
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void add(etk::String& _file, int32_t _line);
void add(etk::Path& _file, int32_t _line);
};
}

View File

@@ -91,8 +91,8 @@ appl::TagFileSelection::~TagFileSelection() {
}
void appl::TagFileSelection::onCallbackCtagsSelection() {
if (m_eventNamed != "") {
signalSelect.emit(m_eventNamed);
if (m_eventLine != -1) {
signalSelect.emit(m_eventPath, m_eventLine);
// == > Auto remove ...
autoDestroy();
}
@@ -104,18 +104,20 @@ void appl::TagFileSelection::onCallbackCtagsCancel() {
autoDestroy();
}
void appl::TagFileSelection::onCallbackCtagsListValidate(const etk::String& _value) {
signalSelect.emit(_value);
void appl::TagFileSelection::onCallbackCtagsListValidate(const etk::Path& _path, const int32_t& _line) {
signalSelect.emit(_path, _line);
// == > Auto remove ...
autoDestroy();
}
void appl::TagFileSelection::onCallbackCtagsListSelect(const etk::String& _value) {
m_eventNamed = _value;
void appl::TagFileSelection::onCallbackCtagsListSelect(const etk::Path& _path, const int32_t& _line) {
m_eventPath = _path;
m_eventLine = _line;
}
void appl::TagFileSelection::onCallbackCtagsListUnSelect() {
m_eventNamed = "";
m_eventPath = "";
m_eventLine = -1;
}
@@ -125,7 +127,7 @@ void appl::TagFileSelection::onCallbackCtagsListUnSelect() {
* @param[in] file Compleate file name
* @param[in] jump line id
*/
void appl::TagFileSelection::addCtagsNewItem(etk::String _file, int32_t _line) {
void appl::TagFileSelection::addCtagsNewItem(etk::Path _file, int32_t _line) {
if (m_listTag != null) {
m_listTag->add(_file, _line);
}

View File

@@ -11,11 +11,12 @@
namespace appl {
class TagFileSelection : public ewol::widget::PopUp {
public:
esignal::Signal<etk::String> signalSelect;
esignal::Signal<etk::Path, int32_t> signalSelect;
esignal::Signal<> signalCancel;
private:
ememory::SharedPtr<appl::TagFileList> m_listTag;
etk::String m_eventNamed;
etk::Path m_eventPath;
int32_t m_eventLine = -1;
public:
TagFileSelection();
void init();
@@ -24,15 +25,15 @@ namespace appl {
virtual ~TagFileSelection();
/**
* @brief add a Ctags item on the curent list
* @param[in] file Compleate file name
* @param[in] jump line id
* @param[in] _path Compleate file name
* @param[in] _line Jump line id
*/
void addCtagsNewItem(etk::String file, int32_t line);
void addCtagsNewItem(etk::Path _path, int32_t _line);
public: // callback function
void onCallbackCtagsSelection();
void onCallbackCtagsCancel();
void onCallbackCtagsListValidate(const etk::String& _value);
void onCallbackCtagsListSelect(const etk::String& _value);
void onCallbackCtagsListValidate(const etk::Path& _path, const int32_t& _line);
void onCallbackCtagsListSelect(const etk::Path& _path, const int32_t& _line);
void onCallbackCtagsListUnSelect();
};
}

View File

@@ -83,8 +83,12 @@ void appl::TextViewer::onCallbackShortCut(const etk::String& _value) {
}
void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
APPL_INFO("Select new file: " << _value);
void appl::TextViewer::onCallbackselectNewFile(const ememory::SharedPtr<appl::Buffer>& _value) {
if (_value == null) {
APPL_INFO("Select new file: ___NO-FILE___");
} else {
APPL_INFO("Select new file: " << _value->getFileName());
}
if (isSelectedLast() == false) {
return;
}
@@ -115,7 +119,7 @@ void appl::TextViewer::onCallbackselectNewFile(const etk::String& _value) {
}
m_originScrooled = vec2(0,0);
if (m_bufferManager != null) {
m_buffer = m_bufferManager->get(_value);
m_buffer = _value;
m_bufferManager->setBufferSelected(m_buffer);
if (m_buffer != null) {
m_buffer->signalIsModify.connect(sharedFromThis(), &appl::TextViewer::onCallbackIsModify);
@@ -138,12 +142,7 @@ etk::String appl::TextViewer::getBufferPath() {
if (m_buffer == null) {
return "";
}
etk::String filename = m_buffer->getFileName();
size_t pos = filename.rfind('/');
if (pos == etk::String::npos) {
return "";
}
return etk::String(filename, 0, pos);
return m_buffer->getFileName().getParent().getString();
}

View File

@@ -415,7 +415,7 @@ namespace appl {
void onCallbackIsModify();
void onCallbackShortCut(const etk::String& _value);
void onCallbackSelectChange();
void onCallbackselectNewFile(const etk::String& _value);
void onCallbackselectNewFile(const ememory::SharedPtr<appl::Buffer>& _value);
};
}

View File

@@ -17,7 +17,7 @@ namespace appl {
DECLARE_FACTORY(WorkerCloseAllFile);
virtual ~WorkerCloseAllFile();
private:
etk::Vector<etk::String> m_bufferNameList;
etk::Vector<etk::Path> m_bufferNameList;
ememory::SharedPtr<appl::WorkerCloseFile> m_worker; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function

View File

@@ -24,14 +24,14 @@ void appl::WorkerCloseFile::init() {
ewol::object::Worker::init();
}
void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
void appl::WorkerCloseFile::startAction(const etk::Path& _bufferName) {
m_bufferName = _bufferName;
if (m_bufferManager == null) {
APPL_ERROR("can not call unexistant buffer manager ... ");
destroy();
return;
}
if (m_bufferName == "") {
if (m_bufferName.isEmpty() == true) {
// need to find the curent file ...
ememory::SharedPtr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == null) {
@@ -66,7 +66,7 @@ void appl::WorkerCloseFile::startAction(const etk::String& _bufferName) {
return;
}
tmpPopUp->propertyTitle.set("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->propertyComment.set("_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...}");
tmpPopUp->propertyComment.set("_T{The file named:} <i>'" + m_buffer->getFileName().getString() + "'</i> _T{is curently modify.}<br/>_T{If you don't saves these modifications,}<br/>_T{they will be definitly lost...}");
ememory::SharedPtr<ewol::widget::Button> bt = null;
if (m_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true);
@@ -132,7 +132,7 @@ void appl::WorkerCloseFile::onCallbackSaveValidate() {
return;
}
if (m_buffer->storeFile() == false) {
ewol::tools::message::displayWarning("We can not save the file : <br/><i>" + m_buffer->getFileName() + "</i>");
ewol::tools::message::displayWarning("We can not save the file : <br/><i>" + m_buffer->getFileName().getString() + "</i>");
signalAbort.emit();
} else {
m_buffer->destroy();

View File

@@ -25,9 +25,9 @@ namespace appl {
/**
* @brief Action to do
*/
void startAction(const etk::String& _bufferName);
void startAction(const etk::Path& _bufferName);
private:
etk::String m_bufferName;
etk::Path m_bufferName;
ememory::SharedPtr<appl::Buffer> m_buffer; //!< reference on the buffer (when rename, we have no more reference on the buffer
ememory::SharedPtr<appl::WorkerSaveFile> m_worker; //! sub-worker element...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager

View File

@@ -17,7 +17,7 @@ namespace appl {
DECLARE_FACTORY(WorkerSaveAllFile);
virtual ~WorkerSaveAllFile();
private:
etk::Vector<etk::String> m_bufferNameList;
etk::Vector<etk::Path> m_bufferNameList;
ememory::SharedPtr<appl::WorkerSaveFile> m_worker; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function

View File

@@ -62,9 +62,8 @@ void appl::WorkerSaveFile::init() {
}
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());
m_chooser->propertyPath.set(propertyBufferName->getParent());
m_chooser->propertyFile.set(propertyBufferName->getFileName());
ememory::SharedPtr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
if (tmpWindows == null) {
APPL_ERROR("Error to get the windows.");
@@ -85,13 +84,13 @@ void appl::WorkerSaveFile::onCallbackCancel() {
destroy();
}
void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) {
void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::Path& _value) {
if (m_bufferManager == null) {
// nothing to do in this case ==> can do nothing ...
destroy();
return;
}
if (_value == "") {
if (_value.isEmpty() == true) {
APPL_ERROR(" might be an error of the File chooser system...");
destroy();
return;
@@ -109,7 +108,7 @@ void appl::WorkerSaveFile::onCallbackSaveAsValidate(const etk::String& _value) {
}
tmpBuffer->setFileName(_value);
if (tmpBuffer->storeFile() == false) {
ewol::tools::message::displayWarning("We can not save the file : <br/><i>" + tmpBuffer->getFileName() + "</i>");
ewol::tools::message::displayWarning("We can not save the file : <br/><i>" + tmpBuffer->getFileName().getString() + "</i>");
} else {
signalSaveDone.emit();
}

View File

@@ -13,7 +13,7 @@ namespace appl {
public:
esignal::Signal<> signalSaveDone;
esignal::Signal<> signalAbort;
eproperty::Value<etk::String> propertyBufferName;
eproperty::Value<etk::Path> propertyBufferName;
eproperty::Value<bool> propertyForceSave;
protected:
WorkerSaveFile();
@@ -25,7 +25,7 @@ namespace appl {
ememory::SharedPtr<ewol::widget::FileChooser> m_chooser; //! pop-up element that is open...
ememory::SharedPtr<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
public: // callback function
void onCallbackSaveAsValidate(const etk::String& _value);
void onCallbackSaveAsValidate(const etk::Path& _value);
void onCallbackCancel();
};
}