summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/edc/widgets/button.edc15
-rw-r--r--src/view/action_menu.c46
2 files changed, 60 insertions, 1 deletions
diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc
index a854c6b..116dbfd 100644
--- a/res/edc/widgets/button.edc
+++ b/res/edc/widgets/button.edc
@@ -3368,9 +3368,24 @@ group {
align: 0.5 1.0;
}
}
+ part {
+ name: "event";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
}
programs {
program {
+ name: "button_clicked";
+ signal: "mouse,clicked,1";
+ source: "event";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ program {
name: "focused";
signal: "elm,action,focus";
source: "elm";
diff --git a/src/view/action_menu.c b/src/view/action_menu.c
index 1560753..1946ed3 100644
--- a/src/view/action_menu.c
+++ b/src/view/action_menu.c
@@ -15,8 +15,10 @@
*/
#include <Elementary.h>
+#include <app_control.h>
#include <app_debug.h>
#include <app_contents.h>
+#include <app_define.h>
#include <inputmgr.h>
#include <viewmgr.h>
@@ -136,6 +138,45 @@ struct _content_info content_info[] = {
}
};
+static bool _livetv_clicked(struct _priv *priv)
+{
+ app_control_h app_ctrl;
+ int r;
+
+ r = app_control_create(&app_ctrl);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("failed to create app control handle");
+ return false;
+ }
+
+ r = app_control_set_operation(app_ctrl, APP_CONTROL_OPERATION_DEFAULT);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("failed to set app control operation");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ r = app_control_set_app_id(app_ctrl, APP_ID_LIVETV);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("failed to set app control app id");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ r = app_control_send_launch_request(app_ctrl, NULL, NULL);
+ if (r != APP_CONTROL_ERROR_NONE) {
+ _ERR("failed to send app control launch request");
+ app_control_destroy(app_ctrl);
+ return false;
+ }
+
+ app_control_destroy(app_ctrl);
+
+ viewmgr_hide_view(VIEW_ACTION_MENU);
+
+ return true;
+}
+
static bool _favorite_clicked(struct _priv *priv, Evas_Object *obj)
{
app_media_info *mi;
@@ -233,12 +274,15 @@ static void _clicked_cb(int id, void *data, Evas_Object *obj)
{
struct _priv *priv;
- if (!obj || !data)
+ if (!data || !obj)
return;
priv = data;
switch (id) {
+ case ACTION_LIVETV_BTN:
+ _livetv_clicked(priv);
+ break;
case ACTION_FAVORITE_BTN:
_favorite_clicked(priv, obj);
break;