File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
rootfs/usr/share/inputplumber/schema Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 266266 },
267267 "dbus" : {
268268 "type" : " string" ,
269- "enum " : [
269+ "examples " : [
270270 " ui_guide" ,
271271 " ui_quick" ,
272272 " ui_context" ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ pub enum Action {
3535 Keyboard ,
3636 Screenshot ,
3737 Touch ,
38+ Custom ( String ) ,
3839}
3940
4041impl Action {
@@ -66,10 +67,14 @@ impl Action {
6667 Action :: Keyboard => "ui_osk" ,
6768 Action :: Screenshot => "ui_screenshot" ,
6869 Action :: Touch => "ui_touch" ,
70+ Action :: Custom ( _str) => "custom" ,
6971 }
7072 }
7173
7274 pub fn as_string ( & self ) -> String {
75+ if let Action :: Custom ( str) = self {
76+ return str. clone ( ) ;
77+ }
7378 self . as_str ( ) . to_string ( )
7479 }
7580}
@@ -105,7 +110,7 @@ impl FromStr for Action {
105110 "ui_osk" => Ok ( Action :: Keyboard ) ,
106111 "ui_screenshot" => Ok ( Action :: Screenshot ) ,
107112 "ui_touch" => Ok ( Action :: Touch ) ,
108- _ => Err ( ( ) ) ,
113+ _ => Ok ( Action :: Custom ( s . to_string ( ) ) ) ,
109114 }
110115 }
111116}
You can’t perform that action at this time.
0 commit comments