I have an hard nut to crack: a nice bottle of italian Chianti wine to the solver! 🙂
To automatically configure WiFi, I first have to kill the Network Manager and than activate the WiFi via the command-line: I do this all automatically in my application and works great.
However, it is not the right way to do this. As the user has no network GUI anymore to configure some other network access. A much better and transparent way would be to configure WiFi directly via Network Manager over the DBus interface. I was able to configure it, but I wasn't able to set it to ad hoc mode.
Searching the web for a while: a lot about configuration in general but nothing related to ad hoc mode.
I think the only way to do figure that out is to look into the source code of the Network Manager…maybe someone already did it and he can answer.