Opened 7 years ago

Closed 6 years ago

#4967 closed defect (invalid)

OMEdit does not allow to see the text code of packages with annotation(preferredView="info")

Reported by: Francesco Casella Owned by: Adeel Asghar
Priority: high Milestone: 1.13.0
Component: OMEdit Version:
Keywords: Cc:

Description

Open the Modelica.Media libray with the package browser of OMEdit. The documentation shows up in the documentation library as required by the preferredView="info" annotation.

However, if I click on the Text View button, nothing happens. I guess this is a bug: the Text view is not preferred, but that doesn't mean banned or forbidden.

Please make sure it is still possible to open also these classes in Text View. This is essential for library development.

Attachments (1)

screenshot.png (165.3 KB ) - added by Francesco Casella 6 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Adeel Asghar, 6 years ago

Resolution: worksforme
Status: newclosed

This works perfectly fine for me using,

OMEdit v1.13.0-dev-134-gba22c5af (64-bit)
Connected to v1.13.0-dev-826-g008d2d22c (64-bit)

Loaded MSL and then double clicked on the Modelica.Media and the documentation browser is shown because of the preferredView="info" annotation. Right click on Modelica.Media and choose View Text.

comment:2 by Francesco Casella, 6 years ago

Resolution: worksforme
Status: closedreopened

Right-click + View text works

However, double clicking on the package icon in the Libraries browser (which shows the Info layer) and then clicking on the Text View button of the editor window (which is normally what I do to toggle between different views of a class) doesn't work in OMEdit v1.13.0-dev-131-g991c06b4 (64-bit).

comment:3 by Adeel Asghar, 6 years ago

But there is no editor window. Start OMEdit, browse to Modelica.Media, double click to view the Info layer.

Which editor window are you talking about?

by Francesco Casella, 6 years ago

Attachment: screenshot.png added

comment:4 by Francesco Casella, 6 years ago

See attached screenshot.

When I double click on Modelica.Media, the documentation shows up on the right side of the screen, as expected, and this is fine. However, I would also expect the text of the packagee to show up in the window circled in red, at least if I click on the button circled in orange. This is what happens when I double click on all the classes in the Libraries Browser that do not have preferredView=Info, and I find the fact that it doesn't happen with these ones quite confusing.

Maybe my mental model of the GUI is wrong, but after 15+ years using Dymola and a couple of years using OMEdit seriously, I would have expected the behaviour described above. Particularly as a library developer.

BTW, the fact that the documentation view is preferred doesn't mean that the text view should be hidden.

in reply to:  4 comment:5 by Adeel Asghar, 6 years ago

Replying to casella:

See attached screenshot.

When I double click on Modelica.Media, the documentation shows up on the right side of the screen, as expected, and this is fine. However, I would also expect the text of the packagee to show up in the window circled in red, at least if I click on the button circled in orange. This is what happens when I double click on all the classes in the Libraries Browser that do not have preferredView=Info, and I find the fact that it doesn't happen with these ones quite confusing.

Of course the other classes might not have the preferredView annotation. In that case diagram view is show as default.

Maybe my mental model of the GUI is wrong, but after 15+ years using Dymola and a couple of years using OMEdit seriously, I would have expected the behaviour described above. Particularly as a library developer.

The Dymola design is different. In Dymola documentation window is part of the center main window. Even in Dymola you have to click on the text view to see the Modelica text. In OMEdit we have documentation window as independent window on the right dock.

BTW, the fact that the documentation view is preferred doesn't mean that the text view should be hidden.

The text view is not hidden. It is just not shown since the preferredView for the class is info. If you want to see the text then set preferredView=text. The documentation view is shown when the class has preferredView annotation as info or DocumentationClass annotation true.

There is some discussion about it in #2249 where Martin asked for this functionality.

comment:6 by Francesco Casella, 6 years ago

OK, looking at #2249 I guess I now see what the problem is. The behaviour of the GUI should be different depending on whether you are using a library or developing it. In the first case the current behaviour is just fine. In the second case I find it a bit awkward.

Maybe we should introduce a "Library Developer Mode" option in OMEdit?

comment:7 by Adeel Asghar, 6 years ago

Resolution: invalid
Status: reopenedclosed

After the discussion in today's OSMC dev meeting, its clear that the current behavior is correct. So I am closing this ticket.

Note: See TracTickets for help on using tickets.