structuresavingdialog.cpp 928 Bytes
Newer Older
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
#include "structuresavingdialog.hpp"
#include "ui_structuresavingdialog.h"

#include <QDate>

StructureSavingDialog::StructureSavingDialog(QWidget *parent) :
      QDialog(parent),
      ui(new Ui::StructureSavingDialog)
{
    ui->setupUi(this);

    // récupérer le nom de l'utilisateur actuel
    QString name;
    name = qgetenv("USER"); // get the user name in Linux
    if (name.isEmpty())
        name = qgetenv("USERNAME"); // get the name in Windows

    ui->auteur->setText(name);
    ui->date->setDate(QDate::currentDate());
}

StructureSavingDialog::~StructureSavingDialog()
{
    delete ui;
}

QString StructureSavingDialog::auteur() const
{
    return ui->auteur->text();
}

QString StructureSavingDialog::titre() const
{
    return ui->nom->text();
}

QString StructureSavingDialog::desc() const
{
    return ui->desc->toPlainText();
}

QDate StructureSavingDialog::date() const
{
    return ui->date->date();
}