[DEV] do not open folder like file (not open at all)

This commit is contained in:
Edouard DUPIN 2013-06-12 22:58:11 +02:00
parent dcdfbe3647
commit 86552172d7
2 changed files with 15 additions and 9 deletions

View File

@ -107,15 +107,19 @@ void classBufferManager::OnReceiveMessage(const ewol::EMessage& _msg)
} else if (_msg.GetMessage() == ednMsgOpenFile) { } else if (_msg.GetMessage() == ednMsgOpenFile) {
if (_msg.GetData() != "" ) { if (_msg.GetData() != "" ) {
etk::FSNode myFile(_msg.GetData()); etk::FSNode myFile(_msg.GetData());
APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\""); if (myFile.GetNodeType() == etk::FSN_FILE) {
int32_t newOne = Open(myFile); APPL_DEBUG("request open file = \"" << _msg.GetData() << "\" ?= \"" << myFile << "\"");
if (-1 != newOne) { int32_t newOne = Open(myFile);
m_idSelected = newOne; if (-1 != newOne) {
SendMultiCast(ednMsgBufferId, m_idSelected); m_idSelected = newOne;
SendMultiCast(ednMsgBufferListChange); 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 { } else {
// TODO : notify user that we can not open the request file... APPL_ERROR("Request to open an Unknox element file : " << myFile << " type:" << myFile.GetNodeType());
APPL_ERROR("Can not open the file : \"" << myFile << "\"");
} }
} }
} else if (_msg.GetMessage() == ednMsgGuiSave) { } else if (_msg.GetMessage() == ednMsgGuiSave) {

View File

@ -160,6 +160,8 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
m_selectedID = raw; m_selectedID = raw;
// stop searching // stop searching
m_selectedIdRequested = -1; m_selectedIdRequested = -1;
// set the raw visible :
SetRawVisible(m_selectedID);
} }
if (m_selectedID == raw) { if (m_selectedID == raw) {
selectBG = COLOR_LIST_BG_SELECTED; selectBG = COLOR_LIST_BG_SELECTED;
@ -179,7 +181,7 @@ bool BufferView::OnItemEvent(int32_t IdInput, ewol::keyEvent::status_te typeEven
if( raw>=0 if( raw>=0
&& raw<m_list.Size() && raw<m_list.Size()
&& NULL != m_list[raw]) { && NULL != m_list[raw]) {
m_selectedID = raw; m_selectedIdRequested = m_list[raw]->m_bufferID;
SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID); SendMultiCast(ednMsgBufferId, m_list[raw]->m_bufferID);
} }
} }