Commit 93058035 authored by Tom Pillot's avatar Tom Pillot
Browse files

Add option to start an activity

parent b99cfb70
......@@ -46,6 +46,9 @@ class MainWindow(qtw.QMainWindow):
self.edit_button = qtw.QPushButton("Modifier")
self.delete_button = qtw.QPushButton("Supprimer")
self.scan_button = qtw.QPushButton("Scanner le tag")
self.activity_box = qtw.QComboBox()
self.time_edit = qtw.QTimeEdit()
self.start_button = qtw.QPushButton("Démarrer l'activité")
hlayout1 = qtw.QHBoxLayout()
hlayout1.addWidget(qtw.QLabel("Nom de l'équipe :"))
......@@ -64,12 +67,37 @@ class MainWindow(qtw.QMainWindow):
hlayout4.addWidget(self.edit_button)
hlayout4.addWidget(self.delete_button)
vlayout = qtw.QVBoxLayout()
vlayout.addWidget(self.table_view)
vlayout.addLayout(hlayout1)
vlayout.addLayout(hlayout3)
vlayout.addLayout(hlayout4)
widget.setLayout(vlayout)
vlayout1 = qtw.QVBoxLayout()
vlayout1.addWidget(self.table_view)
vlayout1.addLayout(hlayout1)
vlayout1.addLayout(hlayout3)
vlayout1.addLayout(hlayout4)
vertical_spacer = qtw.QSpacerItem(20, 40, qtw.QSizePolicy.Minimum, qtw.QSizePolicy.Expanding)
vlayout2 = qtw.QVBoxLayout()
vlayout2.addWidget(qtw.QLabel("Choix de l'activité :"))
vlayout2.addWidget(self.activity_box)
vlayout2.addItem(vertical_spacer)
vlayout2.addWidget(qtw.QLabel("Choix du temps :"))
vlayout2.addWidget(self.time_edit)
vlayout2.addItem(vertical_spacer)
vlayout2.addWidget(self.start_button)
vlayout2.addStretch()
hlayout5 = qtw.QHBoxLayout()
hlayout5.addLayout(vlayout1)
# Add a vertical line
vline = qtw.QFrame()
vline.setFrameShape(qtw.QFrame.VLine)
vline.setMinimumWidth(10)
vline.setFrameShadow(qtw.QFrame.Sunken)
vline.setLineWidth(3)
hlayout5.addWidget(vline)
hlayout5.addLayout(vlayout2)
widget.setLayout(hlayout5)
self.scan_button.clicked.connect(self.detect_tag)
self.add_button.clicked.connect(self.add_team)
......@@ -115,7 +143,9 @@ class MainWindow(qtw.QMainWindow):
del self.tag_ids[name]
def is_valid(self, new_name, new_tag_id):
"""Check that the name and the id are valid and not already used"""
"""
Check that the name and the id are valid and not already used
"""
for name, tag_id in self.tag_ids.items():
if name == new_name:
self.status_bar.showMessage("Une équipe avec ce nom existe déjà.", 5000)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment