@@ -84,6 +84,27 @@ impl Service {
8484 }
8585 }
8686
87+ async fn configure_l10n ( & self , config : api:: l10n:: SystemConfig ) -> Result < ( ) , Error > {
88+ self . l10n
89+ . call ( l10n:: message:: SetSystem :: new ( config. clone ( ) ) )
90+ . await ?;
91+ if let Some ( locale) = config. locale {
92+ self . storage
93+ . cast ( storage:: message:: SetLocale :: new ( locale. as_str ( ) ) ) ?;
94+ }
95+ Ok ( ( ) )
96+ }
97+
98+ async fn activate_storage ( & self ) -> Result < ( ) , Error > {
99+ self . storage . call ( storage:: message:: Activate ) . await ?;
100+ Ok ( ( ) )
101+ }
102+
103+ async fn probe_storage ( & self ) -> Result < ( ) , Error > {
104+ self . storage . call ( storage:: message:: Probe ) . await ?;
105+ Ok ( ( ) )
106+ }
107+
87108 async fn install ( & mut self ) -> Result < ( ) , Error > {
88109 self . state = State :: Installing ;
89110 self . events . send ( Event :: StateChanged ) ?;
@@ -102,17 +123,6 @@ impl Service {
102123 self . events . send ( Event :: StateChanged ) ?;
103124 Ok ( ( ) )
104125 }
105-
106- async fn configure_l10n ( & self , config : api:: l10n:: SystemConfig ) -> Result < ( ) , Error > {
107- self . l10n
108- . call ( l10n:: message:: SetSystem :: new ( config. clone ( ) ) )
109- . await ?;
110- if let Some ( locale) = config. locale {
111- self . storage
112- . cast ( storage:: message:: SetLocale :: new ( locale. as_str ( ) ) ) ?;
113- }
114- Ok ( ( ) )
115- }
116126}
117127
118128impl Actor for Service {
@@ -250,6 +260,12 @@ impl MessageHandler<message::RunAction> for Service {
250260 Action :: ConfigureL10n ( config) => {
251261 self . configure_l10n ( config) . await ?;
252262 }
263+ Action :: ActivateStorage => {
264+ self . activate_storage ( ) . await ?;
265+ }
266+ Action :: ProbeStorage => {
267+ self . probe_storage ( ) . await ?;
268+ }
253269 Action :: Install => {
254270 self . install ( ) . await ?;
255271 }
0 commit comments