From cc802e5d0d0cfb8eb15dc930f8a7038683f957f0 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Sun, 11 Mar 2018 09:33:48 +0100 Subject: [PATCH] Fixed new unit dialog, added open recipe dialog. --- RecipeDB.pro | 6 +- gui/newDialogs/newunitdialog.cpp | 8 +- gui/newrecipedialog.cpp | 2 +- gui/newrecipedialog.ui | 28 ++--- .../openrecipedialog.cpp | 0 openrecipedialog.h => gui/openrecipedialog.h | 0 gui/openrecipedialog.ui | 111 ++++++++++++++++++ images.qrc | 1 + images/search_icon.png | Bin 0 -> 9900 bytes openrecipedialog.ui | 19 --- 10 files changed, 133 insertions(+), 42 deletions(-) rename openrecipedialog.cpp => gui/openrecipedialog.cpp (100%) rename openrecipedialog.h => gui/openrecipedialog.h (100%) create mode 100644 gui/openrecipedialog.ui create mode 100644 images/search_icon.png delete mode 100644 openrecipedialog.ui diff --git a/RecipeDB.pro b/RecipeDB.pro index 791ba66..b170e61 100644 --- a/RecipeDB.pro +++ b/RecipeDB.pro @@ -33,7 +33,7 @@ SOURCES += model/recipe/instruction.cpp \ gui/newDialogs/newunitdialog.cpp \ utils/aspectratiopixmaplabel.cpp \ utils/stringutils.cpp \ - openrecipedialog.cpp + gui/openrecipedialog.cpp HEADERS += model/recipe/instruction.h \ model/recipe/recipe.h \ @@ -56,7 +56,7 @@ HEADERS += model/recipe/instruction.h \ gui/newDialogs/newunitdialog.h \ utils/aspectratiopixmaplabel.h \ utils/stringutils.h \ - openrecipedialog.h + gui/openrecipedialog.h LIBS += -ldl \ @@ -65,7 +65,7 @@ FORMS += gui/mainwindow.ui \ gui/newDialogs/newingredientdialog.ui \ gui/newDialogs/newtagdialog.ui \ gui/newDialogs/newunitdialog.ui \ - openrecipedialog.ui + gui/openrecipedialog.ui DISTFILES += \ .gitignore diff --git a/gui/newDialogs/newunitdialog.cpp b/gui/newDialogs/newunitdialog.cpp index d89acaf..e7be030 100644 --- a/gui/newDialogs/newunitdialog.cpp +++ b/gui/newDialogs/newunitdialog.cpp @@ -8,10 +8,8 @@ NewUnitDialog::NewUnitDialog(QWidget *parent) : ui->setupUi(this); ui->typeComboBox->clear(); - ui->typeComboBox->setItemData(0, "Mass"); - ui->typeComboBox->setItemData(1, "Volume"); - ui->typeComboBox->setItemData(2, "Length"); - ui->typeComboBox->setItemData(3, "Misc"); + QStringList list({"Mass", "Volume", "Length", "Misc"}); + ui->typeComboBox->insertItems(0, list); } @@ -23,7 +21,7 @@ NewUnitDialog::~NewUnitDialog() UnitOfMeasure NewUnitDialog::getUnit(){ return UnitOfMeasure(ui->unitNameEdit->text().toLower().toStdString(), ui->pluralNameEdit->text().toLower().toStdString(), - ui->abbreviationEdit->text().toLower().toStdString(), + ui->abbreviationEdit->text().toStdString(), this->getSelectedType(), ui->coefficientSpinBox->value()); } diff --git a/gui/newrecipedialog.cpp b/gui/newrecipedialog.cpp index 93e3ffa..99459dc 100644 --- a/gui/newrecipedialog.cpp +++ b/gui/newrecipedialog.cpp @@ -173,7 +173,7 @@ void NewRecipeDialog::on_newUnitButton_clicked(){ d.show(); if (d.exec() == QDialog::Accepted){ UnitOfMeasure u = d.getUnit(); - if (!this->recipeDB->storeUnitOfMeasure(u)){ + if (!this->recipeDB->storeUnitOfMeasure(u) || u.getName().empty() || u.getNamePlural().empty() || u.getAbbreviation().empty()){ QMessageBox::critical(this, "Error", "Unable to store new unit."); } else { this->populateUnitsBox(); diff --git a/gui/newrecipedialog.ui b/gui/newrecipedialog.ui index e7ef5e9..a470909 100644 --- a/gui/newrecipedialog.ui +++ b/gui/newrecipedialog.ui @@ -26,6 +26,9 @@ :/images/images/icon.png:/images/images/icon.png + + font: 25 "Noto Sans CJK KR"; + true @@ -97,9 +100,7 @@ - Noto Sans CJK KR - 14 - 50 + 3 false false @@ -116,7 +117,9 @@ - PreferAntialias + 3 + false + false @@ -532,9 +535,7 @@ - Noto Sans CJK KR - 14 - 50 + 3 false false @@ -745,9 +746,9 @@ - Liberation Serif - 12 - true + 3 + false + false @@ -765,10 +766,9 @@ - Liberation Serif - 12 - 75 - true + 3 + false + false diff --git a/openrecipedialog.cpp b/gui/openrecipedialog.cpp similarity index 100% rename from openrecipedialog.cpp rename to gui/openrecipedialog.cpp diff --git a/openrecipedialog.h b/gui/openrecipedialog.h similarity index 100% rename from openrecipedialog.h rename to gui/openrecipedialog.h diff --git a/gui/openrecipedialog.ui b/gui/openrecipedialog.ui new file mode 100644 index 0000000..d0fca63 --- /dev/null +++ b/gui/openrecipedialog.ui @@ -0,0 +1,111 @@ + + + OpenRecipeDialog + + + + 0 + 0 + 640 + 480 + + + + Open Recipe + + + + :/images/images/icon.png:/images/images/icon.png + + + true + + + + + + + + + + + + Name + + + + + + + + + + + + + + + + Tag + + + + + + + + + + + + + + + + Ingredient + + + + + + + + + + + + + + + + + :/images/images/search_icon.png:/images/images/search_icon.png + + + + + + + + + + + + + QFrame::NoFrame + + + true + + + + + + + + + + + + + diff --git a/images.qrc b/images.qrc index 2391914..8b12ebf 100644 --- a/images.qrc +++ b/images.qrc @@ -4,5 +4,6 @@ images/icon.png images/plus_icon.png images/minus_icon.png + images/search_icon.png diff --git a/images/search_icon.png b/images/search_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac3e7c3e9d6f4a1c26c8e98b2afdfb4e4830a2 GIT binary patch literal 9900 zcmb7qby$?$*X~2NNJ)bN0)jNsC6a=4C|!a`cem1lfRr>Np-4$ccSv^$14!49()I0m z&-**q_x*9sb2YG6r>DYeIy#Ni=MRaM@}zTQ7~Gwm9-uRfz?+ryl$p(& zRjdT4@tI*prF(WZW2e>CTW-b0;)WkSh#L|RWFV+s$m`qL)mPX3Hrw5kKVQH-!@z|G z=16aD{I_aqi2RqkeJ%572&vpv?#^e8-+4RrMvp2gN}o#U`Df}91M6YZ zd+r`{b)BxZEvjme?aC^jWweMz@29|zk2K{lByVb>(qaj>(lJNf1fRgapZ^J~+p4g7 zGGR3|Z(rw5;HDBtoekl~DLhViFEjX=j4JgLDKU>tQqkNLxtq$f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yUVgVIlVga_YkyS4q{XWApLuv>L{#J4F3=v z%1)Tc9<$R!?5fOg%Lft&#Vm6*`)?9&i2(!Z%_luP9Q0sXxr585z7wFO;t~iZjDH2% zLOXc&Lv8Jj_)0zxCFx(|szHJ9I^UbD+i`(p&}&_O8r){pFGWd@3zga2PV-vgzb=2N zw$39&L$0{$tTh65>QXL#C4XXfw{Xn!ViQOW3Bg}%94SP9#?UH_avP@DOG`6JlTm|fG)#*2gIa8M zGiK>Hmc)kY!Ke^TFPx*RRtx3gc;gOf5cocr!O!ASN~an$ zS-M!UY;m>bYwzwd`{|NLPJ^w!(>FIeQDvQ1#IBf|&MFgM*mOmKi2(@-fiv!N>Q-K} zP&k$oZmbPD#E~@~IlI?T3jzAm@1CV!71zuztIc#^+&dXl!@K&BIE18)3h`HtekR#X z1;rnVKR&#b@cdZ(G9-u&f=(H*mj*cWinZEy{87978~u;ccqtQjzN3KWc4gyNu!_XQ zj~lD$g?NExQC(bq{l#2F3I#H`AJ24qSgi-2F)~*5nI)C=+fT~M>iIG?Hh;q1!U#bj z53rYNqe)nTpIHrlfeHUpIsAsxE)RRZGtDZ&4TQs3ztuS2-b}7VMwS)Uy5Iz<3C-m{ z_ZRWpU$!G*c0~9}ZGdU=rn`;&z1A8eZ)X&35tIR>+S*QA<3R!anFF?#?N}I4-~)zt zW=V9 Uv5eURACM0!%BskeNSg%z7oSxj?EnA( literal 0 HcmV?d00001 diff --git a/openrecipedialog.ui b/openrecipedialog.ui deleted file mode 100644 index 31f318f..0000000 --- a/openrecipedialog.ui +++ /dev/null @@ -1,19 +0,0 @@ - - - OpenRecipeDialog - - - - 0 - 0 - 640 - 480 - - - - Dialog - - - - -