void EditStudiesInfosWidget::saveRequest(){
    Studies s(getInformationText(highSchool),getInformationText(qualification));
    bool stopped=false;
    int r=0;
    for(;r<model->rowCount() && !stopped;r++){
        stopped=(model->item(r,university)->text()=="" || model->item(r,course)->text()=="" || model->item(r,situation)->text()=="");
        ((model->item(r,3)->text().contains(" e lode"))?
                s.addDegree(Degree(model->item(r,university)->text(),
                                   model->item(r,course)->text(),
                                   model->item(r,situation)->text().mid(0,model->item(r,situation)->text().size()-7).toInt(),
                                   true)):
                s.addDegree(Degree(model->item(r,university)->text(),
                                   model->item(r,course)->text(),
                                   ((model->item(r,situation)->text()=="In corso")?0:
                                                                             model->item(r,situation)->text().toInt())
                                  )));
    }//for
    if(stopped){
        noDegree->setText("Informazioni mancanti nell'inserimento di una laurea.");
        noDegree->setVisible(true);
    }//if
    else if(r==0) cancel();
    else{
        Profile prof=getProfile();
        prof.updateInformationsBySectionName(Studies::getIDString(),s);
        emit save(prof);
    }//else
}//saveRequest
void EditPersonalInfosWidget::saveRequest(){
    Personal p((name->text()=="")?name->placeholderText():name->text(),
               (surname->text()=="")?surname->placeholderText():surname->text(),
               getInformationText(birthplace),
               getInformationText(birthState),
               calendar->selectedDate(),
               (male->isChecked())?Personal::M:Personal::F);
    Profile prof=getProfile();
    prof.updateInformationsBySectionName(Personal::getIDString(),p);
    emit save(prof);
}//saveRequest
void PluginInformation::retranslateInformation()
{
    if(!pluginIsLoaded)
        return;
    ui->retranslateUi(this);
    this->setWindowTitle(tr("Information about %1").arg(plugin.name));
    ui->name->setText(plugin.name);
    ui->title->setText(getTranslatedText(plugin,"title",language));
    ui->category->setText(categoryToTranslation(plugin.category));
    ui->author->setText(getInformationText(plugin,"author"));
    QString website=getTranslatedText(plugin,"website",language);
    ui->website->setText("<a href=\""+website+"\" title=\""+website+"\">"+website+"</a>");
    bool ok;
    int timeStamps=getInformationText(plugin,"pubDate").toInt(&ok);
    QDateTime date;
    date.setTime_t(timeStamps);
    ui->date->setDateTime(date);
    if(!ok || timeStamps<=0)
        ui->date->setEnabled(false);
    ui->description->setPlainText(getTranslatedText(plugin,"description",language));
    ui->version->setText(getInformationText(plugin,"version"));
}