setup: Connect ui to the state manager
This ensures that the layout type information is accessible to the state manager when new layout information arrive. The should be thought of as a stopgap measure. A proper solution would be to separate the state properly, and probably turn layout information coming from random places into messages that some object (thread?) collects and displays.
This commit is contained in:
@ -316,9 +316,14 @@ EekboardContextService *eekboard_context_service_new(void)
|
||||
{
|
||||
return g_object_new (EEKBOARD_TYPE_CONTEXT_SERVICE, NULL);
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_submission(EekboardContextService *context, struct submission *submission) {
|
||||
context->priv->submission = submission;
|
||||
if (context->priv->submission) {
|
||||
submission_set_keyboard(context->priv->submission, context->priv->keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_ui(EekboardContextService *context, ServerContextService *ui) {
|
||||
context->priv->ui = ui;
|
||||
}
|
||||
|
||||
@ -87,6 +87,7 @@ GType eekboard_context_service_get_type
|
||||
(void) G_GNUC_CONST;
|
||||
EekboardContextService *eekboard_context_service_new(void);
|
||||
void eekboard_context_service_set_submission(EekboardContextService *context, struct submission *submission);
|
||||
void eekboard_context_service_set_ui(EekboardContextService *context, ServerContextService *ui);
|
||||
void eekboard_context_service_destroy (EekboardContextService *context);
|
||||
LevelKeyboard *eekboard_context_service_get_keyboard(EekboardContextService *context);
|
||||
|
||||
|
||||
@ -201,7 +201,10 @@ fn load_layout_data_with_fallback(
|
||||
source, e
|
||||
),
|
||||
},
|
||||
Ok(layout) => return (kind, layout),
|
||||
Ok(layout) => {
|
||||
log_print!(logging::Level::Info, "Loaded layout {}", source);
|
||||
return (kind, layout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -288,6 +288,7 @@ main (int argc, char **argv)
|
||||
if (instance.dbus_handler) {
|
||||
dbus_handler_set_ui_context(instance.dbus_handler, instance.ui_context);
|
||||
}
|
||||
eekboard_context_service_set_ui(instance.settings_context, instance.ui_context);
|
||||
|
||||
session_register();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user