From: Oleksander Kostenko Date: Fri, 1 Jul 2016 11:38:56 +0000 (+0300) Subject: TizenRefApp-6565 Modify popup "mobile data is turned off" X-Git-Tag: submit/tizen_dev/20160719.083834~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=180dc852e0e0b3720d62e12d14df2e1637ca13e5;p=profile%2Fmobile%2Fapps%2Fnative%2Fmessage.git TizenRefApp-6565 Modify popup "mobile data is turned off" Change-Id: Ia74d32305406e1ebf9bedff64fe9f552a51bc465 Signed-off-by: Oleksander Kostenko --- diff --git a/src/Conversation/AppControl/inc/LaunchSettings.h b/src/Conversation/AppControl/inc/LaunchSettings.h new file mode 100644 index 0000000..eb6df91 --- /dev/null +++ b/src/Conversation/AppControl/inc/LaunchSettings.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef _LAUNCH_SETTINGS_H_ +#define _LAUNCH_SETTINGS_H_ + +namespace Msg +{ + class LaunchSettings + { + public: + static void launch(); + }; +} + +#endif /* _LAUNCH_SETTINGS_H_ */ diff --git a/src/Conversation/AppControl/src/LaunchSettings.cpp b/src/Conversation/AppControl/src/LaunchSettings.cpp new file mode 100644 index 0000000..9e5c450 --- /dev/null +++ b/src/Conversation/AppControl/src/LaunchSettings.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "LaunchSettings.h" +#include + +using namespace Msg; + +void LaunchSettings::launch() +{ + app_control_h h; + app_control_create(&h); + app_control_set_operation(h, APP_CONTROL_OPERATION_SETTING); + app_control_set_app_id(h, "org.tizen.setting"); + app_control_send_launch_request(h, NULL, NULL); + app_control_destroy(h); +} diff --git a/src/Conversation/Main/Controller/inc/Conversation.h b/src/Conversation/Main/Controller/inc/Conversation.h index 03c9795..4c86eb8 100644 --- a/src/Conversation/Main/Controller/inc/Conversation.h +++ b/src/Conversation/Main/Controller/inc/Conversation.h @@ -110,6 +110,7 @@ namespace Msg // Popup callbacks: void onPopupDel(Evas_Object *popup, void *eventInfo); void onMsgSendErrorButtonClicked(Popup &popup, int buttonId); + void onMsgSettingsButtonClicked(Popup &popup, int buttonId); void onNoRecipCancelButtonClicked(Popup &popup, int buttonId); void onNoRecipDiscardButtonClicked(Popup &popup, int buttonId); void onDeleteItemPressed(PopupListItem &item); diff --git a/src/Conversation/Main/Controller/src/Conversation.cpp b/src/Conversation/Main/Controller/src/Conversation.cpp index f4c405b..f49f00c 100644 --- a/src/Conversation/Main/Controller/src/Conversation.cpp +++ b/src/Conversation/Main/Controller/src/Conversation.cpp @@ -28,6 +28,7 @@ #include "VoiceCall.h" #include "Viewer.h" #include "PopupRecipientListItem.h" +#include "LaunchSettings.h" #include #include @@ -659,8 +660,10 @@ void Conversation::showMobileDataPopup() { auto &popupMngr = getApp().getPopupManager(); Popup &popup = popupMngr.getPopup(); + popup.setTitle(msgt("IDS_MSG_HEADER_COULDNT_SEND_MESSAGE_ABB")); popup.addEventCb(EVAS_CALLBACK_DEL, EVAS_EVENT_CALLBACK(Conversation, onPopupDel), this); - popup.addButton(msgt("IDS_MSG_BUTTON_OK_ABB"), Popup::OkButtonId, POPUP_BUTTON_CB(Conversation, onMsgSendErrorButtonClicked), this); + popup.addButton(msgt("IDS_MSG_BUTTON_CANCEL_ABB2"), Popup::CancelButtonId, POPUP_BUTTON_CB(Conversation, onMsgSendErrorButtonClicked), this); + popup.addButton(msgt("IDS_MSGF_BODY_SETTINGS"), Popup::OkButtonId, POPUP_BUTTON_CB(Conversation, onMsgSettingsButtonClicked), this); popup.setContent(msgt("IDS_MSGC_POP_MOBILE_DATA_IS_DISABLED_ENABLE_MOBILE_DATA_AND_TRY_AGAIN")); popup.show(); } @@ -938,6 +941,13 @@ void Conversation::onMsgSendErrorButtonClicked(Popup &popup, int buttonId) popup.destroy(); } +void Conversation::onMsgSettingsButtonClicked(Popup &popup, int buttonId) +{ + MSG_LOG(""); + LaunchSettings::launch(); + popup.destroy(); +} + void Conversation::onNoRecipCancelButtonClicked(Popup &popup, int buttonId) { m_pBody->setFocus(true);