diff --git a/CHANGES.markdown b/CHANGES.markdown index 81628eef..c859ee7d 100644 --- a/CHANGES.markdown +++ b/CHANGES.markdown @@ -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.15 +Bug fixes and minor enhancements. + +### New Features +* Updated Danish translations (courtesy of Orla Valbjørn Møller) + +### Bug Fixes +* 4.0.13 and ubuntu 24.10 crash [913](https://github.com/Brewtarget/brewtarget/issues/913) + +### Release Timestamp +Tue, 31 Dec 2024 04:00:15 +0100 + ## v4.0.14 Bug fixes and minor enhancements. diff --git a/CMakeLists.txt b/CMakeLists.txt index e85f5834..2118753d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ endif() #======================================================================================================================= # It's simplest to keep the project name all lower-case as it means we can use a lot more of the default settings for # Linux packaging (where directory names etc are expected to be all lower-case). -project(brewtarget VERSION 4.0.14 LANGUAGES CXX) +project(brewtarget VERSION 4.0.15 LANGUAGES CXX) message(STATUS "Building ${PROJECT_NAME} version ${PROJECT_VERSION}") message(STATUS "PROJECT_SOURCE_DIR is ${PROJECT_SOURCE_DIR}") # Sometimes we do need the capitalised version of the project name diff --git a/meson.build b/meson.build index d04567c0..a06e58c1 100644 --- a/meson.build +++ b/meson.build @@ -189,7 +189,7 @@ # # project('brewtarget', 'cpp', - version: '4.0.14', + version: '4.0.15', license: 'GPL-3.0-or-later', meson_version: '>=0.63.0', default_options : ['cpp_std=c++23', diff --git a/src/editors/EquipmentEditor.h b/src/editors/EquipmentEditor.h index 96668c93..a0a037e7 100755 --- a/src/editors/EquipmentEditor.h +++ b/src/editors/EquipmentEditor.h @@ -30,7 +30,7 @@ #include "editors/EditorBase.h" #include "model/Equipment.h" -#define EquipmentEditorOptions EditorBaseOptions{ } +#define EquipmentEditorOptions EditorBaseOptions{ .idDisplay = true } /*! * \class EquipmentEditor * diff --git a/src/editors/StyleEditor.h b/src/editors/StyleEditor.h index 12966e9a..6dd33b89 100755 --- a/src/editors/StyleEditor.h +++ b/src/editors/StyleEditor.h @@ -27,7 +27,7 @@ #include "editors/EditorBase.h" #include "model/Style.h" -#define StyleEditorOptions EditorBaseOptions{ } +#define StyleEditorOptions EditorBaseOptions{ .idDisplay = true } /*! * \class StyleEditor * diff --git a/src/widgets/BtComboBoxNamedEntity.cpp b/src/widgets/BtComboBoxNamedEntity.cpp index 31cde1ff..67205ffa 100755 --- a/src/widgets/BtComboBoxNamedEntity.cpp +++ b/src/widgets/BtComboBoxNamedEntity.cpp @@ -21,7 +21,9 @@ #include #include -BtComboBoxNamedEntity::BtComboBoxNamedEntity(QWidget* parent) : QComboBox(parent) { +BtComboBoxNamedEntity::BtComboBoxNamedEntity(char const * const name, QWidget* parent) : + QComboBox{parent}, + m_name{name} { return; } @@ -37,7 +39,8 @@ void BtComboBoxNamedEntity::setCurrentId(int value) { // See comment in widgets/BtComboBoxNamedEntity.h for why the "nothing selected" option cannot appear explicitly // int const index {value < 0 ? -1 : this->findData(value)}; - qDebug() << Q_FUNC_INFO << "value:" << value << ", index:" << index; + qDebug() << Q_FUNC_INFO << this->m_name << "value:" << value << ", index:" << index; + // It's a coding error to set an ID we don't know about Q_ASSERT(value < 0 || index >= 0); diff --git a/src/widgets/BtComboBoxNamedEntity.h b/src/widgets/BtComboBoxNamedEntity.h index 9c6047be..fe517dd4 100755 --- a/src/widgets/BtComboBoxNamedEntity.h +++ b/src/widgets/BtComboBoxNamedEntity.h @@ -31,18 +31,22 @@ class BtComboBoxNamedEntity : public QComboBox { Q_OBJECT -public: - BtComboBoxNamedEntity(QWidget * parent); +protected: + BtComboBoxNamedEntity(char const * const name, QWidget * parent); virtual ~BtComboBoxNamedEntity(); /** - * \brief Set the ID of the selected \c NamedEntity + * \brief Set the ID of the selected \c NamedEntity. This should only be called via + * \c BtComboBoxNamedEntityBase::setItem() (which does additional checks). * * \param value -1 means nothing selected */ void setCurrentId(int value); int getCurrentId() const; + +private: + QString const m_name; }; @@ -133,10 +137,37 @@ class BtComboBoxNamedEntityBase : public CuriouslyRecurringTemplateBase item) { if (item) { - this->derived().setCurrentId(item->key()); - } else { - this->derived().setCurrentId(-1); + // + // For historical reasons, we still have users who have parent-child copies of various records in their DB. + // (This is from when each Recipe made a copy of the Equipment/Style/Mash etc records it used.) In these + // cases, only the parent record will be in the combo box, so we want to select that. + // + // Of course, just to make our lives fun, there are in fact many user databases where the parent-child + // relationships are not all present, so it's not guaranteed that we'll be able to find the "original" record. + // In these cases, we just show nothing in the combo box. The corresponding button will still show the actual + // record name, and the Recipe will retain this record if no new Equipment/Style/Mash is selected from the + // combo box. + // + // TBD At some point we want to see if we can get rid of all these parent-child records. + // + if (item->display()) { + this->derived().setCurrentId(item->key()); + return; + } + int const parentKey = item->getParentKey(); + if (parentKey > 0) { + auto parent = ObjectStoreWrapper::getById(parentKey); + if (parent->display()) { + this->derived().setCurrentId(parentKey); + return; + } + } + + // As mentioned above, in this event, we'll drop through and not show anything on the combo box + qWarning() << Q_FUNC_INFO << "Unable to find displayable parent for" << *item; } + + this->derived().setCurrentId(-1); return; } @@ -179,7 +210,7 @@ class BtComboBox##NeName : public BtComboBoxNamedEntity, \ */ #define BT_COMBO_BOX_NAMED_ENTITY_CODE(NeName) \ BtComboBox##NeName::BtComboBox##NeName(QWidget * parent) : \ - BtComboBoxNamedEntity{parent}, \ + BtComboBoxNamedEntity{"BtComboBox" #NeName, parent}, \ BtComboBoxNamedEntityBase Gem - + Equipment request Udstyr forespørgsel - + Would you like to set the batch size, boil size and time to that requested by the equipment? Ønsker du at sætte volumen af portion, volumen før kogning og varighed til udstyrets værdier? @@ -2121,39 +2121,39 @@ Logfil indeholder måske flere detaljer. Brewtarget database (*.sqlite) - + Recipe name Opskrift navn - + Recipe name: Opskrift navn: - + Backup Database Sikkerhedskopier database - - - + + + Oops! Hovsa! - + Could not copy the files for some reason. Kan ikke kopiere filer. - + A Warning Advarsel - + This will obliterate your current set of recipes and ingredients. Do you want to continue? Dette vil destruere det nuværende sæt af opskrifter og ingredienser. Fortsæt? @@ -2182,12 +2182,12 @@ Logfil indeholder måske flere detaljer. Indtast et unikt navn for kopien. - + Please give your mash a name before saving. Giv din mæsk et navn før du gemmer. - + Restart Genstart @@ -2196,32 +2196,32 @@ Logfil indeholder måske flere detaljer. Genstart Brewtarget. - + No equipment Intet udstyr - + You must select or define an equipment profile first. Vælg eller definer en udstyrsprofil først. - + No style Ingen stilart - + You must select a style first. Vælg en stilart først. - + Choose File Vælg fil - + SQLite (*.sqlite) SQLite (*.sqlite) @@ -2238,34 +2238,34 @@ Logfil indeholder måske flere detaljer. Importen indeholdt fejlbehæftet beerXML. Den er importeret men tjek om den ser fornuftig ud. - - + + Folder name Mappenavn - - + + Folder name: Mappenavn: - - - - + + + + Bad Name Uanvendeligt navn - - + + A folder name must have at least one non-whitespace character in it Et mappenavn skal indeholde mindst et tegn ud over mellemrum - - + + A folder name must have at least one non-/ character in it Et mappenavn skal indeholde mindst et tegn ud over bogstaver @@ -2274,13 +2274,14 @@ Logfil indeholder måske flere detaljer. Fejl ved kopiering af opskrift - + An error was returned while creating %1 Der opstod en fejl ved dannelse af %1 + Add %1 to recipe - Føj %1 til opskrift + Føj %1 til opskrift @@ -2292,8 +2293,9 @@ Logfil indeholder måske flere detaljer. Føj %1 trin til opskrift + Remove %1 - Fjern %1 + Fjern %1 @@ -2325,129 +2327,129 @@ Hvis du har brug for hjælp, bedes du åbne en sag (issue) på %1 Ændr opskriftnavn - - + + Change Recipe Style Ændr opskriftens stilart - + Change Recipe Mash Ændr mæskning for opskriften - + Change Recipe Equipment Ændr udstyr for opskriften - + Change Recipe Kit Ændr opskriftskit - + Change Tun Weight Ændr karrets masse - + Change Tun Specific Heat Ændr karrets specifikke varmefylde - - + + Change Batch Size Ændr volumen af portion - + Change Boil Size Ændr kogevolumen - + Change Boil Time Ændr varighed af kogning - + Drop fermentable(s) on a recipe Træk gærbar(e) til en opskrift - + Drop hop(s) on a recipe Træk humle(r) til en opskrift - + Drop misc(s) on a recipe Træk diverse ingrediens(er) til en opskrift - + Drop yeast(s) on a recipe Træk gær til en opskrift - + Change Recipe Efficiency Ændr effektivitet for opskrift - + Undo %1 Fortryd %1 - + Redo %1 Gentag %1 - + Error creating recipe Fejl ved dannelse af opskrift - + Operation failed. See log file for more details. Handlingen mislykkedes. Se detaljer i logfil. - + Please restart %1. Genstart venligst %1. - + Nothing to export Intet at eksportere - + None of the selected items is exportable Ingen af de markerede kan eksporteres - + No Mash Ingen mæskning - + You must define a mash first. Du skal først definere en mæskning. - + Automatically-created Boil for %1 Automatisk genereret kogning for %1 - + Automatically-created Fermentation for %1 Automatisk genereret gæring for %1 @@ -5977,8 +5979,9 @@ The final volume in the primary is %1. StepClass + Add %1 step to recipe - Føj %1 trin til opskrift + Føj %1 trin til opskrift @@ -6494,19 +6497,16 @@ The final volume in the primary is %1. Undoable - Add %1 to recipe - Føj %1 til opskrift + Føj %1 til opskrift - Remove %1 - Fjern %1 + Fjern %1 - Add %1 step to recipe - Føj %1 trin til opskrift + Føj %1 trin til opskrift @@ -7456,8 +7456,14 @@ The final volume in the primary is %1. editorClass + No - Nej + Nej + + + + Yes + @@ -8758,40 +8764,40 @@ The final volume in the primary is %1. mainWindow - - + + Recipes Opskrifter - + Styles Stilarter - - + + Fermentables Gærbare ingredienser - - + + Hops Humle - + Miscs Diverse - + Yeasts Gær - + Recipe Opskrift @@ -8800,12 +8806,12 @@ The final volume in the primary is %1. Navn - + Name of recipe Navn på opskrift - + The extraction efficiency you expect Forventet effektivitet af ekstraktion @@ -8814,332 +8820,332 @@ The final volume in the primary is %1. Stilart - + Boil Time Varighed af kogning - + Target batch size Tilsigtet volumen af portion - + Equipment Udstyr - + OG Startmassefylde (OG) - + Boil SG Massefylde før kogning - + FG Slutmassefylde (FG) - + ABV Alkoholvolumenprocent (ABV) - + Bitterness (IBU) Bitterhed (IBU) - + Color Farve - + IBU/GU IBU/GU - + Calories/12oz Kalorieindhold pr. 12 oz - + Extras Mere - + Brewday Bryggedag - + Add a fermentable Tilføj gærbar ingrediens - + Remove selected fermentable Fjern markeret gærbar ingrediens - + Edit selected fermentable Rediger markeret gærbar ingrediens - + Add hop Tilføj humle - + Remove selected hop Fjern markeret humle - + Edit selected hop Rediger markeret humle - + Miscellaneous Diverse ingredienser - + Add misc Tilføj diverseingrediens - + Remove selected misc Fjern markeret diverseingrediens - + Edit selected misc Rediger markeret diverseingrediens - + Yeast Gær - + Add yeast Tilføj gær - + Remove selected yeast Fjern markeret gær - + Edit selected yeast Rediger markeret gær - + Mash Mæskning - + Add mash step Tilføj mæsketrin - + Remove selected mash step Fjern markeret mæsketrin - + Edit selected mash step Rediger markeret mæsketrin - + Edit mash properties Rediger mæskeegenskaber - + Edit mash Rediger mæskning - + Mash Des Mæskning design - + Invoke the mash wizard Start mæskningsguide - + Mash wiz Mæskningsguide - + Mashs Mæskninger - + Mash step up Mæskning trin op - + Mash step down Mæskning trin ned - + Save this mash profile Gem denne mæskeprofil - + Save Mash Gem mæskning - + &About Om - + &File &Fil - + &Database &Database - + &View &Vis - + &Tools Værk&tøjer - + toolBar værktøjsbjælke - + &Fermentables &Gærbare ingredienser - + Ctrl+F Ctr+G - + &Hops &Humle - + Ctrl+H Ctrl+H - + Ctrl+M Ctrl+M - + &Yeasts &Gær - + Ctrl+Y Crtl+G - + &Equipments &Udstyr - + Ctrl+E Ctrl+U - + &Styles &Stilarter - + Ctrl+T Crtl+T - + Ctrl+Q Crtl+Q - + &Manual &Manual - + &Scale Recipe &Skaler opskrift - + Recipe to Clipboard as &Text Opskrift til klippebord som &tekst - + &OG Correction Help Hjælp til &OG korrektion - + &Convert Units Konverter enheder - + Backup Database Sikkerhedskopier database - + Restore Database Gendan database @@ -9148,113 +9154,113 @@ The final volume in the primary is %1. &Kopier opskrift - + Pr&iming Calculator Gært&ilsætning beregner - + &Refractometer Tools &Refraktometer værktøjer - + &Pitch Rate Calculator &Forgæringshastighed beregner - + &Backup &Sikkerhedskopiering - + Save all recipes, ingredients, etc. to a backup folder Gem alle opskrifter, ingredienser etc. til en sikkerhedskopimappe - + &Restore &Gendan - + Restore recipes, ingredients, etc. from a previous backup Gendan opskrifter, ingredienser etc. fra en tidligere sikkerhedskopi - + &New Recipe &Ny opskrift - + Show timers Vis timere - - + + Save Gem - + Delete selected Slet markeret - + Delete recipe Slet opskrift - + &Mashs &Mæskninger - + Mashes Mæskninger - + 1.0 1.0 - + Export to &BBCode Eksporter til &BBkode - + Water Vand - + &Name &Navn - + &Style &Stilart - + E&quipment &Udstyr - + Target Batch Si&ze Tilsigtet &volumen af portion - + Tar&get Boil Size Tilsigtet volumen før ko&gning @@ -9263,234 +9269,234 @@ The final volume in the primary is %1. (se faneblad Kogning herunder) - + &Efficiency (%) &Effektivitet (%) - + Recipe Locked Opskrift låst - + Batch Size Portion volumen - + Boil Size Volumen ved kogning - + Boil Kogning - + Add boil step Tilføj trin i kogning - + Remove selected boil step Fjern markeret trin i kogning - + Edit selected boil step Rediger markeret trin i kogning - + Edit boil properties Rediger egenskaber for kogning - + Edit boil Rediger kogning - + Boils Kogninger - + Boil step up Trin i kogning en plads op - + Boil step down Trin i kogning en plads ned - + Save this boil profile Gem denne kogningsprofil - + Save Boil Gem kogning - + Fermentation Gæring - + Add fermentation step Tilføj gæringstrin - + Remove selected fermentation step Fjern markeret gæringstrin - + Edit selected fermentation step Rediger markeret gæringstrin - + Edit fermentation properties Rediger gæringsegenskaber - + Edit fermentation Rediger gæring - + Fermentations Gæringer - + Fermentation step up Gæringstrin en plads op - + Fermentation step down Gæringstrin en plads ned - + Save this fermentation profile Gem denne gæringsprofil - + Save Fermentation Gem gæring - + Edit Rediger - - + + Help Hjælp - + &Export to File &Eksporter til fil - + M&iscs D&iverse ingredienser - + &Print and preview &Udskriv og forhåndsvisning - + Ctrl+P Crtl+P - + E&xit Afbryd - + &Import from File &Importer fra fil - + Optio&ns I&ndstillinger - + &Copy Selected Item(s) Kopier de markerede - + Ti&mers Ti&mere - + Strike &Water Calculator &Vandtemperatur ved malttilsætning beregner - + &Hydrometer Temp Adjustment &Hydrometer temperaturjustering - + Alcohol Percentage Tool Alkoholprocent værktøj - + Water &Chemistry Vand&kemi - + Undo Fortryd - + Redo Gentag - + Ancestors Kopieret fra - + Brew It! Bryg den! - - + + See Boil tab below Se faneblad Kogning herunder diff --git a/ui/equipmentEditor.ui b/ui/equipmentEditor.ui index 2ba1f635..eefc6eb1 100644 --- a/ui/equipmentEditor.ui +++ b/ui/equipmentEditor.ui @@ -248,7 +248,31 @@ + + + + + + ID in database + + + + + + + + + + + infoButton_id + + + You can normally ignore this, but it's sometimes useful for debugging. + + + + Qt::Vertical diff --git a/ui/styleEditor.ui b/ui/styleEditor.ui index 5db80ecb..5e4edc77 100644 --- a/ui/styleEditor.ui +++ b/ui/styleEditor.ui @@ -166,8 +166,33 @@ + + + + + + + ID in database + + + + + + + + + + + infoButton_id + + + You can normally ignore this, but it's sometimes useful for debugging. + + + + Ranges @@ -475,6 +500,16 @@ QComboBox
widgets/BtComboBoxEnum.h
+ + InfoButton + QPushButton +
widgets/InfoButton.h
+
+ + InfoText + QLabel +
widgets/InfoText.h
+
SmartLabel QLabel