Commit 462c2576 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Remove CoolCooking-specific options (moved server side)

parent 857c5964
......@@ -43,7 +43,6 @@ private slots:
private:
void sendRecipe();
QString makeTags(QList<int> tpsPrep, QList<int> tpsCuis, QList<int> tpsRep);
};
#endif // SENDWORDPRESS_H
......@@ -31,7 +31,6 @@ extern QString corrOrtho;
extern QString appI18n;
extern bool richSnippets;
extern bool recPrinter;
extern bool recSearch;
extern bool recCoupDeCoeur;
extern int configActive;
extern QHash<int,QHash<QString, QString>> serverConfs;
......@@ -151,7 +150,6 @@ void Functions::loadConfig()
typeServer = serverConfs[configActive]["typeServer"];
richSnippets = serverConfs[configActive]["richSnippets"] == "1";
recPrinter = serverConfs[configActive]["recPrinter"] == "1";
recSearch = serverConfs[configActive]["recSearch"] == "1";
recCoupDeCoeur = serverConfs[configActive]["recCoupDeCoeur"] == "1";
}
......@@ -190,11 +188,6 @@ QHash<int, QHash<QString, QString>> Functions::loadServerConfigs() {
configServer[i]["recPrinter"] = xml.text().toString();
continue;
}
if(xml.name() == "recSearch") {
xml.readNext();
configServer[i]["recSearch"] = xml.text().toString();
continue;
}
if(xml.name() == "recCoupDeCoeur") {
xml.readNext();
configServer[i]["recCoupDeCoeur"] = xml.text().toString();
......
......@@ -64,7 +64,6 @@ QStringList units;
bool cancel = false; //Keep if user cancel orthographical correction
bool richSnippets = false; //Active rich snippets for recipes in google search results
bool recPrinter = false; //CeC Printer status
bool recSearch = false; //Activate or not search module
bool recCoupDeCoeur = false; //Activate or not "coups de coeur"
int configActive = 1;
QHash<int,QHash<QString, QString>> serverConfs; //Store config for all server configurations
......
This diff is collapsed.
......@@ -48,7 +48,6 @@ extern QString appI18n;
extern bool cancel;
extern bool richSnippets;
extern bool recPrinter;
extern bool recSearch;
extern bool recCoupDeCoeur;
extern int idRecipe;
extern bool openLastDir_sauvegarde;
......@@ -398,8 +397,8 @@ void QRecipeWriter::init()
ui->abcButton->setEnabled(false);
ui->actionCorrection_orthographique->setEnabled(false);
}
//CeC Coup de coeur ? :
ui->setCoupDeCoeur->setVisible(recCoupDeCoeur || typeServer == "pywebcooking");
//Coup de coeur ? :
ui->setCoupDeCoeur->setVisible(recCoupDeCoeur);
ui->sync_cats->setVisible(typeServer == "pywebcooking");
//Initialize ident variables:
idIngr = 0;
......@@ -688,7 +687,7 @@ void QRecipeWriter::on_actionOptions_triggered()
ui->noPrint->setToolTip(tr("Ne pas imprimer une partie de texte"));
ui->printOnly->setToolTip(tr("Imprimer une partie de texte mais ne pas l'afficher"));
}
ui->setCoupDeCoeur->setVisible(recCoupDeCoeur || typeServer == "pywebcooking");
ui->setCoupDeCoeur->setVisible(recCoupDeCoeur);
ui->sync_cats->setVisible(typeServer == "pywebcooking");
toggleEditPict();
}
......
......@@ -295,7 +295,9 @@ void SendPyWebCooking::sendRecipe() {
input.add_var("title", title);
input.add_var("precision", precision);
input.add_var("description", description);
input.add_var("coup_de_coeur", coupDeCoeur);
if (serverConfs[config]["recCoupDeCoeur"] == "1") {
input.add_var("coup_de_coeur", coupDeCoeur);
}
input.add_var("nb_people", QString::number(nbPeople));
input.add_var("nb_people_max", QString::number(nbPeopleMax));
input.add_var("tps_prep", QString::number(tpsPrep));
......
......@@ -31,29 +31,15 @@ void SendWordpress::init(QString htmlCode_lu, QString title_lu, QString mainPict
envoiEnCours = envoiEnCours_lu;
tags = "";
if (serverConfs[config]["recSearch"] == "1" && (categories.size() > 1 || categories[0] != "Base")) {
tags = makeTags(tpsPrep_lu, tpsCuis_lu, tpsRep_lu);
if (serverConfs[config]["recCoupDeCoeur"] == "1") {
tags += ",";
}
}
if (serverConfs[config]["recCoupDeCoeur"] == "1") {
tags += coupDeCoeur_lu;
}
this->sendRecipe();
}
QString SendWordpress::makeTags(QList<int> tpsPrep, QList<int> tpsCuis, QList<int> tpsRep)
{
int tPrep = tpsPrep[0] * 60 + tpsPrep[1];
int tCuis = tpsCuis[0] * 60 + tpsCuis[1];
int tRepos = tpsRep[0] * 24 * 60 + tpsRep[1] * 60 + tpsRep[2];
int tTotal = tPrep + tCuis + tRepos;
QString tags = "tpsPrep=" + QString::number(tPrep) + ",tpsCuis="
+ QString::number(tCuis) + ",tpsRepos="
+ QString::number(tRepos) + ",tpsTotal="
+ QString::number(tTotal);
return tags;
tpsPrep = tpsPrep_lu[0] * 60 + tpsPrep_lu[1];
tpsCuis = tpsCuis_lu[0] * 60 + tpsCuis_lu[1];
tpsRep = tpsRep_lu[0] * 24 * 60 + tpsRep_lu[1] * 60 + tpsRep_lu[2];
this->sendRecipe();
}
......@@ -123,6 +109,9 @@ void SendWordpress::sendRecipe() {
input.add_var("tags", tags);
input.add_var("thumbnail", mainPicture);
input.add_var("published", publish ? "1" : "0");
input.add_var("tps_prep", QString::number(tpsPrep));
input.add_var("tps_cuis", QString::number(tpsCuis));
input.add_var("tps_rep", QString::number(tpsRep));
if (!mainPicture.startsWith("http"))
input.add_file("main_picture", mainPicture, mainPictureName, "image/jpg");
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment