[DEV] update new ewol

This commit is contained in:
Edouard DUPIN 2016-03-16 23:09:36 +01:00
parent c251a419ad
commit 0d47ff22e2
5 changed files with 26 additions and 32 deletions

View File

@ -83,9 +83,6 @@ def create(target, module_name):
'sources/appl/HighlightManager.cpp'
])
my_module.add_module_depend(['ewol', 'date'])
my_module.compile_flags('c++', [
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\""
])
my_module.copy_path('data/icon.*','')
my_module.copy_path('data/languages/gcov/*.xml','languages/gcov/')
my_module.copy_path('data/languages/asm/*.xml','languages/asm/')
@ -116,6 +113,7 @@ def create(target, module_name):
my_module.copy_path("data/Font/freefont/FreeMon*.ttf","fonts/")
my_module.compile_flags('c', [
"-DPROJECT_NAME=\"\\\""+my_module.name+"\\\"\"",
"-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\""
])
versionIDCode = str(get_version_id())

View File

@ -111,15 +111,7 @@ class ParameterAboutGui : public ewol::widget::Sizer {
};
};
// Local main windows event :
static const char* mainWindowsRequestSaveFile = "appl-event-main-windows-save-file";
static const char* mainWindowsRequestSaveFileAs = "appl-event-main-windows-save-file-as";
static const char* mainWindowsRequestcloseFileNoCheck = "appl-event-main-windows-close-file-no-check";
static const char* l_MsgNameGuiChangeShape = "appl-event-main-windows-Change-shape";
const char* l_smoothChick = "tmpEvent_smooth";
const char* l_smoothMin = "tmpEvent_minChange";
const char* l_smoothMax = "tmpEvent_maxChange";
#undef __class__
#define __class__ "MainWindows"
@ -514,13 +506,13 @@ void MainWindows::onCallbackTitleUpdate() {
// select a new Buffer ==> change title:
std::shared_ptr<appl::Buffer> tmpp = m_bufferManager->getBufferSelected();
if (tmpp == nullptr) {
setTitle("Edn");
propertyTitle.set("Edn");
if (m_widgetLabelFileName != nullptr) {
m_widgetLabelFileName->propertyValue.set("");
}
} else {
std::string nameFileSystem = etk::FSNode(tmpp->getFileName()).getFileSystemName();
setTitle(std::string("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
propertyTitle.set(std::string("Edn : ") + (tmpp->isModify()==true?" *":"") + nameFileSystem);
if (m_widgetLabelFileName != nullptr) {
m_widgetLabelFileName->propertyValue.set(nameFileSystem + (tmpp->isModify()==true?" *":""));
}
@ -545,8 +537,8 @@ void MainWindows::closeNotSavedFile(const std::shared_ptr<appl::Buffer>& _buffer
APPL_ERROR("Can not create a simple pop-up");
return;
}
tmpPopUp->setTitle("<bold>_T{Close un-saved file:}</bold>");
tmpPopUp->setComment("_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->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...}");
std::shared_ptr<ewol::widget::Button> bt = nullptr;
if (_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true);

View File

@ -10,6 +10,7 @@
#include <appl/debug.h>
#include <appl/Gui/WorkerCloseFile.h>
#include <ewol/widget/meta/StdPopUp.h>
#include <ewol/tools/message.h>
#undef __class__
#define __class__ "WorkerCloseFile"
@ -70,8 +71,8 @@ void appl::WorkerCloseFile::startAction(const std::string& _bufferName) {
destroy();
return;
}
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...}");
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...}");
std::shared_ptr<ewol::widget::Button> bt = nullptr;
if (m_buffer->hasFileName() == true) {
bt = tmpPopUp->addButton("_T{Save}", true);
@ -137,11 +138,7 @@ void appl::WorkerCloseFile::onCallbackSaveValidate() {
return;
}
if (m_buffer->storeFile() == false) {
std::shared_ptr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
if (tmpWindows == nullptr) {
return;
}
tmpWindows->displayWarningMessage("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() + "</i>");
signalAbort.emit();
} else {
m_buffer->destroy();

View File

@ -9,6 +9,7 @@
#include <ewol/context/Context.h>
#include <appl/debug.h>
#include <appl/Gui/WorkerSaveFile.h>
#include <ewol/tools/message.h>
#undef __class__
#define __class__ "WorkerSaveFile"
@ -115,12 +116,7 @@ void appl::WorkerSaveFile::onCallbackSaveAsValidate(const std::string& _value) {
}
tmpBuffer->setFileName(_value);
if (tmpBuffer->storeFile() == false) {
std::shared_ptr<ewol::widget::Windows> tmpWindows = ewol::getContext().getWindows();
if (tmpWindows == nullptr) {
destroy();
return;
}
tmpWindows->displayWarningMessage("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() + "</i>");
} else {
signalSaveDone.emit();
}

View File

@ -28,13 +28,15 @@
#include <appl/ctags/readtags.h>
#include <appl/globalMsg.h>
#undef __class__
#define __class__ "MainApplication"
class MainApplication : public ewol::context::Application {
private:
std::shared_ptr<appl::BufferManager> m_bufferManager;
std::shared_ptr<appl::textPluginManager> m_pluginManager;
public:
virtual void onCreate(ewol::Context& _context) {
virtual void onCreate(ewol::Context& _context) override {
APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << ewol::getBoardType() << "] (" << ewol::getCompilationMode() << ") (BEGIN)");
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
std::string tmpppp = _context.getCmd().get(iii);
@ -66,7 +68,7 @@ class MainApplication : public ewol::context::Application {
APPL_INFO("==> CREATE ... " PROJECT_NAME " (END)");
}
void onStart(ewol::Context& _context) {
void onStart(ewol::Context& _context) override {
APPL_INFO("==> START ... " PROJECT_NAME " (BEGIN)");
// init internal global value
globals::init();
@ -90,7 +92,7 @@ class MainApplication : public ewol::context::Application {
if (basicWindows == nullptr) {
APPL_ERROR("Can not allocate the basic windows");
_context.stop();
_context.exit(-1);
return;
}
// create the specific windows
@ -128,7 +130,7 @@ class MainApplication : public ewol::context::Application {
APPL_INFO("==> START ... " PROJECT_NAME " (END)");
return;
}
void onStop(ewol::Context& _context) {
void onStop(ewol::Context& _context) override {
APPL_INFO("==> STOP ... " PROJECT_NAME " (START)");
appl::highlightManager::unInit();
//Kill all singleton
@ -136,6 +138,15 @@ class MainApplication : public ewol::context::Application {
m_bufferManager.reset();
APPL_INFO("==> STOP ... " PROJECT_NAME " (END)");
}
void onKillDemand(ewol::Context& _context) override {
APPL_INFO("==> User demand kill ... " PROJECT_NAME " (START)");
if (m_bufferManager == nullptr) {
_context.exit(0);
}
APPL_TODO("Implement the check of buffer not saved ...");
_context.exit(0);
APPL_INFO("==> User demand kill ... " PROJECT_NAME " (END)");
}
};