From 86552172d7c2ba4f36576f8018064cdc3ba4903d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 12 Jun 2013 22:58:11 +0200 Subject: [PATCH] [DEV] do not open folder like file (not open at all) --- sources/appl/Buffer/BufferManager.cpp | 20 ++++++++++++-------- sources/appl/Gui/BufferView.cpp | 4 +++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sources/appl/Buffer/BufferManager.cpp b/sources/appl/Buffer/BufferManager.cpp index 453c90f..6b41070 100644 --- a/sources/appl/Buffer/BufferManager.cpp +++ b/sources/appl/Buffer/BufferManager.cpp @@ -107,15 +107,19 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg) } else if (_msg.GetMessage() == ednMsgOpenFile) { if (_msg.GetData() != "" ) { etk::FSNode myFile(_msg.GetData()); - APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\""); - int32_t newOne = Open(myFile); - if (-1 != newOne) { - m_idSelected = newOne; - SendMultiCast(ednMsgBufferId, m_idSelected); - SendMultiCast(ednMsgBufferListChange); + if (myFile.GetNodeType() == etk::FSN_FILE) { + APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\""); + int32_t newOne = Open(myFile); + if (-1 != newOne) { + m_idSelected = newOne; + SendMultiCast(ednMsgBufferId, m_idSelected); + SendMultiCast(ednMsgBufferListChange); + } else { + // TODO : notify user that we can not open the request file... + APPL_ERROR("Can not open the file : \"" << myFile << "\""); + } } else { - // TODO : notify user that we can not open the request file... - APPL_ERROR("Can not open the file : \"" << myFile << "\""); + APPL_ERROR("Request to open an Unknox element file : " << myFile << " type:" << myFile.GetNodeType()); } } } else if (_msg.GetMessage() == ednMsgGuiSave) { diff --git a/sources/appl/Gui/BufferView.cpp b/sources/appl/Gui/BufferView.cpp index 3a05758..14d1ff1 100644 --- a/sources/appl/Gui/BufferView.cpp +++ b/sources/appl/Gui/BufferView.cpp @@ -160,6 +160,8 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW m_selectedID = raw; // stop searching m_selectedIdRequested = -1; + // set the raw visible : + SetRawVisible(m_selectedID); } if (m_selectedID == raw) { selectBG = COLOR_LIST_BG_SELECTED; @@ -179,7 +181,7 @@ bool BufferView::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEven if( raw>=0 && rawm_bufferID; SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID); } }