mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-24 23:48:31 -04:00
Added change language flow.
This commit is contained in:
1 parent
9a132f9f35
commit
5cf1cf8a11
14 files changed
+146
-38
No files matched your search
@@ -87,13 +87,13 @@ int Application::switchWindow( const std::string& windowName, uint32_t cmd, std:
|
||||
return 0;
|
||||
}
|
||||
int Application::switchBackWindow( const std::string& windowName, uint32_t cmd, std::unique_ptr<gui::SwitchData> data ) {
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppSwitchWindowBack, this->GetName() );
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppSwitchWindowBack );
|
||||
sys::Bus::SendUnicast(msg, this->GetName(), this );
|
||||
|
||||
return 0;
|
||||
}
|
||||
int Application::refreshWindow(gui::RefreshModes mode) {
|
||||
auto msg = std::make_shared<AppRefreshMessage>( this->GetName(), mode );
|
||||
auto msg = std::make_shared<AppRefreshMessage>( mode );
|
||||
sys::Bus::SendUnicast(msg, this->GetName(), this );
|
||||
|
||||
return 0;
|
||||
@@ -203,6 +203,10 @@ sys::Message_t Application::DataReceivedHandler(sys::DataMessage* msgl) {
|
||||
//here should go all the cleaning
|
||||
handled = true;
|
||||
}
|
||||
else if( msgl->messageType == static_cast<uint32_t>(MessageType::AppRebuild )) {
|
||||
|
||||
LOG_INFO("Application %s rebuilding gui", GetName().c_str() );
|
||||
}
|
||||
else if( msgl->messageType == static_cast<uint32_t>(MessageType::AppRefresh)) {
|
||||
AppRefreshMessage* msg = reinterpret_cast<AppRefreshMessage*>( msgl );
|
||||
//currentWindow->onBeforeShow( gui::ShowMode::GUI_SHOW_RETURN, 0, nullptr );
|
||||
@@ -216,7 +220,6 @@ sys::Message_t Application::DataReceivedHandler(sys::DataMessage* msgl) {
|
||||
}
|
||||
|
||||
sys::ReturnCodes Application::InitHandler() {
|
||||
// LOG_INFO("!!!!!!!!!!!!!!!!!INIT TIME 1: %d", xTaskGetTickCount() );
|
||||
bool initState= true;
|
||||
state = State::INITIALIZING;
|
||||
uint32_t start = xTaskGetTickCount();
|
||||
@@ -226,11 +229,8 @@ sys::ReturnCodes Application::InitHandler() {
|
||||
initState = (settings.dbID == 1);
|
||||
|
||||
//send response to application manager true if successful, false otherwise.
|
||||
// LOG_INFO("!!!!!!!!!!!!!!!!!INIT TIME 2: %d", xTaskGetTickCount() );
|
||||
sapm::ApplicationManager::messageRegisterApplication( this, initState );
|
||||
// LOG_INFO("!!!!!!!!!!!!!!!!!INIT TIME 3: %d", xTaskGetTickCount() );
|
||||
sys::ReturnCodes retCode = (initState?sys::ReturnCodes::Success:sys::ReturnCodes::Failure);
|
||||
// LOG_INFO("*****************ReturnCode %d",static_cast<uint32_t>(retCode));
|
||||
return retCode;
|
||||
}
|
||||
|
||||
@@ -257,14 +257,20 @@ bool Application::messageSwitchApplication( sys::Service* sender, std::string ap
|
||||
}
|
||||
|
||||
bool Application::messageRefreshApplication( sys::Service* sender, std::string application, std::string window, gui::SwitchData* data ) {
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppRefresh, application );
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppRefresh );
|
||||
sys::Bus::SendUnicast(msg, application, sender );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Application::messageCloseApplication( sys::Service* sender, std::string application ) {
|
||||
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppClose, application );
|
||||
auto msg = std::make_shared<AppMessage>( MessageType::AppClose );
|
||||
sys::Bus::SendUnicast(msg, application, sender );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Application::messageRebuildApplication( sys::Service* sender, std::string application ) {
|
||||
auto msg = std::make_shared<AppRebuildMessage>();
|
||||
sys::Bus::SendUnicast(msg, application, sender );
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user