mirror of
https://github.com/leozide/leocad.git
synced 2026-10-26 22:10:32 +00:00
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.
52 lines
1.0 KiB
C++
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();
|
|
}
|