Skip to content

Package Help dialog updated#3478

Merged
sunderme merged 9 commits intotexstudio-org:masterfrom
CSMathematics:master
Jan 17, 2024
Merged

Package Help dialog updated#3478
sunderme merged 9 commits intotexstudio-org:masterfrom
CSMathematics:master

Conversation

@CSMathematics
Copy link
Copy Markdown
Contributor

Updated CTAN package database with more information for each package.
TexDialog

@sunderme
Copy link
Copy Markdown
Member

looks good

  • packageList.xml can be removed from qrc and git if we take this solution.
  • where is the json database coming from ?
  • the dialog is a bit small on my 4k monitor, maybe that can be optimized (especially as it does not remember resized dialogs)

QString lastDocRequest;
Help *help;
QStringList m_packages;
QButtonGroup ButtonGroup;
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.

to follow (implicit) naming strategy, the variable should start with a lower case letter (buttonGroup or even m_buttonGroup)

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.

Good point. I will review the code again to make these changes.

<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="LanguagesLayout">
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.

the ususal naming strategy is something like lyLanguages or similar.
lower case first letter helps readability.

</layout>
</item>
<item>
<widget class="QTextBrowser" name="PackageDescriptions"/>
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.

see comment above

@CSMathematics
Copy link
Copy Markdown
Contributor Author

CSMathematics commented Jan 16, 2024

The json database is drawn from CTAN but it has been edittted.
I merged 4 different json files into 1 database file by building a custom function that gets the data and creats the file. It is not included in this project. Ithink I will be able to upload it in my repository in a few days.

@CSMathematics
Copy link
Copy Markdown
Contributor Author

The only thing I couldn't solve is to find a way to open the package documentation when the link is clicked inside the QTextBrowser.

@CSMathematics
Copy link
Copy Markdown
Contributor Author

All changes are made.

@sunderme
Copy link
Copy Markdown
Member

does not compile on OSX (LLVM)

delete bt;
}
for(CTANDescription description : package.descriptions){
QPushButton * LangButton = new QPushButton(description.language,this);
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.

Langbutton


while(buttonGroup.buttons().count()>0){
QAbstractButton * bt = buttonGroup.buttons().first();
ui->LanguagesLayout->removeWidget(bt);
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.

LanguageLayout should start with lower case

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.

Missed that. I will fix it right away

@CSMathematics
Copy link
Copy Markdown
Contributor Author

does not compile on OSX (LLVM)

@CSMathematics
Copy link
Copy Markdown
Contributor Author

does not compile on OSX (LLVM)

I changed the variable names. But I can't see the reason that compilation fails on OSX. I looked at the compile log and if I'm not mistaken the errors are on other files than the ones I modified.

@sunderme sunderme merged commit c2755e6 into texstudio-org:master Jan 17, 2024
@sunderme
Copy link
Copy Markdown
Member

thanks

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 17, 2024

There are blank spaces before the colon.
For example, Name : a0poster

Also, it would be better if the windows could be maximized since it is too tall on my laptop screen and the Cancel button is almost out of screen.

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 18, 2024

In addition, I tried to compile it on Linux Mint 20.2:

-- The current git hash is a8c0199
-- The current git describe is 4.4.0-1053-ga8c01995f
-- building for Qt 5

But I got the error:
Seleção_101

@octaeder
Copy link
Copy Markdown
Contributor

I was able to build with msys2 ucrt64

@octaeder
Copy link
Copy Markdown
Contributor

TeXstudio 4.7.3 (git 4.7.2-38-ga8c01995f)
Using Qt Version 6.6.1, compiled with Qt 6.6.1 R

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 18, 2024

TeXstudio 4.7.3 (git 4.7.2-38-ga8c01995f) Using Qt Version 6.6.1, compiled with Qt 6.6.1 R

It seems that setMarkdown is available only for Qt6.6. I replaced it by setHtml and compilation goes well. But the format of the package info is plain text and no html text anymore, like screenshot below.

Seleção_102

@octaeder
Copy link
Copy Markdown
Contributor

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 18, 2024

Is this the same? https://doc.qt.io/qt-6.2/qtextdocument.html#setMarkdown https://doc.qt.io/qt-5/qtextdocument.html#setMarkdown

Looks like. But the doc says since 5.14. Since my txs shows Qt 5.12.8, I suppose I found the problem.

@dbitouze
Copy link
Copy Markdown
Contributor

Nice feature!

But I don't understand the point of by default disabling the search text field: as long as the “all the packages” option is disabled (the corresponding checkbox is unchecked), nothing can be done. What I would expect would be that, by default:

  • the “all the packages” option is disabled
  • the search text field is enabled, allowing the user to search for a particular package (without cluttering the interface with the list of all packages).

@octaeder
Copy link
Copy Markdown
Contributor

@dbitouze this is impossible for you?

image

and I would say that the option is always disabled when the dialog is started

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 29, 2024

I'm using the version below on Linux Mint and the text field is locked, as screenshot below.

TeXstudio 4.7.3 (git 4.7.1-81-gf0f4089a9)
Utilizando Qt Versão 5.15.3, compilado com Qt 5.15.3 R

Documentação dos Pacotes (Texdoc)_002

@octaeder
Copy link
Copy Markdown
Contributor

Including 5 extra developments and missing the latest 2 (reagarding cwls) I use this (msys2 build) on Win10:

TeXstudio 4.7.3 (git 4.7.2-51-gbd8a0bd91)
Using Qt Version 6.6.1, compiled with Qt 6.6.1 R

I wonder why you see no packages at all. In any case the packages list should not be empty at start. How do you get the packages into place?

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 30, 2024

I wonder why you see no packages at all. In any case the packages list should not be empty at start. How do you get the packages into place?

Sorry, I didn't follow the question.

@octaeder
Copy link
Copy Markdown
Contributor

When you start the dialog it seems from the screenshot that the list is empty. What do you do so the packages appear to the left?
I see the packages after the dialog starts:

image

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 30, 2024

The packages list only appears after the check button is on. Then the text field is unlocked.

Documentação dos Pacotes (Texdoc)_003

@octaeder
Copy link
Copy Markdown
Contributor

there's something wrong.

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 30, 2024

there's something wrong.

Maybe this line: ui->lineEditSearch->setEnabled(n>0);

@octaeder
Copy link
Copy Markdown
Contributor

since search field is not enabled I would conclude that n equals 0. But then m_packages is empty & state<=0. Since I can't reproduce, can can you debug the the values of m_packages.count() and state immediately after line 48 (int n=0;)?

@octaeder
Copy link
Copy Markdown
Contributor

btw: do you use packages in your latex document?

@tmelorc
Copy link
Copy Markdown
Contributor

tmelorc commented Jan 30, 2024

btw: do you use packages in your latex document?

You got it! I was opening the texdoc window with no opened document.
Now it works.

Anyway, it would be good to have the feature available also for no documents.

@octaeder
Copy link
Copy Markdown
Contributor

in this case the option should be checked

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.

5 participants