 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. 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. Users are happy because the functionality they need in LibreOffice is just a few clicks away. They can install an 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 like 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 phrases 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 a 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 lists 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. 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, yes. So I can add controls like this. I can move them around, hopefully, yeah, 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 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 with no localization of other languages 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 added here, the text they add here 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 the UI format. The dialogues were made to layout to where and yeah, they are now resizable and somehow like 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 just exists 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. And 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 hard coded. So this is no longer the case. That is hard coded. Then the next step was to create a small component that would open this dialogue. It would be, well, that's the technical detail that would be derived from this executable dialogue. And then 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. So this is also possible to do that in Glate, if you know Glate. There you can, 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. So the parser or the reader of those UI files was extended to read those signals. And 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. Well, couple of pipe dreams is that I will go a couple of slides back because I forgot about a slide. Hope, no. I don't have it there anymore. Never mind. So there's very convenient way how to access those controls in basic. Couple of convenient functions. So, well, 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 haven't asked well in anything. What did you think about it? No, I just couldn't wonder about in your current branch when you passed by a few generators the OS, the basements, you know how the current one, it can create a BCL one. Basic code works with out 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 I thought we might do initially was like that 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 GK one and it would say make VCL one. But then we could have seen another factory that would say create out control button and that way you'd configure it and then they really can't love that especially with basic ones and they would have all the different properties that are already now with it. Yeah, I think that's not of interest to everybody so we can maybe talk about that like offline. 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 great to open those UI files. Unfortunately like I can just open them and close them, that's nothing but for the purpose I needed that it was enough. Fair enough, thank you. Which between this, which between the slides it's a bit better than they both. You're calling the slides? Different modes, so slide and presenter, full presenters at the start or when answering questions. When there's a lot of detail on, just show the slide here, that makes a match. Do you have to do that live? It's not recording all the time. Yeah, if you're doing it live, why is it still showing? Hmm, it's a bit odd. Why is it doing that? Yeah. Yeah, so...