Opened 12 years ago
Closed 7 years ago
#1857 closed enhancement (fixed)
Simplify adding new models
Reported by: | Per Östlund | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | low | Milestone: | 1.12.0 |
Component: | OMEdit | Version: | trunk |
Keywords: | Cc: | Per Östlund |
Description
Right now it's a bit clunky when adding new classes, where you have to select which package to add it to. It would be easier for users to be able to just add classes to whatever class they select. One way of doing this is by extending the right-click menu with a submenu from which you can choose the type of class to add, so that a user can just right-click on any class in the list and choose to add a new class in it.
Also, it's not only package that may contain other classes, so we have to check what kind of class we're trying to add to so that we know what we're allowed to add to it. See section 4.6 in the Modelica specification for what the different classes are allowed to contain.
Change History (13)
comment:1 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
That's great, but it only solves the first part of the issue. Adding a class to another non-package class results in that class being added to the top scope instead of to the non-package class. I.e. if you have a package P which contains a class C, then right-clicking on C and adding a new class will add it to the top-scope instead of to P.C.
It's possible to manually fill in the "Insert in class" field with the appropriate class though. So manually filling in P.C will actually work as intended, even if P.C is not in the drop-down list. So a simple soluation is to have OMEdit fill in this field with the path of the class the user right-clicked on. It might also be a good idea to hide this field from the user to avoid confusion in this case.
OMEdit should probably also enforce the class restriction rules in section 4.6 of the specification. For example, operators may only contain functions and no other type of class.
comment:3 by , 12 years ago
Replying to perost:
That's great, but it only solves the first part of the issue. Adding a class to another non-package class results in that class being added to the top scope instead of to the non-package class. I.e. if you have a package P which contains a class C, then right-clicking on C and adding a new class will add it to the top-scope instead of to P.C.
It's possible to manually fill in the "Insert in class" field with the appropriate class though. So manually filling in P.C will actually work as intended, even if P.C is not in the drop-down list. So a simple soluation is to have OMEdit fill in this field with the path of the class the user right-clicked on. It might also be a good idea to hide this field from the user to avoid confusion in this case.
It should work fine now with r15689.
OMEdit should probably also enforce the class restriction rules in section 4.6 of the specification. For example, operators may only contain functions and no other type of class.
Yes, we can follow the rules defined in Modelica specificaiton but for now its fine. You are literally allowed to insert anything within anything.
follow-up: 13 comment:4 by , 12 years ago
Priority: | high → low |
---|
Yes, I think it works fine now. There's a couple of things that could be improved, so let's keep the ticket open for now but with lower priority.
Also, it would be nice to be able to right-click on an empty spot in the library list and be able to add a new class. It's not really important since you can just click on the "New Modelica Class" icon instead, but I kind of expected that to work.
comment:6 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:7 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:12 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone changed to 1.12.0 since 1.11.0 was released.
comment:13 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to perost:
Yes, I think it works fine now. There's a couple of things that could be improved, so let's keep the ticket open for now but with lower priority.
Also, it would be nice to be able to right-click on an empty spot in the library list and be able to add a new class. It's not really important since you can just click on the "New Modelica Class" icon instead, but I kind of expected that to work.
Its possible now to right click on an empty spot and be able to create new class. 095b0e/OMEdit.
Now you can add new models/classes by right clicking the existing classes.