qmk_flasher icon indicating copy to clipboard operation
qmk_flasher copied to clipboard

Better handle manually-entered paths

Open ItsHarper opened this issue 9 years ago • 5 comments

ItsHarper avatar Dec 15 '16 19:12 ItsHarper

For a visual cue, maybe the text box should have a red border, and once the app detects a) a valid filename and b) that the file exists, turn the box green. I don't think a simple test for a string ending in .hex should slow things down noticeably even if we test with every keystroke, and if the filename is valid, the user is probably done typing, so the second test shouldn't be a problem either.

Once the file checks out, call loadHex().

ItsHarper avatar Dec 19 '16 06:12 ItsHarper

I've been thinking about this one. Part of me wants to make that a read-only box, because it would confuse non-technical users if they accidentally edited a previously working file. Perhaps this is a good candidate to put into the Advanced tab, after that is implemented?

skullydazed avatar Dec 20 '16 20:12 skullydazed

I mean, the open dialog already has an option to type it in manually. We could get rid of it altogether, I suppose. I don't understand your reasoning about accidentally editing a previously working file though.

ItsHarper avatar Dec 20 '16 20:12 ItsHarper

The scenario looks something like this:

  • User drops a file in or selects one through the file picker
  • User accidentally clicks and/or drags in the file box, maybe without realizing it (think trackpad on a laptop)
  • Keys are pressed, and now the filename is invalid

If that's read-only the chances of that happening are 0, but we can still allow power users to access that functionality in the Advanced tab. Or, like you say, we can remove it entirely and leave it for the file picker.

skullydazed avatar Dec 20 '16 21:12 skullydazed

Ah, gotcha. Yeah, let's make it read-only on the basic tab and writable on the advanced tab. I think I'd rather not get rid of it entirely, since we aren't ever loading the file into memory, and if the file were deleted or modified, flashing would fail / the modified version would be flashed. I think showing the path we're going to load the file from better conveys how that works.

ItsHarper avatar Dec 20 '16 21:12 ItsHarper