Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to load custom OID maps #32

Closed
ralienpp opened this issue Nov 20, 2023 · 10 comments
Closed

Add ability to load custom OID maps #32

ralienpp opened this issue Nov 20, 2023 · 10 comments

Comments

@ralienpp
Copy link

A small usability improvement would be to let the user right-click on an object identifier and give it a human-readable alias.

image

This would make it easier to orient oneself within the data structure.

Perhaps the program could load these from a CSV file located in a particular place - this way the feature could work without having to make any changes in the GUI. Thus, everyone could maintain their own library of proprietary OIDs or share the list within a working group.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 20, 2023

Actually, it is already there. See "OID lookup" section in latest release notes: https://github.com/PKISolutions/Asn1Editor.WPF/releases/tag/v23.10.24

Currently, I ship a pre-created OID.txt file and it is placed along with executable. It is not recommended to update it, because your edits will be lost with upgrade, this is why I've added a custom location in roaming user profile folder to store custom OID lookup table.

Speaking about a context-menu: maybe it is a good idea.

@ralienpp
Copy link
Author

Thanks for the tip, this is very helpful.

Exposing this option in the context menu would improve discoverability, in my opinion; because this is the natural place for one to stumble upon it.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 21, 2023

Wouldn't you mind to test the implementation of OID mapping editor? Here is what I've come right now. On OBJECT_IDENTIFIER tree node's context menu there is a new menu item:
image
which will invoke the editor dialog:
image
and pre-populate OID Value field with OID OID value from selected element. Here you can provide friendly name and save. Save button will attempt to save OID.txt in your user's %appdata% folder immediately.

Current logic is that if both OID.txt files (in application and in %appdata%) contain same definition, user-defined mapping will take precedence (overwrite value from application's OID.txt).

In addition to that, you can view and search existing OID lookup by either OID (or its beginning) or friendly name (contains part) in either, application or user lookups, or both.

There is no Edit action. If you want to override existing mapping (say, provide a different name to an OID registered in application's OID.txt), you should remove existing OID, it will copy oid into editor for recovery purposes and save it again. Any edits will save OID in %appdata%.

Note: edits will not affect existing opened tabs, only newly opened tabs. Reloading all tabs can be somewhat problematic if there are unsaved changes.

Any time, you can invoke this editor from main toolbar:
image
Currently, without an icon.

And as the last note: it seems OID DB is quite large and WPF UI may struggle a little-bit on this. This is why I set default source to User-Defined, it is supposed to contain only custom OIDs and overrides and have less impact on a UI.

@ralienpp
Copy link
Author

Thanks for the feedback, I'd be happy to test it. Where can I download the binary?

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 22, 2023

Asn1Editor-23.11.22.zip
Here is the build to test.

@ralienpp
Copy link
Author

It works, thanks a lot!

edits will not affect existing opened tabs, only newly opened tabs. Reloading all tabs can be somewhat problematic if there are unsaved changes.

Understood, that's fine by me; though a low-hanging fruit would be to reload automatically for tabs that do not have edits.

Some other points:

  • If I right-click on an OID node with a known name, the menu option could be called "Edit Object Identifier", rather than "Register Object Identifier"
  • Accessing the OID editor through the main menu only is also fine, it is not imperative that the feature is present on the toolbar with an icon. However, if you insist on having an icon - I would consider having a picture of a book - a dictionary.
  • You can make the "Friendly Name" column wider by default; right now the first 3 fields are limited in width and there's a lot of unclaimed space on the right side. At a minimum - make the field widths "sticky"; i.e., if I manually resize it once - then use the same widths the next time the dialog is shown.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 22, 2023

  • If I right-click on an OID node with a known name, the menu option could be called "Edit Object Identifier", rather than "Register Object Identifier"

sounds reasonable.

  • However, if you insist on having an icon - I would consider having a picture of a book - a dictionary.

Ok, will find something in my collection.

You can make the "Friendly Name" column wider by default

Ok. I just checked the most comfortable width for OID column by measuring existing OID list plus some extra space and set Friendly name column to fit column in normal window size plus scrollbar.

At a minimum - make the field widths "sticky"; i.e., if I manually resize it once - then use the same widths the next time the dialog is shown.

well, I can try to implement this within current session. I mean, they won't be saved in settings file. The reason is how settings are handled: I'm trying to overwrite the file immediately when setting is changed. When you resize the column, it will flood with width changed events and with every event it will try to overwrite the file and will eventually crash because previous event handler didn't finish and the file will be locked.

  • Accessing the OID editor through the main menu only is also fine

I think it can be accessed from both places, context menu and main toolbar. The behavior will be slightly different, from context menu the OID value is automatically copied to editor form.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 22, 2023

Asn1Editor-23.11.22.zip
Ok, here is another build which addresses most of your feedback.

  • Context menu item header is updated
  • Added icon to toolbar
  • Now OID mapping changes will immediately reflect in all tabs.
  • Adjusted column widths, however they are not persistent. I don't think I want to spend too much time on this.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 22, 2023

There is one more update: OID Editor window respects font size settings. If you set it to 16, then all controls in the window will receive new font size.

@Crypt32
Copy link
Collaborator

Crypt32 commented Nov 24, 2023

Here is the official release with requested functionality: https://github.com/PKISolutions/Asn1Editor.WPF/releases/tag/v23.11.24

@Crypt32 Crypt32 closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants