Add API to set the XDG app id

ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.

Fixes #1332
This commit is contained in:
Simon Hausmann 2024-11-20 15:23:11 +00:00 committed by Simon Hausmann
parent 10edaaa7f1
commit 1888e58735
11 changed files with 102 additions and 1 deletions

View file

@ -20,6 +20,11 @@ fn quit_event_loop() -> Result<(), errors::PyEventLoopError> {
slint_interpreter::quit_event_loop().map_err(|e| e.into())
}
#[pyfunction]
fn set_xdg_app_id(app_id: String) -> Result<(), errors::PyPlatformError> {
slint_interpreter::set_xdg_app_id(app_id).map_err(|e| e.into())
}
use pyo3::prelude::*;
#[pymodule]
@ -44,6 +49,7 @@ fn slint(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<value::PyStruct>()?;
m.add_function(wrap_pyfunction!(run_event_loop, m)?)?;
m.add_function(wrap_pyfunction!(quit_event_loop, m)?)?;
m.add_function(wrap_pyfunction!(set_xdg_app_id, m)?)?;
Ok(())
}

View file

@ -317,3 +317,6 @@ Model = models.Model
Timer = native.Timer
TimerMode = native.TimerMode
Struct = native.PyStruct
def set_xdg_app_id(app_id: str):
native.set_xdg_app_id(app_id)