Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
3eb69875
Commit
3eb69875
authored
5 months ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
system: add help texts
parent
7b336734
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!738
system: add help texts
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
python_payload/st3m/main_menu.py
+41
-4
41 additions, 4 deletions
python_payload/st3m/main_menu.py
python_payload/st3m/settings_menu.py
+10
-0
10 additions, 0 deletions
python_payload/st3m/settings_menu.py
python_payload/st3m/ui/elements/menus.py
+8
-1
8 additions, 1 deletion
python_payload/st3m/ui/elements/menus.py
with
59 additions
and
5 deletions
python_payload/st3m/main_menu.py
+
41
−
4
View file @
3eb69875
...
...
@@ -234,12 +234,30 @@ class RestoreMenu(OSMenu):
class
ApplicationMenu
(
RestoreMenu
):
def
__init__
(
self
,
items
:
List
[
MenuItem
])
->
None
:
def
__init__
(
self
,
items
:
List
[
MenuItem
]
,
name
=
None
)
->
None
:
super
().
__init__
(
items
)
self
.
_button_latch
=
True
self
.
input
.
buttons
.
app
.
middle
.
repeat_enable
(
1000
,
1000
)
self
.
_vm
=
None
self
.
_update_tags
()
self
.
_name
=
name
def
get_help
(
self
):
if
self
.
_name
is
None
:
ret
=
f
"
This is an app launcher menu.
"
else
:
ret
=
f
"
This is the app launcher menu of the
{
self
.
_name
}
category.
"
ret
+=
"
\n\n
"
+
(
"
You can long-press the app button to open a context menu that
"
"
allows you to delete apps, sort them to the top of the list
"
'
with the
"
<3
"
option or start them automatically at boot with the
'
'"
boot
"
option.
'
)
ret
+=
"
\n\n
"
+
super
().
get_help
()
return
ret
def
_update_tags
(
self
):
for
item
in
self
.
_items
:
...
...
@@ -359,6 +377,16 @@ class MenuItemApplicationMenu(MenuItemForeground):
ctx
.
restore
()
class
SystemMenu
(
RestoreMenu
):
def
get_help
(
self
):
ret
=
(
"
This is the system menu of flow3r, where you can access the app store,
"
"
change settings, update your firmware and more!
"
)
ret
+=
"
\n\n
"
+
super
().
get_help
()
return
ret
class
MainMenu
(
SunMenu
):
def
__init__
(
self
,
bundles
:
Optional
[
list
]
=
None
)
->
None
:
if
bundles
:
...
...
@@ -369,6 +397,15 @@ class MainMenu(SunMenu):
self
.
load_menu
(
reload_bundles
=
False
)
def
get_help
(
self
):
ret
=
(
"
Welcome to flow3r! This is the main menu, where you can select different
"
"
app categories or download apps and updates and change settings
"
"
in the System option.
"
)
ret
+=
"
\n\n
"
+
super
().
get_help
()
return
ret
def
load_menu
(
self
,
reload_bundles
:
bool
=
True
)
->
None
:
"""
(Re)loads the menu.
...
...
@@ -382,10 +419,9 @@ class MainMenu(SunMenu):
def
build_menu_items
(
self
)
->
None
:
menu_settings
=
settings
.
build_menu
()
menu_system
=
Restore
Menu
(
menu_system
=
System
Menu
(
[
MenuItemBack
(),
MenuItemLaunchPersistentView
(
"
About
"
,
About
),
MenuItemForeground
(
"
Settings
"
,
menu_settings
),
MenuItemAppLaunch
(
BundleMetadata
(
"
/flash/sys/apps/gr33nhouse
"
)),
MenuItemAppLaunch
(
BundleMetadata
(
"
/flash/sys/apps/updat3r
"
)),
...
...
@@ -394,6 +430,7 @@ class MainMenu(SunMenu):
MenuItemAction
(
"
Yeet Local Changes
"
,
_yeet_local_changes
),
MenuItemAction
(
"
Clear Autostart
"
,
_clear_autostart
),
MenuItemAction
(
"
Reboot
"
,
machine
.
reset
),
MenuItemLaunchPersistentView
(
"
About
"
,
About
),
],
)
...
...
@@ -405,7 +442,7 @@ class MainMenu(SunMenu):
categories
=
[
MenuItemApplicationMenu
(
kind
,
ApplicationMenu
([
MenuItemApplicationBack
()]
+
entries
)
kind
,
ApplicationMenu
([
MenuItemApplicationBack
()]
+
entries
,
name
=
kind
)
)
for
kind
in
menu_categories
if
(
entries
:
=
_get_bundle_menu_entries
(
self
.
_bundles
,
kind
))
...
...
This diff is collapsed.
Click to expand it.
python_payload/st3m/settings_menu.py
+
10
−
0
View file @
3eb69875
...
...
@@ -214,6 +214,16 @@ class SettingsMenu(OSMenu):
super
().
select
()
self
.
captouch_active
=
onoff_touch_os
.
value
def
get_help
(
self
):
ret
=
(
"
This is the settings menu. Right now it
'
s a bit of a unstructured mix
"
"
with both user-facing and debug options, apologies! You probably don
'
t
"
'
want to use
"
Show FPS
"
,
"
Debug: ftop
"
and
"
Touch Overlay
"
in regular
'
"
operation as these may slow down or outright block regular functionality.
"
)
ret
+=
"
\n\n
"
+
super
().
get_help
()
return
ret
SIZE_LARGE
=
20
SIZE_SMALL
=
15
...
...
This diff is collapsed.
Click to expand it.
python_payload/st3m/ui/elements/menus.py
+
8
−
1
View file @
3eb69875
...
...
@@ -45,13 +45,20 @@ class SimpleMenu(MenuController):
item
.
draw
(
ctx
)
ctx
.
restore
()
def
get_help
(
self
):
ret
=
(
"
You can scroll though this menu with the app button left and right. To go
"
"
back use the os button middle, to go forward use the app button middle.
"
)
return
ret
class
OSMenu
(
SimpleMenu
):
def
get_help
(
self
):
if
self
.
captouch_active
:
ret
=
(
"
You can scroll though this menu by swiping across petals 2 and 8 or by
"
"
tapping the other top petals or the app button l
/r
. To go back use
"
"
tapping the other top petals or the app button l
eft/right
. To go back use
"
"
petals 1 or 9 or the os button middle, to go forward use petals 3 and 7
"
"
or the app button middle.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment