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

TexDoc dialog: check all packages option without packages present #3917

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,25 @@ Help::Help(QObject *parent): QObject(parent),texDocSystem(0)
*/
void Help::execTexdocDialog(const QStringList &packages, const QString &defaultPackage)
{
TexdocDialog dialog(nullptr,this);
bool lastState;
lastState = mShowAllPackages;
TexdocDialog dialog(nullptr,this);
dialog.setPackageNames(packages);
if (packages.count()==0) {
mShowAllPackages = true;
}
dialog.setShowAllPackages(mShowAllPackages);
if (!defaultPackage.isEmpty()) {
dialog.setPreferredPackage(defaultPackage);
}else{
dialog.setShowAllPackages(mShowAllPackages);
}
}
if (dialog.exec()) {
viewTexdoc(dialog.selectedPackage());
}
mShowAllPackages=dialog.showAllPackages();
if (packages.count()>0) {
mShowAllPackages = dialog.showAllPackages();
} else {
mShowAllPackages = lastState;
}
}
/*!
* \brief run texdoc --view package
Expand Down
4 changes: 1 addition & 3 deletions src/texdocdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ void TexdocDialog::itemChanged(QTableWidgetItem* item)
void TexdocDialog::setPackageNames(const QStringList &packages)
{
m_packages=packages;
if (m_packages.count()==0){
ui->cbShowAllPackages->setChecked(true); // regenerateTable will be called by the stateChanged signal
}else{
if (m_packages.count()>0){
regenerateTable();
}
}
Expand Down
Loading