From e648cb7542cd2221ac391144587bde75f040faef Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Tue, 4 Mar 2014 00:56:31 +0100 Subject: [PATCH] Wizard model name saved to current model. Diacritics filtered out. --- companion/src/mdichild.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index abf609ad5..bf1c23989 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -188,7 +188,17 @@ void MdiChild::wizardEdit() WizardDialog *wizard = new WizardDialog(this); wizard->exec(); if (wizard->mix.complete){ - //TODO Save data accessible in wizard->mix. + ModelData &model = radioData.models[row - 1]; + + // Remove dicritics and filter off anything but chars from the new model name + QString newName(wizard->mix.name.normalized(QString::NormalizationForm_D)); + newName = newName.replace(QRegExp("[^a-zA-Z\\s]"), ""); + strncpy(model.name, newName.toAscii(), sizeof(model.name)); + model.name[sizeof(model.name)-1]=0; + + //TODO Save the rest of the wizard->mix data to model. + + setModified(); } } }