Files
leocad/common/lc_categorydialog.cpp
T
Leonardo Zide 9de05347ce Add help for model information, categories, colors, and updates
Provide contextual Help/F1 descriptions and label buddies in Model Properties, Category, Edge Colors, About, and Check for Updates. Explain category expression operators, prefixes, and grouping with examples available from both Help and the Keywords field.

Retain Help when update results rebuild the dialog buttons. Document both edge-color modes and the parent Preferences workflow, and make About system information keyboard-selectable. Refresh catalogs without changing existing translations or reviewing new strings.

Validation: debug build; five-dialog Help/F1, Escape, layouts and buddy checks; both edge-color modes; update response states; category syntax examples; and translation preservation checks passed.
2026-10-22 17:01:41 -07:00

52 lines
1.0 KiB
C++

#include "lc_global.h"
#include "lc_qutils.h"
#include "lc_categorydialog.h"
#include "ui_lc_categorydialog.h"
#include "lc_category.h"
lcCategoryDialog::lcCategoryDialog(QWidget* Parent, lcLibraryCategory* Options)
: QDialog(Parent), ui(new Ui::lcCategoryDialog)
{
ui->setupUi(this);
lcSetupDialogHelp(this, ui->buttonBox);
mOptions = Options;
if (!mOptions->Name.isEmpty())
setWindowTitle(tr("Edit Category"));
else
setWindowTitle(tr("New Category"));
ui->name->setText(mOptions->Name);
ui->keywords->setText(mOptions->Keywords);
}
lcCategoryDialog::~lcCategoryDialog()
{
delete ui;
}
void lcCategoryDialog::accept()
{
QString Name = ui->name->text();
if (Name.isEmpty())
{
QMessageBox::information(this, windowTitle(), tr("Name cannot be empty."));
return;
}
QString Keywords = ui->keywords->text();
if (Keywords.isEmpty())
{
QMessageBox::information(this, windowTitle(), tr("Keywords cannot be empty."));
return;
}
mOptions->Name = Name;
mOptions->Keywords = Keywords.toLatin1();
QDialog::accept();
}