/** * Paramètres chargés pour la capture (fichier ~/.config/irap/climso-auto.conf sous linux) * On peut modifier les paramètres par défaut en modifiant la valeur du * second paramètres de value(): value("le-nom-du-parametre",valeurParDéfaut) * Certains de ces paramètres sont aussi modifiables depuis le logiciel (menu > paramètres) */ void Capture::chargerParametres() { QSettings parametres("irap", "climso-auto"); diametre = parametres.value("diametre-soleil-en-pixel", 275).toInt(); // diamètre du soleil en pixels normaliserImageAffichee = parametres.value("normaliser-image-affichee", true).toBool(); modifierDiametre(diametre); emit diametreSoleil(diametre); }
static void _php_imap_add_body(Object &ret, BODY *body, bool do_multipart) { if (body->type <= TYPEMAX) { ret.o_set("type", body->type); } if (body->encoding <= ENCMAX) { ret.o_set("encoding", body->encoding); } if (body->subtype) { ret.o_set("ifsubtype", 1); ret.o_set("subtype", String((const char*)body->subtype, CopyString)); } else { ret.o_set("ifsubtype", 0); } if (body->description) { ret.o_set("ifdescription", 1); ret.o_set("description", String((const char*)body->description, CopyString)); } else { ret.o_set("ifdescription", 0); } if (body->id) { ret.o_set("ifid", 1); ret.o_set("id", String((const char*)body->id, CopyString)); } else { ret.o_set("ifid", 0); } if (body->size.lines) { ret.o_set("lines", (int64_t)body->size.lines); } if (body->size.bytes) { ret.o_set("bytes", (int64_t)body->size.bytes); } if (body->disposition.type) { ret.o_set("ifdisposition", 1); ret.o_set("disposition", String((const char*)body->disposition.type, CopyString)); } else { ret.o_set("ifdisposition", 0); } if (body->disposition.parameter) { PARAMETER *dpar; dpar = body->disposition.parameter; ret.o_set("ifdparameters", 1); Array dparametres(Array::Create()); do { Object dparam(SystemLib::AllocStdClassObject()); dparam.o_set("attribute", String((const char*)dpar->attribute, CopyString)); dparam.o_set("value", String((const char*)dpar->value, CopyString)); dparametres.append(dparam); } while ((dpar = dpar->next)); ret.o_set("dparameters", dparametres); } else { ret.o_set("ifdparameters", 0); } PARAMETER *par; Array parametres(Array::Create()); if ((par = body->parameter)) { ret.o_set("ifparameters", 1); do { Object param(SystemLib::AllocStdClassObject()); OBJ_SET_ENTRY(param, par, "attribute", attribute); OBJ_SET_ENTRY(param, par, "value", value); parametres.append(param); } while ((par = par->next)); ret.o_set("parameters", parametres); } else { ret.o_set("ifparameters", 0); } if (do_multipart) { /* multipart message ? */ if (body->type == TYPEMULTIPART) { parametres.clear(); PART *part; for (part = body->nested.part; part; part = part->next) { Object param(SystemLib::AllocStdClassObject()); _php_imap_add_body(param, &part->body, do_multipart); parametres.append(param); } ret.o_set("parts", parametres); } /* encapsulated message ? */ if ((body->type == TYPEMESSAGE) && (!strcasecmp(body->subtype, "rfc822"))) { body = body->nested.msg->body; parametres.clear(); Object param(SystemLib::AllocStdClassObject()); _php_imap_add_body(param, body, do_multipart); parametres.append(param); ret.o_set("parts", parametres); } } }
void Capture::enregistrerParametres() { QSettings parametres("irap", "climso-auto"); parametres.setValue("diametre-soleil-en-pixel", diametre); parametres.setValue("normaliser-image-affichee",normaliserImageAffichee); }