lizgoban
lizgoban copied to clipboard
Request: Ability to default "open with" .sgf files with LizGoban
It would be great if, when you set .sgf files on your computer to open by default with LizGoban, if that actually worked as would be expected. When setting LizGoban to open .sgf files by default currently, nothing really happens after LizGoban opens up. It doesn't automatically load the .sgf file.
Thanks! Really loving the program so far! Happy it's updated to KataGo 1.9!
happy to hear you enjoy my program :)
Before examining how we can realize it, I'd like to confirm this: Are you using LizGoban 0.*.*.exe
on Windows? If "no", please let me know your environment and how you launch lizgoban.
No worries! I'm using LizGoban 0.6.2 with updated version of Windows 10, and just tried it this morning! Tried with both the prior version and new version of LizGoban.
This is what I see when I try to explicitly "open with" LizGoban...
https://drive.google.com/uc?id=1IWFjrzBlvI7hsgldZtIVryWsMXdBVp2F
As you can see, nothing has happened. It just opened the program as it normally would. I'd still need to go to File > Open SGF or drag the file in for it to actually open it.
Would just be very handy because the only reason I download .sgf files is to open them in LizGoban. So being able to set LizGoban as the default app and immediately open it up with the file loaded would save some time.
Ah, sorry. I just intended to confirm...
- Are you using Windows? (not Mac, Linux, etc.)
- Are you using *.exe? (not
npm start
,lizgoban_windows.vbs
, etc.)
I'll study how to implement this feature.
1.) Yes! Sorry for not showing the window chrome. Latest updated version of Windows 10 being used. 2.) Yup! Using the LizGoban 0.6.2.exe for the "Open With" command.
If it's helpful, it looks like Sabaki is also written with Electron. So perhaps the author of the program might be willing to help provide code to easily drop this in to implement the open with functionality.
Thanks so much!
Not so easy...
"Open with" itself seems to work for lizgoban. I get into trouble if I use "open with" when lizgoban is already running. There are two strategies in this case.
- (A) Open another lizgoban instance.
- (B) Reuse the existing lizgoban instance.
I prefer (B) strongly. But the standard way of (B) in Electron (requestSingleInstanceLock
and second-instance
) does not work well in my case. It goes like this:
- The second instance starts.
- The second instance checks "I am not first" and quits.
- As a side effect of Step 2, the first instance receives an event on this attempt.
- The first instance reacts to the attempt.
As Lizgoban*.exe
is a compressed archive actually, Step 1 takes unbearably long time for extraction before its start.
Why not add Recent files
menu item. It's easy to view and open recent opened files?
function get_recent_files() {
const files = store.get('recent_files') || [];
const item = files.map(file => ({
label: file,
click() { load_sgf_etc(file) }
}))
return item;
}
const file_menu = menu('File', [
menu('Recent Files', get_recent_files()),
Hmm, the 'recent files' feature seems unrelated to this issue for me. Am I missing something?
I only want to know whether there's such feature in the project. I think they're the similar problems to me. Of course they are different features to others.
I see. Then let's move to the new issue #101.