mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-12 23:23:14 +02:00
Folio properties: auto-add a title block's custom variables (#271)
When a title block template uses custom variables (e.g. %{department},
%{owner}), the user previously had to declare each one by hand in the
folio properties 'Custom' tab before a value could be entered. Now the
template's undefined custom variables are added automatically, so the
user only fills in the values.
- listOfVariables() now extracts %{name} placeholders with a regex
(deduplicated) instead of a crude '%' strip that returned '{name}'.
- The folio properties widget merges the template's custom variables into
the Custom tab both on open (setProperties) and when the template is
changed, preserving any values already entered and skipping the
standard fields (title, author, date, ...) which have their own inputs.
Fixes #271 (variable auto-population; the revision-history request in the
thread is a separate feature).
This commit is contained in:
@@ -30,6 +30,7 @@ class NumerotationContext;
|
||||
class QETProject;
|
||||
class QMenu;
|
||||
class TitleBlockTemplatesCollection;
|
||||
class TitleBlockTemplate;
|
||||
|
||||
namespace Ui {
|
||||
class TitleBlockPropertiesWidget;
|
||||
@@ -77,6 +78,8 @@ class TitleBlockPropertiesWidget : public QWidget
|
||||
void initDialog(const bool ¤t_date, QETProject *project);
|
||||
int getIndexFor (const QString &tbt_name,
|
||||
const QET::QetCollection collection) const;
|
||||
TitleBlockTemplate *templateForIndex (int index) const;
|
||||
void addTemplateVariables (DiagramContext &context, int index) const;
|
||||
|
||||
private slots:
|
||||
void editCurrentTitleBlockTemplate();
|
||||
|
||||
Reference in New Issue
Block a user