TizenRefApp-6565 Modify popup "mobile data is turned off" 03/77903/6
authorOleksander Kostenko <o.kostenko@samsung.com>
Fri, 1 Jul 2016 11:38:56 +0000 (14:38 +0300)
committerOleksander Kostenko <o.kostenko@samsung.com>
Mon, 4 Jul 2016 09:14:25 +0000 (12:14 +0300)
Change-Id: Ia74d32305406e1ebf9bedff64fe9f552a51bc465
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
src/Conversation/AppControl/inc/LaunchSettings.h [new file with mode: 0644]
src/Conversation/AppControl/src/LaunchSettings.cpp [new file with mode: 0644]
src/Conversation/Main/Controller/inc/Conversation.h
src/Conversation/Main/Controller/src/Conversation.cpp

diff --git a/src/Conversation/AppControl/inc/LaunchSettings.h b/src/Conversation/AppControl/inc/LaunchSettings.h
new file mode 100644 (file)
index 0000000..eb6df91
--- /dev/null
@@ -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 (file)
index 0000000..9e5c450
--- /dev/null
@@ -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 <app.h>
+
+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);
+}
index 03c9795..4c86eb8 100644 (file)
@@ -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);
index f4c405b..f49f00c 100644 (file)
@@ -28,6 +28,7 @@
 #include "VoiceCall.h"
 #include "Viewer.h"
 #include "PopupRecipientListItem.h"
+#include "LaunchSettings.h"
 
 #include <Elementary.h>
 #include <sstream>
@@ -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);