Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
6e275ba2
Commit
6e275ba2
authored
May 15, 2021
by
Yann Boucher
Browse files
Implémentation de l'interface de sauvegarde de structuree
parent
5b6763f5
Pipeline
#77954
passed with stages
in 17 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forms/interface.ui
View file @
6e275ba2
...
...
@@ -569,11 +569,38 @@ pattern recorded :</string>
<x>
0
</x>
<y>
0
</y>
<width>
1089
</width>
<height>
2
6
</height>
<height>
2
5
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuFichier"
>
<property
name=
"title"
>
<string>
Fichier
</string>
</property>
</widget>
<widget
class=
"QMenu"
name=
"menuEditer"
>
<property
name=
"title"
>
<string>
Éditer
</string>
</property>
<addaction
name=
"action_save_struct"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuA_propos"
>
<property
name=
"title"
>
<string>
À propos
</string>
</property>
</widget>
<addaction
name=
"menuFichier"
/>
<addaction
name=
"menuEditer"
/>
<addaction
name=
"menuA_propos"
/>
</widget>
<widget
class=
"QStatusBar"
name=
"statusbar"
/>
<action
name=
"action_save_struct"
>
<property
name=
"text"
>
<string>
Sauvegarder la sélection
</string>
</property>
<property
name=
"shortcut"
>
<string>
Ctrl+Shift+S
</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
...
...
forms/structuresavingdialog.ui
0 → 100644
View file @
6e275ba2
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
StructureSavingDialog
</class>
<widget
class=
"QDialog"
name=
"StructureSavingDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"title"
>
<string>
Sauvegarde d'une structure
</string>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Nom :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"nom"
/>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Auteur :
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"auteur"
/>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Description :
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QPlainTextEdit"
name=
"desc"
>
<property
name=
"placeholderText"
>
<string>
Entrer une description de la structure, ses caractéristiques remarquables...
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Date de création :
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QDateEdit"
name=
"date"
/>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>
buttonBox
</sender>
<signal>
accepted()
</signal>
<receiver>
StructureSavingDialog
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
248
</x>
<y>
254
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
157
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
buttonBox
</sender>
<signal>
rejected()
</signal>
<receiver>
StructureSavingDialog
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
316
</x>
<y>
260
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
286
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
include/interface.hpp
View file @
6e275ba2
...
...
@@ -46,6 +46,9 @@ private slots:
//! \brief Active le bouton pour valider la dimension de la grille lors d'une modification dans le Line Edit
void
on_heightSpinBox_valueChanged
(
int
arg1
);
//! \brief Affiche l'interface pour sauvegarder la sélection actuelle comme une structure
void
afficher_interface_sauvegarde_structure
(
bool
);
private:
Ui
::
MainWindow
*
ui
;
};
...
...
include/structuresavingdialog.hpp
0 → 100644
View file @
6e275ba2
#ifndef STRUCTURESAVINGDIALOG_HPP
#define STRUCTURESAVINGDIALOG_HPP
#include
<QDialog>
namespace
Ui
{
class
StructureSavingDialog
;
}
class
StructureSavingDialog
:
public
QDialog
{
Q_OBJECT
public:
explicit
StructureSavingDialog
(
QWidget
*
parent
=
nullptr
);
~
StructureSavingDialog
();
QString
auteur
()
const
;
QString
titre
()
const
;
QString
desc
()
const
;
QDate
date
()
const
;
private:
Ui
::
StructureSavingDialog
*
ui
;
};
#endif // STRUCTURESAVINGDIALOG_HPP
src/interface.cpp
View file @
6e275ba2
#include
"interface.hpp"
#include
"ui_interface.h"
#include
"structuresavingdialog.hpp"
MainWindow
::
MainWindow
(
QWidget
*
parent
)
:
QMainWindow
(
parent
)
,
ui
(
new
Ui
::
MainWindow
)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
action_save_struct
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
afficher_interface_sauvegarde_structure
);
}
MainWindow
::~
MainWindow
()
...
...
@@ -68,6 +72,12 @@ void MainWindow::on_heightSpinBox_valueChanged(int arg1)
ui
->
validateGridDim
->
setEnabled
(
true
);
}
void
MainWindow
::
afficher_interface_sauvegarde_structure
(
bool
)
{
StructureSavingDialog
dialog
(
this
);
dialog
.
exec
();
}
void
MainWindow
::
on_validateGridDim_clicked
()
{
...
...
src/src.pro
View file @
6e275ba2
...
...
@@ -24,7 +24,8 @@ SOURCES += \
grid
.
cpp
\
history
.
cpp
\
vonNeumannNeighborhoodRule
.
cpp
\
structurewriter
.
cpp
structurewriter
.
cpp
\
structuresavingdialog
.
cpp
HEADERS
+=
\
..
/
include
/
coord
.
hpp
\
...
...
@@ -44,10 +45,12 @@ HEADERS += \
..
/
include
/
alphabet
.
hpp
\
..
/
include
/
stateColor
.
hpp
\
..
/
include
/
state
.
hpp
\
..
/
include
/
history
.
h
..
/
include
/
history
.
h
\
..
/
include
/
structuresavingdialog
.
hpp
FORMS
+=
\
..
/
forms
/
interface
.
ui
..
/
forms
/
interface
.
ui
\
..
/
forms
/
structuresavingdialog
.
ui
#
Default
rules
for
deployment
.
...
...
src/structuresavingdialog.cpp
0 → 100644
View file @
6e275ba2
#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
();
}
Yann Boucher
@yboucher
mentioned in issue
#45 (closed)
·
May 15, 2021
mentioned in issue
#45 (closed)
mentioned in issue #45
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment