 Green means enabled. How does this work? Fair enough, so I will talk about user interface again. This time from slightly different perspective and in particular from the perspective of LibreOffice extensions and macros and user interface inside. Is there anybody in this room who doesn't know what LibreOffice extension is? Everybody knows. Cool. So I don't have to explain. Every presentation has to contain a little cat, so here is the one. Fair enough. OK, so LibreOffice extensions are one of the few things in life or few occasions in life when you can have your cake and eat it too. So it's good for the users. The users are happy because the functionality they need in LibreOffice is just a few clicks away. They can install extension and I don't know, use their dictionary or have some functionality available that's not in core by default. And the core developers are at least not unhappy because the core is not polluted by all the functionality that is used by only limited group of people. There are some more critical views of this topic and if you want to hear them there will be a presentation or extensions about an hour later. So I suggest that you see that as well. So once upon a time on IRC there was a user who came in and asked that he's writing a Python macro and now he wants to open a dialogue from this macro and he's using PyQt and the LibreOffice freezes. So what can they do? And this is what I thought. Like using an external UI toolkits in combination with LibreOffice is really not a good idea but like what can you do? Sometimes if you write an extension or just a small macro it needs some user interaction. You need to ask user question or have them choose from multiple options so you need to have some means how to define user interface and how to add some dialogues or other user interface elements to your extensions. And fortunately LibreOffice comes with rather advanced set of tools to do just that. And here is some brief list of the user interface elements that you can add from the extensions and macros. I did not include notebook bar because I was not sure if it's possible to use notebook bar from the extension but I don't think it is so far. Okay, so you want to define a dialogue. How can you do that? For example like this. You probably don't want to do this. This is some very verbous Java code. I forgot to specify source. This is taken from the LibreOffice developers guide and it creates the dialogue in this very verbous way and adds all the controls on the fixed positions with the fixed size and you really don't want to do that. Another way. This looks like an XML, slightly less verbous and it defines a dialogue that just contains some, I think it's a combo box and that's it. But if you don't want to write XML manually there's another some end of 20, beginning of 21st century way to do that in a user friendly way that even like a non-technical user can have to define the user interface or dialogue in an extension and I will show that now. So the tool for that is hidden behind tools, macros and it's this organized dialogues menu. I will choose some, here you can see some list of dialogues I already have so this template changer is some extension I have already installed. I will show the dialogue it defines. So now I click edit and I have, how do I move this? I can't undo. Anyway, this is some kind of canvas, some kind of dialogue. Here in the toolbar I can drag and drop and add controls here. Hopefully, I can't do this. So I can add controls like this. I can move them around, hopefully. I can move them around. I can define their properties here in this kind of pane. For example, I don't know, I can change the font. Then I can have a look if I'm happy with the result and I can see a lane preview like this. So then there are also like further options. So for every control in the dialogue, you can define an interaction. You can connect it to some macro or to some function that will be executed when this event happens. So for example, in this particular extension, there's some file chooser or some text field where I can enter the file name. What I see over there, this template changer dot something, something is a link to the macro in my module or some subroutine or a function in my library that will be executed when this event happens. What I consider to be absolutely killer feature of this dialogue designer is how easily can a localization be added. So by clicking on this globe icon, I can define languages. So in my case, German is the default language of this extension. So if no localization or other language is added, the user interface will be in German. I have one more language here and I can add multiple languages from this choice of available languages. And then when I want someone to localize or when the translator wants to localize dialogue, they can just switch between the languages using this list box and then whatever they edit here, the text they adhere in this properties editor will be added to the translation or to the local file for that language. Then you simply save the thing and forward it to the extension author and then they have a nice new localization of your dialogue. Okay, but nobody's perfect. Neither is this way of adding dialogues to your user extensions. And here you can see why. So those dialogues are not resizable. Every control is placed on the fixed position and has a fixed size. That means if you design dialogue in this way, you have to optimize for the most verbous translation you can get and still you're not safe because the controls can get cropped and things can go wrong. But if you have been around LibreOffice development for a couple of years, then you will remember that some three years ago we solved exactly this problem in LibreOffice Core in a way that the UI, the new XML format for the definition of dialogues was introduced, it was this UI format. The dialogues were made layout to where and they are now resizable and somehow better positioned and better organized. So here are some days away and now how to do that in the LibreOffice extensions as well. It's a proof of concept. It's not finished. It doesn't just exist in my private branch but the idea is to have this modern dialogue format, the UI format, those dialogues to be loadable also from the extensions as well. There's a couple of steps how to get there. The first three of them are done already. The first step is that we accept the UI file or we are able to open the UI file from just about everywhere. The extension, the zip package, any URL. The biggest, like previously, it was only possible to... There was this soffice.cfg folder hardcoded so this is no longer the case that is hardcoded. The next step was to create a small component that would open this dialogue. That's the technical detail that would be derived from this executable dialogue. The next step is to... Well, I mentioned those user interactions and tying various events of user interface to the macros or to the functions. This is also possible to do that in Glate, if you know Glate. It's the signal element of the UI file where you can define what's going to happen when user clicks the button or the focus leaves the control or those things. The parser or the reader of those UI files was extended to read those signals. Now the most hard part of that is actually like to read those signals and to have the controls actually to do something. So this is not done yet and well, a couple of pipe dreams is that I will go a couple of slides back because I forgot about a slide. No, I don't have it there anymore. Never mind. So there's a very convenient way how to access those controls in basic. A couple of convenient functions. So what I've tried so far is that I loaded this UI code from the Java code. There's no convenience access methods to opening the dialogue onto the controls like the basic currently has. And one thing I feel sorry about is that if we load those UI files from the extensions we will use this killer localization feature. It will no longer be possible to add localization in this trivial and easy way. So that's about it and I have some five minutes to take questions. Yes? I've got a question about standardizing this is an awful amount of information passed permanently. I haven't asked Weil and anything. What are you doing? No, I was just going to wonder about in your current branch when you passed by a view generator the old placements, you know how the current one it will create a VCN fund that basically works without something? Yes. So in the small component I have just this like scope VCL pointer and then dialogue execute it only opens the dialogue. And then what I did not get that far I thought I would somehow there would be some crawler of this VCL builder and that would build this X dialogue model out of those controls that are inside. What you might do initially like the three or four years ago was that you'd have the parser itself with the kind of a hook and it would tell you what to generate depending on an extra factory argument. So you have the VCL one and it would say here's a GCL button and it would say make VCL button but then we could have seen another factory that would say create out control button and that way you'd configure it and then there would be a kind of that would be especially for the basic ones and they would have all the different properties that are working now with it. I think that's not of interest to everybody so we can maybe talk about that like offline. I still think it rocks. Yeah well I'm currently like the motivation like why I did this that like I wrote in the library of his extension and then some very important managing my job came and complained oh the text is cut off do something and I thought I can't do something easily because fix size, fix position and then I thought like it would be it would be great to open those those UI files. Unfortunately I can just open then I'm closed and that's nothing but for the purpose I needed that it was enough. Fair enough. Thank you. Why is it doing that? Thank you.