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

Add support for parsing .lnk files for TeXworks #10977

Closed
koppor opened this issue Mar 4, 2024 · 9 comments · Fixed by #11065
Closed

Add support for parsing .lnk files for TeXworks #10977

koppor opened this issue Mar 4, 2024 · 9 comments · Fixed by #11065
Assignees
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@koppor
Copy link
Member

koppor commented Mar 4, 2024

(Follow-up to #10953)

JabRef currently, doesn't find TeXWorks when MiKTeX is installed on Windows.

In the prefs we have some autodetect logic

defaults.put(PUSH_TEXSTUDIO_PATH, OS.getNativeDesktop().detectProgramPath("texstudio", "TeXstudio"));

On my machine, the app can be found via the following steps:

  1. Open %APPDATA%\Microsoft\Windows\Start Menu\Programs\MiKTeX\TeXworks.lnk
  2. Read Target from it. On my machine: C:\MiKTeX\miktex\bin\x64\miktex-texworks.exe

Use the mslinks library for parsing the lnk file. The implementation should be implemented in org.jabref.gui.desktop.os.Windows#detectProgramPath.

Alternative:

However, when I click Save in the preferences, there should be a check. If the binary could not be found, user should be asked to navigate to the options.

@koppor koppor mentioned this issue Mar 4, 2024
6 tasks
@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Mar 4, 2024
@github-project-automation github-project-automation bot moved this to Free to take in Good First Issues Mar 4, 2024
@Jayachandra5
Copy link

I am Interested in contributing to this Issue.

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Mar 9, 2024
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Mar 9, 2024
@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Mar 9, 2024
Copy link
Contributor

github-actions bot commented Mar 9, 2024

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Jayachandra5
Copy link

Jayachandra5 commented Mar 13, 2024

What does getSpi Method do in WindowsPreferences.java

@koppor
Copy link
Member Author

koppor commented Mar 13, 2024

WindowsPreferences

I don't find this class in JabRef. Do you have a link?

@Jayachandra5
Copy link

That is a Java Inbuilt function. Here is the screenshot attached

image

@Jayachandra5
Copy link

Jayachandra5 commented Mar 14, 2024

The method in /src/main/java/org/jabref/preferences/JabRefPreferences.java#L946 is not returning the value stored by the defaults hashmap.

image

Printing Value is Different From Returning Value Because of the getSpi Method.

@koppor
Copy link
Member Author

koppor commented Mar 14, 2024

@Jayachandra5 This is far away from this issue. You can submit a question at https://discourse.jabref.org/c/programming/44.

Some words: Users can configure JabRef. What are the defaults if nothing is configured? The ones in the HashMap. Where are the configurations stored? In Windows registry. How to access? Using Java properties? How named in JabRef? "Preferences"?

@InAnYan
Copy link
Member

InAnYan commented Mar 21, 2024

Hello! I want to fix this issue.

I have a question: do I need to add any test for this bugfix?

@koppor
Copy link
Member Author

koppor commented Mar 21, 2024

@InAnYan I did not see any activity by @Jayachandra5 , thus I re- assign to you.

Tests are always good. Just give it a thought. Maybe with jimfs (https://github.com/google/jimfs), but could be too much effort...

@koppor koppor assigned InAnYan and unassigned Jayachandra5 Mar 21, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 22, 2024
* Added support for parsing .lnk files for TeXworks (#10977)

* Revert "Added support for parsing .lnk files for TeXworks (#10977)"

This reverts commit f3e2df3.

* Added support for parsing .lnk files for TeXworks (#10977)

* Added support for parsing .lnk files for TeXworks (#10977)

* Resolved CheckStyle errors

* Introduce getEmptyIsDefault

* Compilefix

* Update build.gradle and changed empty catch branch

* Used another logger

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
@github-project-automation github-project-automation bot moved this from Reserved to Done in Good First Issues Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants