Skip to content

Commit

Permalink
More tidy up, plus add translators to about menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Young committed Nov 6, 2024
1 parent 488a2ec commit e399e73
Show file tree
Hide file tree
Showing 28 changed files with 297 additions and 854 deletions.
12 changes: 12 additions & 0 deletions CHANGES.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ happens, so I'm now setting it to a slightly arbitrary time early in the morning
* Additional methods for calculating IBU
* We'll list other new features here...

## v4.0.10
Bug fixes and minor enhancements.

### New Features
* Danish translation

### Bug Fixes
* Crash when copying recipe, then on adding new steps in mash, ferment, boil, others [868](https://github.com/Brewtarget/brewtarget/issues/868)

### Release Timestamp
Sun, 3 Nov 2024 04:00:10 +0100

## v4.0.9
Bug fixes and minor enhancements.

Expand Down
20 changes: 13 additions & 7 deletions src/AboutDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,20 @@ AboutDialog::AboutDialog(QWidget * parent) :
// 2013 U-CHIMCHIM\mik <mik@chimchim.(none)> // Incomplete name and email
" </ul>"
""
// **********************************************************************************************************
// * Note that the HTML source indentation here is different than above so that we don't pick up testers as *
// * copyright holders in the awk command above! *
// **********************************************************************************************************
" <p>The following people have made notable contributions with testing and bug reports:</p>"
// ***********************************************************************************************************
// * Note that the HTML source indentation here is different than above so that we don't pick up translators *
// * as software copyright holders in the awk command above! *
// * *
// * This list is currently somewhat incomplete, partly as I haven't yet found a record of who did all the *
// * original translations, and partly as some GitHub users do not have their name in their profile. *
// ***********************************************************************************************************
" <p>The following people are amongst those who have provided translations:</p>"
" <ul>"
" <li>Mik Firestone &lt;[email protected]&gt;</li>"
" <li>Nikolas &quot;Jazzbeerman&quot; </li>"
" <li>André Rodrigues (Brazilian Portuguese)</li>"
" <li>Orla Valbjørn Møller (Danish)</li>"
" <li>Marcel Koek (Dutch)</li>"
" <li>Mattias Måhl (Swedish)</li>"
" <li>Mikhail Gorbunov (Russian)</li>"
" </ul>"
""
" <h2>License (GPLv3)</h2>"
Expand Down
4 changes: 2 additions & 2 deletions src/BrewDayFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ QString BrewDayFormatter::buildInstructionHtml() {
.arg(tr("Step"));

bool useAlt = true;
for (auto instruction : recObs->steps()) {
for (auto instruction : recObs->instructions()) {
useAlt = !useAlt;
QString stepTime, tmp;
QList<QString> reagents;
Expand Down Expand Up @@ -259,7 +259,7 @@ QList<QStringList> BrewDayFormatter::buildInstructionList() {
ret.append(row);
row.clear();

for (auto instruction : recObs->steps()) {
for (auto instruction : recObs->instructions()) {
QString stepTime, tmp;
QList<QString> reagents;

Expand Down
20 changes: 10 additions & 10 deletions src/BrewDayScrollWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ BrewDayScrollWidget::BrewDayScrollWidget(QWidget* parent) : QWidget{parent},
BrewDayScrollWidget::~BrewDayScrollWidget() = default;

void BrewDayScrollWidget::saveInstruction() {
this->m_recObs->steps()[ listWidget->currentRow() ]->setDirections( btTextEdit->toPlainText() );
this->m_recObs->instructions()[ listWidget->currentRow() ]->setDirections( btTextEdit->toPlainText() );
return;
}

Expand Down Expand Up @@ -114,7 +114,7 @@ void BrewDayScrollWidget::generateInstructions() {
// TODO: Would be neat to make this an undoable action
//
bool proceed = true;
if (this->m_recObs->numSteps() > 0) {
if (this->m_recObs->instructions().size() > 0) {
proceed = QMessageBox::Yes == QMessageBox::question(
this,
tr("Overwrite Existing Instructions"),
Expand Down Expand Up @@ -143,7 +143,7 @@ void BrewDayScrollWidget::removeSelectedInstruction() {
if (row < 0) {
return;
}
this->m_recObs->removeStep(this->m_recIns[row]);
this->m_recObs->m_instructions.remove(this->m_recIns[row]);

// After updating the model, this is the simplest way to update the display
this->setRecipe(this->m_recObs);
Expand Down Expand Up @@ -171,7 +171,7 @@ void BrewDayScrollWidget::pushInstructionUp() {
return;
}

this->m_recObs->swapSteps(*this->m_recIns[row], *this->m_recIns[row-1]);
this->m_recObs->m_instructions.swap(*this->m_recIns[row], *this->m_recIns[row-1]);

// After updating the model, this is the simplest way to update the display
this->setRecipe(this->m_recObs);
Expand All @@ -190,7 +190,7 @@ void BrewDayScrollWidget::pushInstructionDown() {
return;
}

this->m_recObs->swapSteps(*this->m_recIns[row], *this->m_recIns[row+1]);
this->m_recObs->m_instructions.swap(*this->m_recIns[row], *this->m_recIns[row+1]);

// After updating the model, this is the simplest way to update the display
this->setRecipe(this->m_recObs);
Expand Down Expand Up @@ -248,7 +248,7 @@ void BrewDayScrollWidget::setRecipe(Recipe* rec) {
this->m_recObs = rec;
connect(this->m_recObs, &Recipe::changed, this, &BrewDayScrollWidget::acceptChanges);

m_recIns = this->m_recObs->steps();
m_recIns = this->m_recObs->m_instructions.items();
for (auto ins : m_recIns) {
connect(ins.get(), &Instruction::changed, this, &BrewDayScrollWidget::acceptInsChanges);
}
Expand Down Expand Up @@ -288,7 +288,7 @@ void BrewDayScrollWidget::insertInstruction() {
lineEdit_name->clear();

pos = qBound(1, pos, this->m_recIns.size());
this->m_recObs->insertStep(instruction, pos);
this->m_recObs->m_instructions.insert(instruction, pos);

// After updating the model, this is the simplest way to update the display
this->setRecipe(this->m_recObs);
Expand All @@ -298,12 +298,12 @@ void BrewDayScrollWidget::insertInstruction() {
}

void BrewDayScrollWidget::acceptChanges(QMetaProperty prop, QVariant /*value*/) {
if (m_recObs && QString(prop.name()) == PropertyNames::SteppedOwnerBase::steps) {
if (m_recObs && QString(prop.name()) == PropertyNames::Recipe::instructions) {
// An instruction has been added or deleted, so update internal list.
for (auto ins : m_recIns ) {
disconnect(ins.get(), nullptr, this, nullptr);
}
m_recIns = this->m_recObs->steps(); // Already sorted by instruction numbers.
m_recIns = this->m_recObs->m_instructions.items(); // Already sorted by instruction numbers.
for (auto ins : m_recIns ) {
connect(ins.get(), &Instruction::changed, this, &BrewDayScrollWidget::acceptInsChanges);
}
Expand Down Expand Up @@ -438,7 +438,7 @@ QString BrewDayScrollWidget::buildInstructionTable() {
.arg(tr("Time"))
.arg(tr("Step"));

auto instructions = this->m_recObs->steps();
auto instructions = this->m_recObs->m_instructions.items();
auto mashSteps = this->m_recObs->mash()->mashSteps();
int size = instructions.size();
for (int i = 0; i < size; ++i ) {
Expand Down
2 changes: 1 addition & 1 deletion src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ void MainWindow::showChanges(QMetaProperty* prop) {
if (this->pimpl->m_recipeObs->boil() &&
(updateAll ||
propName == PropertyNames::Recipe::boil ||
propName == PropertyNames::SteppedOwnerBase::steps)) {
propName == PropertyNames::StepOwnerBase::steps)) {
this->pimpl->m_boilStepTableModel->setBoil(this->pimpl->m_recipeObs->boil());
}
// See if we need to change the fermentation in the table.
Expand Down
4 changes: 2 additions & 2 deletions src/RecipeFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ class RecipeFormatter::impl {
return "";
}

auto instructions = this->rec->steps();
auto instructions = this->rec->instructions();
int size = instructions.size();
if ( size < 1 ) {
return "";
Expand Down Expand Up @@ -952,7 +952,7 @@ class RecipeFormatter::impl {

QStringList num, text;

auto instructions = rec->steps();
auto instructions = rec->instructions();
int size = instructions.size();
if ( size > 0 ) {
for (int ii = 0; ii < size; ++ii) {
Expand Down
2 changes: 1 addition & 1 deletion src/WaterDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
#include "ui_waterDialog.h"

#include "measurement/Unit.h"
#include "model/Salt.h"
#include "model/Water.h"

class WaterListModel;
class WaterSortFilterProxyModel;
class WaterEditor;
class RecipeAdjustmentSaltTableModel;
class RecipeAdjustmentSaltItemDelegate;
class Salt;

/*!
* \class WaterDialog
Expand Down
16 changes: 8 additions & 8 deletions src/database/ObjectStoreTyped.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ namespace {
// NB: MashSteps don't have folders, as each one is owned by a Mash
{ObjectStore::FieldType::Double, "end_temp_c" , PropertyNames:: Step::endTemp_c },
{ObjectStore::FieldType::Double, "infuse_temp_c" , PropertyNames:: MashStep::infuseTemp_c },
{ObjectStore::FieldType::Int , "mash_id" , PropertyNames::SteppedBase::ownerId , &PRIMARY_TABLE<Mash>},
{ObjectStore::FieldType::Int , "mash_id" , PropertyNames::EnumeratedBase::ownerId , &PRIMARY_TABLE<Mash>},
{ObjectStore::FieldType::Enum , "mstype" , PropertyNames:: MashStep::type , &MashStep::typeStringMapping},
{ObjectStore::FieldType::Double, "ramp_time_mins" , PropertyNames:: StepBase::rampTime_mins },
{ObjectStore::FieldType::Int , "step_number" , PropertyNames::SteppedBase::stepNumber },
{ObjectStore::FieldType::Int , "step_number" , PropertyNames::EnumeratedBase::stepNumber },
{ObjectStore::FieldType::Double, "step_temp_c" , PropertyNames:: StepBase::startTemp_c },
{ObjectStore::FieldType::Double, "step_time_mins" , PropertyNames:: StepBase::stepTime_mins },
// Now we support BeerJSON, amount_l unifies and replaces infuseAmount_l and decoctionAmount_l
Expand Down Expand Up @@ -360,8 +360,8 @@ namespace {
{ObjectStore::FieldType::Double, "start_temp_c" , PropertyNames:: StepBase::startTemp_c },
{ObjectStore::FieldType::Double, "end_temp_c" , PropertyNames:: Step::endTemp_c },
{ObjectStore::FieldType::Double, "ramp_time_mins" , PropertyNames:: StepBase::rampTime_mins },
{ObjectStore::FieldType::Int , "step_number" , PropertyNames:: SteppedBase::stepNumber },
{ObjectStore::FieldType::Int , "boil_id" , PropertyNames:: SteppedBase::ownerId , &PRIMARY_TABLE<Boil>},
{ObjectStore::FieldType::Int , "step_number" , PropertyNames:: EnumeratedBase::stepNumber },
{ObjectStore::FieldType::Int , "boil_id" , PropertyNames:: EnumeratedBase::ownerId , &PRIMARY_TABLE<Boil>},
{ObjectStore::FieldType::String, "description" , PropertyNames:: Step::description },
{ObjectStore::FieldType::Double, "start_acidity_ph", PropertyNames:: Step::startAcidity_pH},
{ObjectStore::FieldType::Double, "end_acidity_ph" , PropertyNames:: Step::endAcidity_pH },
Expand Down Expand Up @@ -410,8 +410,8 @@ namespace {
{ObjectStore::FieldType::Double, "step_time_mins" , PropertyNames:: StepBase::stepTime_mins },
{ObjectStore::FieldType::Double, "start_temp_c" , PropertyNames:: StepBase::startTemp_c },
{ObjectStore::FieldType::Double, "end_temp_c" , PropertyNames:: Step::endTemp_c },
{ObjectStore::FieldType::Int , "step_number" , PropertyNames:: SteppedBase::stepNumber },
{ObjectStore::FieldType::Int , "fermentation_id" , PropertyNames:: SteppedBase::ownerId , &PRIMARY_TABLE<Fermentation>},
{ObjectStore::FieldType::Int , "step_number" , PropertyNames:: EnumeratedBase::stepNumber },
{ObjectStore::FieldType::Int , "fermentation_id" , PropertyNames:: EnumeratedBase::ownerId , &PRIMARY_TABLE<Fermentation>},
{ObjectStore::FieldType::String, "description" , PropertyNames:: Step::description },
{ObjectStore::FieldType::Double, "start_acidity_ph", PropertyNames:: Step::startAcidity_pH},
{ObjectStore::FieldType::Double, "end_acidity_ph" , PropertyNames:: Step:: endAcidity_pH},
Expand Down Expand Up @@ -846,8 +846,8 @@ namespace {
{ObjectStore::FieldType::String, "name" , PropertyNames::NamedEntity::name },
{ObjectStore::FieldType::Bool , "display" , PropertyNames::NamedEntity::display },
{ObjectStore::FieldType::Bool , "deleted" , PropertyNames::NamedEntity::deleted },
{ObjectStore::FieldType::Int , "recipe_id" , PropertyNames::SteppedBase::ownerId , &PRIMARY_TABLE<Recipe>},
{ObjectStore::FieldType::Int , "step_number" , PropertyNames::SteppedBase::stepNumber},
{ObjectStore::FieldType::Int , "recipe_id" , PropertyNames::EnumeratedBase::ownerId , &PRIMARY_TABLE<Recipe>},
{ObjectStore::FieldType::Int , "step_number" , PropertyNames::EnumeratedBase::stepNumber},
{ObjectStore::FieldType::String, "directions" , PropertyNames::Instruction::directions},
{ObjectStore::FieldType::Bool , "has_timer" , PropertyNames::Instruction::hasTimer },
{ObjectStore::FieldType::String, "timer_value" , PropertyNames::Instruction::timerValue},
Expand Down
2 changes: 1 addition & 1 deletion src/model/Boil.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Boil : public NamedEntity,
STEP_OWNER_COMMON_DECL(Boil, boil)
// See model/FolderBase.h for info, getters and setters for these properties
Q_PROPERTY(QString folder READ folder WRITE setFolder )
// See model/SteppedOwnerBase.h for info, getters and setters for these properties
// See model/StepOwnerBase.h for info, getters and setters for these properties
Q_PROPERTY(QList<std::shared_ptr<BoilStep>> steps READ steps WRITE setSteps STORED false)
Q_PROPERTY(unsigned int numSteps READ numSteps STORED false)

Expand Down
2 changes: 1 addition & 1 deletion src/model/BoilStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BoilStep : public StepExtended, public StepBase<BoilStep, Boil, BoilStepOp
Q_OBJECT

STEP_COMMON_DECL(Boil, BoilStepOptions)
// See model/SteppedBase.h for info, getters and setters for these properties
// See model/EnumeratedBase.h for info, getters and setters for these properties
Q_PROPERTY(int ownerId READ ownerId WRITE setOwnerId )
Q_PROPERTY(int stepNumber READ stepNumber WRITE setStepNumber)
// See model/StepBase.h for info, getters and setters for these properties
Expand Down
Loading

0 comments on commit e399e73

Please sign in to comment.