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

Orm "loses" mapping_categories.jsonc, apparently after saving the database to a different folder #134

Closed
Andy2No opened this issue Jan 6, 2022 · 3 comments
Labels
question Further information is requested

Comments

@Andy2No
Copy link

Andy2No commented Jan 6, 2022

I've referred to this in the currently closed thread Category errors #124, but it seems to be a separate but related problem, and possibly quite a simple one.

At the moment, in 1.14.0, when I try to use the Categories -> Edit category import mapping menu, I get an error dialog relating to the mapping_categories.jsonc being missing.

I see this file in my C:\Users\andy\AppData\Roaming\knobkraft, but that's not where Orm is currently looking for databases, since I saved the database to a folder in My Documents - it now saves or loads databases from there, by default, when I use the file menu.

So, I'm guessing that's the cause of the bug, and I thought maybe just copying the file across to the folder where my databases are now stored, would be the answer. It turns out that doesn't work.

This is in no way urgent, of course, and I appreciate you're busy with the new version, @christofmuc, where perhaps this isn't even a problem.

@christofmuc
Copy link
Owner

@Andy2No Can you post a screenshot of the error dialog? The logic is actually pretty simple and works on my box:

	File appData = File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("KnobKraft");
		if (!appData.exists()) {
			appData.createDirectory();
		}
		File jsoncFile = appData.getChildFile("mapping_categories.jsonc");
		if (!jsoncFile.exists()) {
			// Create an initial file from the resources!
			FileOutputStream out(jsoncFile);
			out.writeText(midikraft::AutomaticCategory::defaultJsonMapping(), false, false, "\\n");
		}
		return jsoncFile;

My suspicion would be that there is no editor associated with the (unusual) jsonc file ending. Jsonc is json with comments, hence the "c", but normally a Windows dialog would appear to allow you to select the editor you want to use for that file (I suggest Visual Studo Code, which has excellent support for editing these files).

@Andy2No
Copy link
Author

Andy2No commented Jan 9, 2022

I see. I didn't realise it was meant to be opening the file in an editor. I haven't seen a dialog box quite like this one before, as far as I can remember:

1_14_0 mapping_categories jsonc

Is there some documentation somewhere I should have read? I have looked for some, but all I've found is the readme on the Code page, and the adaptations programming guide.

I figured out how renaming is supposed to be done, incidentally, but I hadn't realised that was even an option, until recently. and when I initially tried, I couldn't see how to do it. Did I miss the memo? :)

@christofmuc christofmuc added the question Further information is requested label Apr 1, 2022
@christofmuc
Copy link
Owner

Closing this in favor of #135, which is where the documentation and discussion is. There is no bug here that can be fixed, but rather missing clarity in the feature and not enough documentation, which is what the other ticket is for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants