remove of visualisation and backPackTextEdit functional
This commit is contained in:
+19
-23
@@ -24,6 +24,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
ui->ageLineEdit->setValidator(new QIntValidator(0, 999999, ui->ageLineEdit));
|
||||
ui->niveauLineEdit->setValidator(new QIntValidator(0, 999999, ui->niveauLineEdit));
|
||||
ui->tailleLineEdit->setValidator(new QDoubleValidator(0.0, 999999.0, 1,ui->tailleLineEdit));
|
||||
ui->BackPack->setHidden(true);
|
||||
|
||||
|
||||
loadImage(QString("data/images/logo.png"));
|
||||
}
|
||||
|
||||
@@ -60,6 +63,7 @@ void MainWindow::loadNewCharacter(){
|
||||
|
||||
void MainWindow::createNewCharacter(Character* p) {
|
||||
notePad->setTexte(p->getTexteBlocNote());
|
||||
ui->BackPackPlainTextEdit->setPlainText(p->getTexteBlocNote());
|
||||
currentCharacter = p;
|
||||
characters.append(p);
|
||||
setUi(p);
|
||||
@@ -103,9 +107,7 @@ void MainWindow::saveJson(){
|
||||
return;
|
||||
}
|
||||
|
||||
if(edition){
|
||||
getUi();
|
||||
}
|
||||
getUi();
|
||||
notePad->getUi();
|
||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||
QJsonObject json;
|
||||
@@ -153,9 +155,7 @@ void MainWindow::saveAsJson(){
|
||||
setWindowTitle(fileName);
|
||||
currentFile = fileName;
|
||||
|
||||
if(edition){
|
||||
getUi();
|
||||
}
|
||||
getUi();
|
||||
notePad->getUi();
|
||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||
QJsonObject json;
|
||||
@@ -228,6 +228,7 @@ void MainWindow::getUi(){
|
||||
}
|
||||
}
|
||||
currentCharacter->setStats(stats);
|
||||
currentCharacter->setTexteBackPack(ui->BackPackPlainTextEdit->toPlainText());
|
||||
//currentCharacter->setImage();
|
||||
}
|
||||
|
||||
@@ -269,28 +270,21 @@ void MainWindow::setUi(Character* p){
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void MainWindow::on_actionEditer_triggered(){
|
||||
if(edition){
|
||||
//Mode edition
|
||||
}else{
|
||||
//Mode visualisation
|
||||
}
|
||||
edition=!edition;
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionBlocNote_triggered(){
|
||||
this->notePad->show();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::recevoirSauvegarde(QString contenu){
|
||||
currentCharacter->setTexteBlocNote(contenu);
|
||||
saveJson();
|
||||
}
|
||||
|
||||
void MainWindow::toogleBackPack(){
|
||||
if(ui->BackPack->isHidden()){
|
||||
ui->Edition->setHidden(true);
|
||||
ui->BackPack->setHidden(false);
|
||||
}else{
|
||||
ui->BackPack->setHidden(true);
|
||||
ui->Edition->setHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::on_actionOuvrir_une_fiche_triggered(){this->loadNewCharacter();}
|
||||
@@ -298,4 +292,6 @@ void MainWindow::on_actionNouvelle_fiche_triggered(){this->createNewCharacter(ne
|
||||
void MainWindow::on_actionSauvegarder_triggered(){this->saveJson();}
|
||||
void MainWindow::on_actionEnregistrer_sous_triggered(){this->saveAsJson();}
|
||||
void MainWindow::on_actionFermer_triggered(){QApplication::quit();}
|
||||
void MainWindow::on_actionBlocNote_triggered(){this->notePad->show();}
|
||||
void MainWindow::on_actionBackPack_triggered(){this->toogleBackPack();}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user