Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jasp-stats/jasp-desktop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2ae05fa787645fc0afbe5433c26101d15e2962d1
Choose a base ref
..
head repository: jasp-stats/jasp-desktop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e32ad10cc3fc29e7b895ec6cd2597f7eb14b0cd9
Choose a head ref
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-de.po
Original file line number Diff line number Diff line change
@@ -5627,3 +5627,7 @@ msgstr "Skalierung des Menübandes (%): "
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr "Legen Sie den Skalierungsgrad der Höhe des Menübandes fest."

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-eo.po
Original file line number Diff line number Diff line change
@@ -5160,3 +5160,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-es.po
Original file line number Diff line number Diff line change
@@ -5629,3 +5629,7 @@ msgstr "Escala de cinta (%): "
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr "Establecer la escala de altura de la cinta."

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-fr.po
Original file line number Diff line number Diff line change
@@ -5573,3 +5573,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-gl.po
Original file line number Diff line number Diff line change
@@ -5603,3 +5603,7 @@ msgstr "Escala de cinta (%): "
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr "Establecer a escala da altura da cinta."

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-id.po
Original file line number Diff line number Diff line change
@@ -5229,3 +5229,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-ja.po
Original file line number Diff line number Diff line change
@@ -5507,3 +5507,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-nl.po
Original file line number Diff line number Diff line change
@@ -5577,3 +5577,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-pl.po
Original file line number Diff line number Diff line change
@@ -5533,3 +5533,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-pt.po
Original file line number Diff line number Diff line change
@@ -5452,3 +5452,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-pt_BR.po
Original file line number Diff line number Diff line change
@@ -5452,3 +5452,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-ru.po
Original file line number Diff line number Diff line change
@@ -5496,3 +5496,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-tr.po
Original file line number Diff line number Diff line change
@@ -5174,3 +5174,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-zh_Hans.po
Original file line number Diff line number Diff line change
@@ -5376,3 +5376,7 @@ msgstr "菜单栏缩放(%): "
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr "设置顶部分析菜单栏的高度尺寸。"

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop-zh_Hant.po
Original file line number Diff line number Diff line change
@@ -5297,3 +5297,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
4 changes: 4 additions & 0 deletions Desktop/po/jaspDesktop.pot
Original file line number Diff line number Diff line change
@@ -5130,3 +5130,7 @@ msgstr ""
msgctxt "PrefsUI|"
msgid "Set the scale of height of the ribbon."
msgstr ""

msgctxt "TabView|"
msgid "Double click to edit this name"
msgstr ""
55 changes: 40 additions & 15 deletions QMLComponents/controls/factorsformbase.cpp
Original file line number Diff line number Diff line change
@@ -48,12 +48,17 @@ void FactorsFormBase::setUpModel()

void FactorsFormBase::bindTo(const Json::Value& value)
{
Json::Value newValue = value;
ListModelFactorsForm::FactorVec factors;

for (const Json::Value& factor : value)
for (Json::Value& factor : newValue)
{
int termId = 0;
Terms initTerms;
for (const Json::Value& termJson : factor[fq(_optionKey)])
const Json::Value& termsJson = factor[fq(_optionKey)];
Json::Value valuePart = _isValueWithTypes(termsJson) ? termsJson["value"] : termsJson;
Json::Value typesPart = _isValueWithTypes(termsJson) ? termsJson["types"] : Json::arrayValue;
for (Json::Value& termJson : valuePart)
{
std::vector<std::string> components;

@@ -71,16 +76,31 @@ void FactorsFormBase::bindTo(const Json::Value& value)
if (components.size() > 0)
{
columnTypeVec types;
for (const std::string& component : components)
types.push_back(model()->getVariableRealType(tq(component)));
Term term(components, types);
initTerms.add(term);
if (typesPart.size() > termId) // If the type is given, use it
{
if (typesPart[termId].isArray())
for (const Json::Value& jsonType : typesPart[termId])
types.push_back(columnTypeFromString(jsonType.asString(), columnType::unknown));
else
types.push_back(columnTypeFromString(typesPart[termId].asString(), columnType::unknown));
}
else
for (const std::string& component : components)
types.push_back(model()->getVariableRealType(tq(component)));
initTerms.add(Term(components, types));
}
termId++;
}

factors.push_back(ListModelFactorsForm::Factor(tq(factor["name"].asString()), tq(factor["title"].asString()), initTerms));

Json::Value newTerms = Json::objectValue;
newTerms["value"] = valuePart;
newTerms["types"] = initTerms.types();
factor[fq(_optionKey)] = newTerms;
}

BoundControlBase::bindTo(value);
BoundControlBase::bindTo(newValue);

_factorsModel->initFactors(factors);
}
@@ -94,7 +114,7 @@ Json::Value FactorsFormBase::createJson() const
Json::Value row(Json::objectValue);
row["name"] = fq(baseName() + QString::number(i + startIndex()));
row["title"] = fq(baseTitle() + " " + QString::number(i + startIndex()));
row[fq(_optionKey)] = Json::Value(Json::arrayValue);
row[fq(_optionKey)] = Json::Value(Json::objectValue);

result.append(row);
}
@@ -109,7 +129,7 @@ bool FactorsFormBase::isJsonValid(const Json::Value &value) const
{
for (const Json::Value& factor : value)
{
valid = factor.isObject() && factor["name"].isString() && factor["title"].isString() && factor[fq(_optionKey)].isArray();
valid = factor.isObject() && factor["name"].isString() && factor["title"].isString() && factor.isMember(fq(_optionKey));
if (!valid) break;
}
}
@@ -131,12 +151,11 @@ void FactorsFormBase::termsChangedHandler()

for (const auto &factor : factors)
{
Json::Value factorJson(Json::objectValue);
factorJson["name"] = fq(factor.name);
factorJson["title"] = fq(factor.title);
Json::Value termsJson(Json::arrayValue);
const Terms& terms = factor.listView ? factor.listView->model()->terms() : factor.initTerms;
Json::Value valuePart(Json::arrayValue),
typesPart = terms.types();

for (const Term &term : factor.listView ? factor.listView->model()->terms() : factor.initTerms)
for (const Term &term : terms)
{
Json::Value termJson(allowInteraction() ? Json::arrayValue : Json::stringValue);
if (allowInteraction())
@@ -146,8 +165,14 @@ void FactorsFormBase::termsChangedHandler()
}
else
termJson = term.asString();
termsJson.append(termJson);
valuePart.append(termJson);
}
Json::Value factorJson(Json::objectValue),
termsJson(Json::objectValue);
factorJson["name"] = fq(factor.name);
factorJson["title"] = fq(factor.title);
termsJson["value"] = valuePart;
termsJson["types"] = terms.types();
factorJson[fq(_optionKey)] = termsJson;
boundValue.append(factorJson);
}