Skip to content

Commit 2679ffa

Browse files
authored
Merge pull request #262 from LedgerHQ/y333/set_tag_line_nbglHomeAndSettings
Enable to set a tagline when invoking NbglHomeAndSettings
2 parents bdf87ab + 533ded5 commit 2679ffa

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.github/workflows/get_rust_apps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# Excluded Rust apps
1212
# app-kadena-legacy: has been replaced by app-kadena
1313
# app-pocket: does not build (Obsidians' Alamgu issue)
14-
excluded_apps = ["app-kadena-legacy", "app-pocket"]
14+
# app-age: not maintained anymore
15+
excluded_apps = ["app-kadena-legacy", "app-pocket", "app-age"]
1516

1617
# Retrieve all public apps on LedgerHQ GitHub organization
1718
token = sys.argv[1]

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ledger_device_sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ledger_device_sdk"
3-
version = "1.22.7"
3+
version = "1.22.8"
44
authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"]
55
edition = "2021"
66
license.workspace = true

ledger_device_sdk/src/nbgl/nbgl_home_and_settings.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub enum PageIndex {
4747
/// information fields, and settings switches.
4848
pub struct NbglHomeAndSettings {
4949
app_name: CString,
50+
tag_line: Option<CString>,
5051
info_contents: Vec<CString>,
5152
info_contents_ptr: Vec<*const c_char>,
5253
setting_contents: Vec<[CString; 2]>,
@@ -74,6 +75,7 @@ impl<'a> NbglHomeAndSettings {
7475
pub fn new() -> NbglHomeAndSettings {
7576
NbglHomeAndSettings {
7677
app_name: CString::new("").unwrap(),
78+
tag_line: None,
7779
info_contents: Vec::default(),
7880
info_contents_ptr: Vec::default(),
7981
setting_contents: Vec::default(),
@@ -109,6 +111,13 @@ impl<'a> NbglHomeAndSettings {
109111
}
110112
}
111113

114+
pub fn tagline(self, tagline: &'a str) -> NbglHomeAndSettings {
115+
NbglHomeAndSettings {
116+
tag_line: Some(CString::new(tagline).unwrap()),
117+
..self
118+
}
119+
}
120+
112121
pub fn settings(
113122
self,
114123
nvm_data: &'a mut AtomicStorage<[u8; SETTINGS_SIZE]>,
@@ -202,7 +211,10 @@ impl<'a> NbglHomeAndSettings {
202211
nbgl_useCaseHomeAndSettings(
203212
self.app_name.as_ptr() as *const c_char,
204213
&self.icon as *const nbgl_icon_details_t,
205-
core::ptr::null(),
214+
match self.tag_line {
215+
None => core::ptr::null(),
216+
Some(ref tag) => tag.as_ptr() as *const c_char,
217+
},
206218
match self.start_page {
207219
PageIndex::Home => INIT_HOME_PAGE as u8,
208220
PageIndex::Settings(idx) => idx,
@@ -291,7 +303,10 @@ impl<'a> NbglHomeAndSettings {
291303
nbgl_useCaseHomeAndSettings(
292304
self.app_name.as_ptr() as *const c_char,
293305
&self.icon as *const nbgl_icon_details_t,
294-
core::ptr::null(),
306+
match self.tag_line {
307+
None => core::ptr::null(),
308+
Some(ref tag) => tag.as_ptr() as *const c_char,
309+
},
295310
match self.start_page {
296311
PageIndex::Home => INIT_HOME_PAGE as u8,
297312
PageIndex::Settings(idx) => idx,

0 commit comments

Comments
 (0)