Problems exporting and importing a dialogue

I wanted to transfer a dialogue from a text document to the live version. So
I went into the test doc "organise dialogs|Edit" window and exported the
dialogue, which was called "OneOff", to a file. Went into the live version,
found that I had to edit a dummy dialogue before I could import the saved
one, imported the file. And found that the new dialogue was called
"One-Off", which had been its name some days ago. I looked at the exported
.xdl file and there's a section saying So I have 2 questions/comments:

1) Why is the imported file getting a different name? Alternatively, why has
the exported file got an out-of-date ID?

2) Is there a way of importing a dialogue without having to edit a dummy
dialogue?

Hi Peter,

ptoye schrieb:

I wanted to transfer a dialogue from a text document to the live version. So
I went into the test doc "organise dialogs|Edit" window and exported the
dialogue, which was called "OneOff"

How do you make it 'called "OneOff"'?

, to a file. Went into the live version,

found that I had to edit a dummy dialogue before I could import the saved
one,

The document needs to have a library (likely 'Standard') and at least one module. Then you have an 'Import Dialog' in the toolbar in the module in the IDE. Because you need the module anyway for the macros to execute the dialog, first generate the module and then insert the dialog.

  imported the file. And found that the new dialogue was called

"One-Off", which had been its name some days ago. I looked at the exported
.xdl file and there's a section saying So I have 2 questions/comments:

1) Why is the imported file getting a different name? Alternatively, why has
the exported file got an out-of-date ID?

In my tests it gets the name of the tab in the Basic-IDE as value of the attribute 'dlg:id' and on import this value is used in the Basic-IDE as tab name. If such tab already exists, you get the option to rename or replace.

2) Is there a way of importing a dialogue without having to edit a dummy
dialogue?

See above, you need a module.

BTW, I find is useful to have an own toolbar for macros. I use the commands
'Edit Macros' = .uno:BasicIDEAppear (from category Application) and name it 'IDE'.
'LibreOffice Basic' = .uno:MacroOrganizer (from category BASIC) and name it 'Run'
'LibreOffice Basic Macro Organizer' = .uno:MacroOrganizer (fro, category BASIC) and name it 'Organize'
That make access quicker than via Tools > Macros.

Kind regards
Regina

Regina,

See my comments below.

Best regards, and a successful new year,

Peter
mailto:lo@ptoye.com
www.ptoye.com

Importing/exporting Basic modules and dialogs is easy when you do NOT store
everything in libraries named "Standard". Use the organizer to create a
library with a distinct project name within a template, document or in
global container "My Macros"
Move dialogs and code modules into the library.
Now you can create a simple macro extension from that library. There is an
[Export] button on the "Libraries" tab of the organizer which generates a
most simple oxt.
You can also import libraries directly from documents or from library
directories. There is an [Import] button on the same tab. You may also
import libraries from extracted extensions.

Andreas,

Thanks again. Regina's comment answered my questions. I'm not sure why you say it's best to avoid the "Standard" library, though. I tend to store my dialogues and macros within the document, as they're usually specific to the document. After all, a dialogue for updating my wines database would be pretty silly in my account spreadsheet :slight_smile:

Best regards,

Peter
mailto:lo@ptoye.com
www.ptoye.com