Skip to content

Commit 8189d49

Browse files
committedFeb 13, 2025
Improvements
1 parent 57b7545 commit 8189d49

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed
 

‎coordinator.cpp

+13-7
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@
55
Coordinator::Coordinator(QObject *parent) : QObject(parent) {
66
myWindow = new SignInScreen();
77
myWindow2 = new registerscreen();
8-
myWindow3 = new Schedule();
98
popUpWindow = new settingsWindow();
10-
menuWin = new menuWindow();
119
gradeWin = new gradesWindow();
1210
abscWin = new absenceWindow();
1311
absencePopUp = new inputAbsence();
1412

1513
QObject::connect(abscWin, &absenceWindow::scheduleAbsenceOpened, this, &Coordinator::sendScheduleAbsence);
16-
17-
QObject::connect(this, &Coordinator::sendScheduleAbsence, myWindow3, [&](){
18-
myWindow3->onSomething();
19-
});
2014
}
2115

2216
Coordinator::~Coordinator() {}
@@ -27,11 +21,16 @@ void Coordinator::showSignInScreen() {
2721

2822

2923
void Coordinator::showMenuWindow() {
24+
if (!menuWin) {
25+
menuWin = new menuWindow();
26+
}
3027
menuWin->show();
3128
}
3229

3330
void Coordinator::showAbsenceWindow() {
3431
menuWin->hide();
32+
//menuWin->deleteLater();
33+
//menuWin = nullptr;
3534
abscWin->show();
3635
}
3736

@@ -54,7 +53,14 @@ void Coordinator::showSettingsWindow() {
5453
}
5554

5655
void Coordinator::showSchedule() {
56+
abscWin->hide();
5757
absencePopUp->hide();
58-
menuWin->hide();
58+
hideAllScreenExcept();
59+
//menuWin->hide();
60+
//menuWin->deleteLater();
61+
//menuWin = nullptr;
62+
if (!myWindow3) {
63+
myWindow3 = new Schedule();
64+
}
5965
myWindow3->show();
6066
}

‎coordinator.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef COORDINATOR_HPP
22
#define COORDINATOR_HPP
33

4-
#include "BackendlessQt/BackendlessAPI.hpp"
54
#include "absencewindow.hpp"
65
#include "gradeswindow.hpp"
76
#include "httpclient.hpp"
@@ -11,6 +10,10 @@
1110
#include <QObject>
1211
#include <QPointer>
1312

13+
enum class Screen {
14+
15+
};
16+
1417
class Coordinator : public QObject {
1518
Q_OBJECT
1619

‎schedule.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ Schedule::Schedule(QWidget*parent): QWidget(parent) {
7777
});
7878

7979
//absence signal recieved
80-
80+
QObject::connect(coordinator, &Coordinator::sendScheduleAbsence, this, [&](){
81+
this->onSomething();
82+
});
8183

8284
//in absence add mode
8385
QObject::connect(calendar, &QTableWidget::cellClicked, this, [&](){

0 commit comments

Comments
 (0)
Please sign in to comment.