|
|
@@ -1,6 +1,7 @@
|
|
|
#include <gui/canvas.h>
|
|
|
#include <gui/modules/menu.h>
|
|
|
#include <gui/modules/submenu.h>
|
|
|
+#include <gui/modules/variable_item_list.h>
|
|
|
|
|
|
/* generated by fbt from .png files in images folder */
|
|
|
#include <tone_gen_icons.h>
|
|
|
@@ -57,7 +58,17 @@ int setupViews(struct AppContext_t** appContext) {
|
|
|
playbackView->viewId = ToneGenAppView_PlaybackView;
|
|
|
playbackView->type = VIEW;
|
|
|
|
|
|
- // Add views to the app context for management later
|
|
|
+ FURI_LOG_I(TAG, "creating var-item-list view");
|
|
|
+ struct View_t* variableItemListView = malloc(sizeof(struct View_t));
|
|
|
+ FURI_LOG_I(TAG, "allocating view data");
|
|
|
+ variableItemListView->viewData = variable_item_list_alloc();
|
|
|
+ FURI_LOG_I(TAG, "setting view id");
|
|
|
+ variableItemListView->viewId = ToneGenAppView_VariableItemList;
|
|
|
+ FURI_LOG_I(TAG, "setting view type");
|
|
|
+ variableItemListView->type = VARIABLE_ITEM_LIST;
|
|
|
+ FURI_LOG_I(TAG, "moving on");
|
|
|
+
|
|
|
+ // Add views to the app context to be managed there
|
|
|
FURI_LOG_I(TAG, "Adding views to app context");
|
|
|
AppContextStatus result = addViewToAppContext(appContext, sharedMenuView);
|
|
|
if(result != APP_CONTEXT_OK) {
|
|
|
@@ -77,18 +88,12 @@ int setupViews(struct AppContext_t** appContext) {
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
- // Add views to the view dispatcher for usage later
|
|
|
- FURI_LOG_I(TAG, "Adding views to view dispatcher");
|
|
|
- view_dispatcher_add_view(
|
|
|
- (*appContext)->view_dispatcher,
|
|
|
- sharedMenuView->viewId,
|
|
|
- menu_get_view(sharedMenuView->viewData));
|
|
|
- view_dispatcher_add_view(
|
|
|
- (*appContext)->view_dispatcher,
|
|
|
- submenuView->viewId,
|
|
|
- submenu_get_view(submenuView->viewData));
|
|
|
- view_dispatcher_add_view(
|
|
|
- (*appContext)->view_dispatcher, playbackView->viewId, playbackView->viewData);
|
|
|
+ FURI_LOG_I(TAG, "Adding variable item list view");
|
|
|
+ result = addViewToAppContext(appContext, variableItemListView);
|
|
|
+ if(result != APP_CONTEXT_OK) {
|
|
|
+ FURI_LOG_E(TAG, "There was a problem adding the view %d!", variableItemListView->viewId);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
|
|
|
// On the playback view, ensure we only allocate for the model once
|
|
|
FURI_LOG_I(TAG, "allocating view model for playback");
|