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

Request: Ability to default "open with" .sgf files with LizGoban #70

Open
JamesMowery opened this issue Jul 5, 2021 · 9 comments
Open

Comments

@JamesMowery
Copy link

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!

@JamesMowery JamesMowery changed the title Request: Ability to open .SGF files with LizGoban Request: Ability to default "open with" .sgf files with LizGoban Jul 5, 2021
@kaorahi
Copy link
Owner

kaorahi commented Jul 5, 2021

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.

@JamesMowery
Copy link
Author

JamesMowery commented Jul 5, 2021

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.

@kaorahi
Copy link
Owner

kaorahi commented Jul 6, 2021

Ah, sorry. I just intended to confirm...

  1. Are you using Windows? (not Mac, Linux, etc.)
  2. Are you using *.exe? (not npm start, lizgoban_windows.vbs, etc.)

I'll study how to implement this feature.

@JamesMowery
Copy link
Author

JamesMowery commented Jul 6, 2021

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!

@kaorahi
Copy link
Owner

kaorahi commented Jul 7, 2021

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:

  1. The second instance starts.
  2. The second instance checks "I am not first" and quits.
  3. As a side effect of Step 2, the first instance receives an event on this attempt.
  4. 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.

@qcgm1978
Copy link
Contributor

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()),
截屏2023-11-30 14 36 10

@kaorahi
Copy link
Owner

kaorahi commented Nov 30, 2023

Hmm, the 'recent files' feature seems unrelated to this issue for me. Am I missing something?

@qcgm1978
Copy link
Contributor

qcgm1978 commented Nov 30, 2023

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.

@kaorahi
Copy link
Owner

kaorahi commented Dec 1, 2023

I see. Then let's move to the new issue #101.

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

3 participants