summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-16 06:43:20 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-16 06:43:20 (GMT)
commite65343f50ce20060c5209d052a36a614fc4026d2 (patch)
treef2b8f22087328195be43390c317d40fd477c5677
parent00a7149100b41db93f4a10e91ae8fd88c988fc11 (diff)
downloadeulogium-e65343f50ce20060c5209d052a36a614fc4026d2.zip
eulogium-e65343f50ce20060c5209d052a36a614fc4026d2.tar.gz
eulogium-e65343f50ce20060c5209d052a36a614fc4026d2.tar.bz2
[griffin.hmi] use new and updated menu-widget using buttons, checkboxes and radio buttons
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
-rw-r--r--src/eulogium.c18
-rw-r--r--src/eulogium.h5
2 files changed, 15 insertions, 8 deletions
diff --git a/src/eulogium.c b/src/eulogium.c
index cd3fa62..85dd652 100644
--- a/src/eulogium.c
+++ b/src/eulogium.c
@@ -331,7 +331,7 @@ static struct menu_def menu_system_settings = {
{
.icon = "user-home",
.label = gettext_noop("Return"),
- .end = NULL,
+ .item = {.type = LIST_ITEM_BUTTON},
.footer = gettext_noop("Return to Main menu"),
.footer_alt = NULL,
.func = &_cb_content_prev_set,
@@ -340,7 +340,7 @@ static struct menu_def menu_system_settings = {
}, {
.icon = NULL,
.label = "Language",
- .end = NULL,
+ .item = {.type = LIST_ITEM_BUTTON},
.footer = "Change language",
.footer_alt = NULL,
.func = &_but_settings_language_cb,
@@ -349,7 +349,7 @@ static struct menu_def menu_system_settings = {
}, {
.icon = NULL,
.label = "Network",
- .end = NULL,
+ .item = {.type = LIST_ITEM_BUTTON},
.footer = "Manage connectivity",
.footer_alt = "WiFi &amp; Ethernet",
.func = &_but_settings_network_cb,
@@ -358,7 +358,7 @@ static struct menu_def menu_system_settings = {
}, {
.icon = NULL,
.label = "Hot end 1 offset",
- .end = NULL,
+ .item = {.type = LIST_ITEM_BUTTON},
.footer = "Adjust offset",
.footer_alt = NULL,
.func = &_but_settings_hotend_1_offset_cb,
@@ -465,7 +465,7 @@ static struct menu_def menu_settings_network = {
{
.icon = "user-home",
.label = "Return",
- .end = NULL,
+ .item = {.type = LIST_ITEM_BUTTON},
.footer = "Return to Main menu",
.footer_alt = NULL,
.func = &_cb_content_prev_set,
@@ -492,7 +492,11 @@ static struct menu_def menu_settings_network = {
}, {
.icon = NULL,
.label = "WiFi",
- .end = EINA_TRUE,
+ .item = {
+ .type = LIST_ITEM_CHECK,
+ .state = EINA_FALSE,
+ },
+ .end = NULL,
.footer = NULL,
.footer_alt = NULL,
.func = NULL,
@@ -2380,7 +2384,7 @@ static void _menu_generate_menulist(struct eulogium_data *eulogium, Evas_Object
} else {
icon = NULL;
}
- item = eulogium_item_list_append(list, icon, entry[i].label, NULL, entry[i].func, eulogium); /*XXX TODO pass data from struct */
+ item = eulogium_item_list_append(list, icon, entry[i].label, &entry[i].item, entry[i].func, eulogium);
entry[i].data = eulogium->footer; /* XXX ugly-ness keeps adding. The footer widget should not be passed like this :( */
evas_object_smart_callback_add(item, "focused", _update_menu_footer_focus_cb, &entry[i]);
evas_object_smart_callback_add(item, "unfocused", _update_menu_footer_unfocus_cb, &entry[i]);
diff --git a/src/eulogium.h b/src/eulogium.h
index 186258e..f46d22f 100644
--- a/src/eulogium.h
+++ b/src/eulogium.h
@@ -7,6 +7,8 @@
#include <Eldbus.h>
#include <stdint.h>
+#include "eulogium_item_list.h"
+
enum screen_type {
NONE,
FUNC,
@@ -114,7 +116,8 @@ struct button_def {
struct menu_entry_def {
const char *icon;
const char *label;
- Eina_Bool end;
+ struct list_item item;
+ Eina_Bool *end; /* remove me */
const char *footer; /* Primary footer */
const char *footer_alt; /* Alternating footer */
Ecore_Timer *toggle_timer;