Bug 126389 - "New" in macro editing dialog does not create a new macro
Summary: "New" in macro editing dialog does not create a new macro
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillDesign, topicUI
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2019-07-14 19:20 UTC by Konstantin Kharlamov
Modified: 2021-07-18 13:42 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kharlamov 2019-07-14 19:20:13 UTC
# Steps to reproduce

1. Open `lowriter` or `localc` (reproducible in either)
2. Go to Tools → Macros → Edit Macros
3. Now, a macros editing window should appear. There, click the button that says "New" on it.

## Expected

A new empty macro should get created (probably should ask first about the language a user wants to use)

## Actual

An empty "lowriter" window gets opened (it works the same even if you followed the steps in "localc")
Comment 1 Oliver Brinzing 2019-07-15 17:06:04 UTC
(In reply to Konstantin Kharlamov from comment #0)
> ## Actual
> 
> An empty "lowriter" window gets opened (it works the same even if you
> followed the steps in "localc")

i can not confirm this with:

Version: 6.2.5.2 (x64)
Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: 

opens a macro editing window with

- My Macros & Dialogs
  - Standard
    - Module1
        Sub Main
        End Sub
Comment 2 Konstantin Kharlamov 2019-07-15 21:32:15 UTC
(In reply to Oliver Brinzing from comment #1)
> (In reply to Konstantin Kharlamov from comment #0)
> > ## Actual
> > 
> > An empty "lowriter" window gets opened (it works the same even if you
> > followed the steps in "localc")
> 
> i can not confirm this with:
> 
> Version: 6.2.5.2 (x64)
> Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159
> CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
> Locale: de-DE (de_DE); UI-Language: en-US
> Calc: 
> 
> opens a macro editing window with
> 
> - My Macros & Dialogs
>   - Standard
>     - Module1
>         Sub Main
>         End Sub

Are you sure you followed the steps correctly? I recorded a video over here https://youtu.be/m11cwKqgftc is it not what you see? (P.S.: nvm the broken panel it just glitched out. I'm on my way fixing a local KDE installation)
Comment 3 Oliver Brinzing 2019-07-16 17:13:48 UTC
(In reply to Konstantin Kharlamov from comment #2)

> Are you sure you followed the steps correctly? I recorded a video over here
> https://youtu.be/m11cwKqgftc is it not what you see?

the "New" icon is for creating new documuments, not form macro libs/modules

if you want to add a new basic module:

- create a new document
- Menu Tools/Macros/Organize Macros/Libreoffice Basic...
- select "Untitled 1"
- press [New] button
- enter module name
- press [OK]
Comment 4 Konstantin Kharlamov 2019-07-16 17:17:57 UTC
(In reply to Oliver Brinzing from comment #3)
> (In reply to Konstantin Kharlamov from comment #2)
> 
> > Are you sure you followed the steps correctly? I recorded a video over here
> > https://youtu.be/m11cwKqgftc is it not what you see?
> 
> the "New" icon is for creating new documuments, not form macro libs/modules
> 
> if you want to add a new basic module:
> 
> - create a new document
> - Menu Tools/Macros/Organize Macros/Libreoffice Basic...
> - select "Untitled 1"
> - press [New] button
> - enter module name
> - press [OK]

I understand that this button does not create a new macro. And this is the gist of the report: it's a window specifically for working with macros, and this button either shouldn't be here, or (which would better) it should create a new macro.

Otherwise, why would it open an lowriter window? Why not, for example, localc?
Comment 5 Xisco Faulí 2020-01-20 16:05:25 UTC
Hello Konstantin Kharlamov,
A new major release of LibreOffice is available since this bug was reported.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 Konstantin Kharlamov 2020-01-25 20:12:34 UTC
(In reply to Xisco Faulí from comment #5)
> Hello Konstantin Kharlamov,
> A new major release of LibreOffice is available since this bug was reported.
> Could you please try to reproduce it with the latest version of LibreOffice
> from https://www.libreoffice.org/download/libreoffice-fresh/ ?
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the latest version.

Still reproducible in 6.3.4.2. Text from "about" window:

    Version: 6.3.4.2.0+
    Build ID: 6.3.4-2
    CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3;
    Locale: ru-RU (ru_RU.UTF-8); UI-Language: en-US
    Calc: threaded
Comment 7 Regina Henschel 2020-01-25 21:39:25 UTC
(In reply to Konstantin Kharlamov from comment #0)
> # Steps to reproduce
> 
> 1. Open `lowriter` or `localc` (reproducible in either)
> 2. Go to Tools → Macros → Edit Macros
> 3. Now, a macros editing window should appear. There, click the button that
> says "New" on it.
> 
> ## Expected
> 
> A new empty macro should get created (probably should ask first about the
> language a user wants to use)

That is the general tool for new documents. That exists in all modules. You see it too in the Math-Editor and in the Chart-Editor. It behaves the same in all places. Simple click uses the current preselected kind of action, for other actions open the list by clicking on the triangle and select the action.

BTW: It is a BASIC IDE, you cannot use it for other programming languages than BASIC.

For to get a new "macro", you simple write it. For getting a new module right-click the tabbar and choose item Insert > Basic-Module.
Comment 8 Konstantin Kharlamov 2020-01-25 21:54:15 UTC
(In reply to Regina Henschel from comment #7)
> (In reply to Konstantin Kharlamov from comment #0)
> > # Steps to reproduce
> > 
> > 1. Open `lowriter` or `localc` (reproducible in either)
> > 2. Go to Tools → Macros → Edit Macros
> > 3. Now, a macros editing window should appear. There, click the button that
> > says "New" on it.
> > 
> > ## Expected
> > 
> > A new empty macro should get created (probably should ask first about the
> > language a user wants to use)
> 
> That is the general tool for new documents. That exists in all modules. You
> see it too in the Math-Editor and in the Chart-Editor. It behaves the same
> in all places. Simple click uses the current preselected kind of action, for
> other actions open the list by clicking on the triangle and select the
> action.

If opening a new lowriter/localc window is an intended behavior of this button, then IMO it's better to remove it whatsoever. A user can open a new LO instance for example by clicking File → New inside already opened lowriter/local window. Having this button in IDE (and probably in math-editor and chart-editor) only creates a confusion. I don't know what chart-editor looks like, but from the hearing of that I see no reason why I would expect a "New" button not to create a new chart but rather to create an LO instance.

Suppose you clicked "New" button inside localc. Do you expect it to open an lowriter instance or localc? If the latter, then this is because buttons inside any given program window should match the functional that this window is intended to provide. I see no reason why it should hold for localc but not for macros-editor or chart-editor.
Comment 9 Buovjaga 2020-05-01 18:16:58 UTC
Then let's submit this to the UX jury
Comment 10 Heiko Tietze 2020-05-04 14:02:34 UTC
All modules place the shortcut (and default action) on the current module except the macro editor. How about adding Organize Macros (.uno:ScriptOrganizer) in this case?
Comment 11 Konstantin Kharlamov 2020-05-04 14:26:02 UTC
(In reply to Heiko Tietze from comment #10)
> All modules place the shortcut (and default action) on the current module
> except the macro editor. How about adding Organize Macros
> (.uno:ScriptOrganizer) in this case?

I am not sure what dialog you're referring to. I found a submenu like:

    Tools → Organize Macros → Basic…
                             → BeanShell…
                             → JavaScript…
                             → Python…

Did you mean, showing one of the four dialogs here, depending on what language is currently chosen? If yes, then doesn't sound bad to me. I see the dialogs has a "Create" button. Although I don't like the fact that this "Create" button would duplicate functional of the "New" button in the usecase being discussed (i.e. because a user already showed desire to create a new document by pressing "New", there's no need for them to press "Create" in addition to that), but I guess working around that would requires to create a whole new dialog, lots of work.


So, I'd say, while not ideal, this is definitely better than the current behavior.
Comment 12 Heiko Tietze 2021-05-31 13:23:14 UTC
Let's update menu and toolbar and replace the New/Open functions by something that suits better the Basic IDE. 

Code pointer are:

 basctl/uiconfig/basicide/menubar/menubar.xml
 basctl/uiconfig/basicide/toolbar/standardbar.xml
Comment 13 Roman Kuznetsov 2021-05-31 14:58:50 UTC
(In reply to Heiko Tietze from comment #12)
> Let's update menu and toolbar and replace the New/Open functions by
> something that suits better the Basic IDE. 
> 
> Code pointer are:
> 
>  basctl/uiconfig/basicide/menubar/menubar.xml
>  basctl/uiconfig/basicide/toolbar/standardbar.xml

We already have .uno:MacroDialog and .uno:MacroOrganizer on Standard toolbar. We can just move it to the left side of the toolbar. And (possibly!) we can hide  .uno:AddDirect command there

And we can add .uno:MacroDialog and .uno:MacroOrganizer into File main menu for Basic IDE and do some reorganize for File menu too

What do you think?
Comment 14 Heiko Tietze 2021-05-31 18:32:50 UTC
(In reply to Roman Kuznetsov from comment #13)
> What do you think?

Sounds okay, I'd leave it to the doer to decide what functions are suited best on Basic's standard toolbar and main menu. Set difficulty to medium therefore, the hack itself is simple.
Comment 15 Regina Henschel 2021-05-31 19:16:21 UTC
If you have Basic IDE open and an document open, and when you then close the document, you do not get the splash screen, but you have only the Basic IDE. So the Basic IDE needs the options to open and to create new documents. Please keep that in mind, when changing the UI of Basic IDE.
Comment 16 Roman Kuznetsov 2021-07-18 13:42:28 UTC
I talked with people who uses Basic IDE every day. They don't have problem with current menu or toolbars. They want just addition useful tools, but it's another topic.

And I don't like those menu and toolbar changings that I tried do locally