Skip to content

remember TeXdoc availability#3270

Merged
sunderme merged 2 commits intotexstudio-org:masterfrom
octaeder:packages
Aug 30, 2023
Merged

remember TeXdoc availability#3270
sunderme merged 2 commits intotexstudio-org:masterfrom
octaeder:packages

Conversation

@octaeder
Copy link
Copy Markdown
Contributor

@octaeder octaeder commented Aug 27, 2023

No description provided.

if (status == Undefined)
help->texdocAvailableRequest(lastDocRequest);
else {
QString message = repo->LatexRepository::docMessage(lastDocRequest);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there actually a case where this message gets set to something ? Looks like circular ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a row is selected the first time (state is Undefined), state and message are retrieved and stored in the latexPackageInfo (s. line 201f in TexdocDialog::regenerateTable and changes in TexdocDialog::updateDocAvailableInfo).
If the message would not be set, then you would not see any message in case you select again the row with a package that has no TeXdoc available.

@octaeder
Copy link
Copy Markdown
Contributor Author

removed tooltips from PR

@sunderme
Copy link
Copy Markdown
Member

I can't find code where docMessageis set to something meaningful or even used.
Basically docStatusis the only meaningful change.

@octaeder
Copy link
Copy Markdown
Contributor Author

Clicking on a table row emits signal currentItemChanged that calls slot itemChanged (texdocdialog.cpp, l. 25).
itemChanged clears the warning icon and message fields and calls delayedCheckDocAvailable with package name as an argument (l. 143). The called routine starts checkTimer (l. 188). On signal timeout slot checkDockAvailable is called (l. 23). There (l. 198ff) docStatus for the package is retrieved which is Undefined by default (s. class LatexPackageInfo), so help->texdocAvailableRequest is executed (else case see next section). This runs the texdoc cmd, after that texdocAvailableRequestFinished reports the result with signal texdocAvailableReply (help.cpp, l. 142, l. 173). Be aware that this signal sends a non empty (custom) message in a special case (l. 129). In any case the signal is catched in texdocdialog (l. 26) and calls slot updateDocAvailableInfo. Depending wether the texdoc for the package is available and the custom message the LatexPackageInfo is updated (l. 219, s. also class LatexPackageInfo) and the warning icon and message fields are set accordingly.

When a row is clicked for that the texdoc info has been stored previously in the package info, these information can be retrieved imediately and the warning icon and message fields are set accordingly (texdocdialog.cpp, l. 202f).

@sunderme
Copy link
Copy Markdown
Member

okay, so there are only two messages (texdoc not found.a and No Documentation Available.)
If texdoc is not available, the whole help mechanism does not work. Any reason to spend the effort with the docMessage ?

@octaeder
Copy link
Copy Markdown
Contributor Author

someone decided to have the option for a custom message. I didn't want to change this. But in principle it would suffice to store the available value and hard code the negative message. One hast just to see what should happen to the special case. Discuss about effort is useless, because code is finalized.

@sunderme
Copy link
Copy Markdown
Member

okay, I would prefer to have only the status stored.

@sunderme
Copy link
Copy Markdown
Member

the line help->texdocAvailableRequest(lastDocRequest); actually needs to return a false (unsuccesful) when texdoc is missing instead of a signal.
This would clarify the whole set up.

@octaeder
Copy link
Copy Markdown
Contributor Author

octaeder commented Aug 30, 2023

@sunderme but this means that the user doesn't receive a note when texdoc cmd is not set up.
Meanwhile I update the PR with your suggestion.

@sunderme sunderme merged commit 65e8ee9 into texstudio-org:master Aug 30, 2023
@sunderme
Copy link
Copy Markdown
Member

Thanks

@octaeder octaeder deleted the packages branch August 30, 2023 21:32
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

Successfully merging this pull request may close these issues.

2 participants