Skip to content

Add file dialog for TLE selection - #82

Merged
aweeri merged 8 commits into
aweeri:extremelywipfrom
AndreHauschild:tleFileDialog
Nov 5, 2026
Merged

aweeri merged 8 commits into
aweeri:extremelywipfrom
AndreHauschild:tleFileDialog

Conversation

@AndreHauschild

Copy link
Copy Markdown

Dear TLEscope developers, dear Aria,

my most frequent use of TLEscope will be working with historical TLE data using local files. I have therefore implemented a simple file dialog as an additional element in the Data Sources panel. I believe this could be interesting for other users as well and I would be happy if you could consider including this feature in the upcoming new release of TLEscope.

This pull request is intended to share and discuss the current status with you. I would appreciate your feedback and suggestions about the implementation and I am happy to make further modifications to it if needed.

I have tested loading files on Ubuntu Linux and Windows 11. I have so far only checked the 3LE format, but since I am re-using the format auto-detection code I am somewhat optimistic that it will also work for the other supported formats.

I hope you find this useful and I am looking forward to hearing from you.

@aweeri

aweeri commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Hi! At first glance I am open to the idea, however wouldnt it be simpler to delegate file picker to the OS itself instead of writing it from scratch?

@AndreHauschild

Copy link
Copy Markdown
Author

Yes, that is a good point! I did not think of this. The self-written one has the same "look and feel" as TLEscope, but that should probably be sacrificed over the advantage of having the more advanced features of a native dialog. I will think about it and see how I can adapt the implementation.

If you have a chance to check-out the current version, I'd still appreciate any other feedback or suggestions you might have. One issue I am already aware of is that the file content is not checked for the presence of the mandatory object name (line 0) prior to loading. I noticed that this is implemented for the custom paste input. Any suggestion where to best put that check for the file input would be welcome.

@aweeri

aweeri commented Nov 1, 2026

Copy link
Copy Markdown
Owner

From my initial testing it builds fine and appears to work alright, there definitely is a big performance issue when opening a subdirectory (likely UI file picker related, so I'd skip analysing this for now). I tested KVN OMM and CSV OMM and they worked just fine so the rest likely does as well.

as for the check; I would put it in FetchFromCustomFile(), right after it calls DetectDataFormat().

Paste can check early because the text is already in memory. A file only stores the path, and the file isn't read until pull time - and that read happens in FetchFromCustomFile(). So that's the first place the content exists, and it's the one spot every file load goes through.

One more thing I noticed when writing this response:
The name-line check is currently a static function in tool_data_sources.cpp:89. Moving it somewhere shared like omm_parser.h would likely be a clean way to do it, so that both the paste and file paths can use the same code.

@AndreHauschild
AndreHauschild marked this pull request as draft November 2, 2026 08:32
@AndreHauschild
AndreHauschild marked this pull request as ready for review November 3, 2026 20:39
@AndreHauschild

Copy link
Copy Markdown
Author

Okay, this is a re-worked implementation based on portable-file-dialogs, which uses the native OS file picker. I was able to condense the code in the file dialog implementation down to just a fraction of what it used to be. File dialog settings like title and file filters are customizable, so it can be used for other file inputs as well. I am actually using this also for my custom tool, where I need to load other file-based data.

I have tested it on Ubuntu Linux and Windows 11. The check for 3LE format is now also implemented and I have moved it in the end to provider.h/.cpp close to DetectDataFormat(). I think that is a good place for it.

Please let me know if you think this could be part of the new release. Before merging this into extremelywip, I think I would prefer to create a new branch, put all the changed files in there with just one commit and make a new pull request. I don't think you want to see all my trials and tribulations in the revision history.

@aweeri

aweeri commented Nov 3, 2026

Copy link
Copy Markdown
Owner

I really like it! I have some minor tweaks I'd like to do, like fixing the file dialog on windows filering for "TLE files" by default, which isnt intended i think-

But I'm down to merge it as is and polish it from there.

As for the separate branch- i dont think that's needed, I can simply squash merge it into one commit. If you're alright with that I'll go ahead and merge it as is :)

@AndreHauschild

Copy link
Copy Markdown
Author

Great! Yes, please go ahead and do the squash merge.

Concerning the default file filter, I did intentionally set the filter to only show the TLE files, but please adapt as you see fit.

@aweeri
aweeri merged commit f5172cb into aweeri:extremelywip Nov 5, 2026
1 check passed
@AndreHauschild
AndreHauschild deleted the tleFileDialog branch November 6, 2026 08:21
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

Successfully merging this pull request may close these issues.

2 participants