-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwaffichertache.cpp
96 lines (76 loc) · 3.41 KB
/
waffichertache.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "waffichertache.h"
#include <QString>
WindowAfficherTache::WindowAfficherTache(Tache *ta, QWidget *parent):
tache(ta), QWidget(parent)
{
setFixedSize(300, 350);
frame = new QVBoxLayout;
titre_title = new QHBoxLayout;
titre_label = new QLabel("Titre: ");
titre_text = new QLineEdit(tache->getTitle());
//Tache
action = new QHBoxLayout;
action_label = new QLabel("*Action :");
action_box = new QTextEdit(tache->getAction());
statut = new QHBoxLayout;
statut_label = new QLabel("*Statut : (en_cours, attente, terminee)");
statut_box = new QLineEdit(enum_statut_to_qstring(tache->getStatut()));
priorite = new QHBoxLayout;
prio_label = new QLabel("Priorite (>=0) :");
//QString tmp = to_string(tache->getPriorite());
prio_box = new QLineEdit(QString::number(tache->getPriorite()));
date_echeance_day = new QHBoxLayout;
date_e_day_label= new QLabel("Date d'echeance : (i.e 01.01.2000)");
QString s = (tache->getDate_echeance()).toString("dd.MM.yyyy-hh::mm:ss");
date_e_day_box = new QLineEdit(s);
// date_echeance_min= new QHBoxLayout;
// date_e_min_label= new QLabel("Temps de l'echeance : (i.e. 12:00:00)");
// date_e_min_box= new QLineEdit;
button_bar = new QHBoxLayout;
button_save = new QPushButton("Sauvegarder");
//QObject::connect(button_create, SIGNAL(clicked()), this, SLOT(create()));
button_close = new QPushButton("Fermer");
QObject::connect(button_close, SIGNAL(clicked()), this, SLOT(close()));
titre_title->addWidget(titre_label); titre_title->addWidget(titre_text);
action->addWidget(action_label); action->addWidget(action_box);
statut->addWidget(statut_label); statut->addWidget(statut_box);
priorite->addWidget(prio_label); priorite->addWidget(prio_box);
date_echeance_day->addWidget(date_e_day_label); date_echeance_day->addWidget(date_e_day_box);
//date_echeance_min->addWidget(date_e_min_label); date_echeance_min->addWidget(date_e_min_box);
button_bar->addWidget(button_save); button_bar->addWidget(button_close);
frame->addLayout(titre_title);
frame->addLayout(action);
frame->addLayout(statut);
frame->addLayout(priorite);
frame->addLayout(date_echeance_day);
//frame->addLayout(date_echeance_min);
frame->addLayout(button_bar);
this->setLayout(frame);
}
/*
void WindowAfficherTache::save() {
QString text_act = getTextBox()->toPlainText();
QString s_statut = getStatutBox()->text();
QString s_prio = getPrioBox()->text(); //optionnelle
QString s_date_day = getDate_e_DayBox()->text();//optionnelle
QString s_date_min = getDate_e_MinBox()->text();//optionnelle
NotesManager* NM = NotesManager::getInstance();
Type_statut_tache statut_task=string_to_enum_statut(s_statut.QString::toStdString());
Note* newNote = new Note(identifiant);
//Tache()
Tache *newTache= new Tache(titre_version,QDateTime::currentDateTime(),text_act,statut_task);
if(!s_prio.QString::isNull()) //si priorite est rempli
{
newTache->setPriorite(s_prio.toUInt(0,10));
}
if(!(s_date_day.QString::isNull()) && !(s_date_min.QString::isNull())) //si les dates sont remplies
{
QString s_date = s_date_day + "-" +s_date_min;
QDateTime newDate=QDateTime::fromString(s_date);
newTache->setDate_echeance(newDate);
}
newNote->ajouterVersion(newTache);
NM->ajouterNote(newNote);
this->close();
}
*/