From 0106d7bbff3b9989219e602f08b15b377b4d10e9 Mon Sep 17 00:00:00 2001
From: Egor Deev <67710823+IGlek@users.noreply.github.com>
Date: Tue, 30 Nov 2021 21:28:23 +0700
Subject: [PATCH] v. 2.1
---
main.py | 40 +-
rasp.ui | 1172 ++++++++++++++++++++++++++++++------------------------
table.db | Bin 24576 -> 24576 bytes
3 files changed, 688 insertions(+), 524 deletions(-)
diff --git a/main.py b/main.py
index 6453fc6..46f2cd9 100644
--- a/main.py
+++ b/main.py
@@ -21,10 +21,14 @@ class MyWidget(QMainWindow): # Ui_MainWindow
self.cursor = self.connection.cursor()
# РАСПИСАНИЕ
- self.add_but.clicked.connect(self.add) # ДОБАВЛЕНИЕ ПРЕДМЕТОВ
- self.upd_but.clicked.connect(self.upd) # ИЗМЕНЕНИЕ ПРЕДМЕТОВ
- self.clear_but.clicked.connect(self.clear) # УБИРАНИЕ ПРЕДМЕТОВ
- self.del_but.clicked.connect(self.delete) # УДАЛЕНИЕ ПРЕДМЕТОВ
+ self.add_but.clicked.connect(self.add) # ДОБАВЛЕНИЕ
+ self.upd_but.clicked.connect(self.upd) # ИЗМЕНЕНИЕ
+ self.clear_but.clicked.connect(self.clear) # УБИРАНИЕ
+ self.del_but.clicked.connect(self.delete) # УДАЛЕНИЕ
+
+ self.check_but1.clicked.connect(self.check) # ВЫДЕЛЕНИЕ
+ self.check_but2.clicked.connect(self.check)
+ self.check_but3.clicked.connect(self.check)
# ДАННЫЕ ТАБЛИЦЫ
self.table()
@@ -54,15 +58,15 @@ class MyWidget(QMainWindow): # Ui_MainWindow
for i, row in enumerate(subjects):
day.setRowCount(day.rowCount() + 1)
for j, elem in enumerate(row):
- day.setItem(i, j, QTableWidgetItem(str(elem)))
+ day.setItem(i, j, QTableWidgetItem(elem))
day.horizontalHeader().setStretchLastSection(True)
- # ЗАПОЛНЕНИЕ ВЫПАДАЮЩИХ СПИСКОВ ADD / UPD / DEL
+ # ЗАПОЛНЕНИЕ ВЫПАДАЮЩИХ СПИСКОВ ADD / UPD / DEL / CHECK
try:
with self.connection:
lessons = self.cursor.execute('SELECT `name` FROM `lessons`').fetchall()
lessons = [i[0] for i in lessons]
- for choose_obj in [self.choose_obj1, self.choose_obj2, self.choose_obj3]:
+ for choose_obj in [self.choose_obj1, self.choose_obj2, self.choose_obj3, self.choose_obj4]:
choose_obj.clear()
if choose_obj == self.choose_obj1:
choose_obj.insertItem(0, "Новый предмет")
@@ -201,6 +205,28 @@ class MyWidget(QMainWindow): # Ui_MainWindow
self.cursor.execute(f"UPDATE `timetable` SET `less_{less}` = ? WHERE `id` = ?", (None, day))
self.table()
+ def check(self):
+ index, sender = self.choose_obj4.currentText(), self.sender().text()
+ with self.connection:
+ ids = self.cursor.execute("SELECT `id` FROM `lessons` WHERE `name` = ?", (index,)).fetchone()[0]
+
+ tables = [self.Mon_school, self.Tue_school, self.Wed_school,
+ self.Thu_school, self.Fri_school, self.Sat_school]
+
+ for day in range(1, 7):
+ with self.connection:
+ lessons = self.cursor.execute("SELECT * FROM `timetable` WHERE `id` = ?", (day,)).fetchone()
+ lessons = list(lessons)[2:]
+ if ids in lessons:
+ for less in range(1, 9):
+ if ids == lessons[less - 1]:
+ if sender == "Выделить":
+ tables[day - 1].item(less - 1, 0).setBackground(QtGui.QColor(0, 150, 100))
+ elif sender == "Отменить":
+ tables[day - 1].item(less - 1, 0).setBackground(QtGui.QColor(255, 255, 255))
+ else:
+ self.table()
+
def notes(self):
pass
diff --git a/rasp.ui b/rasp.ui
index 80d6fa3..4ffe814 100644
--- a/rasp.ui
+++ b/rasp.ui
@@ -6,12 +6,18 @@
0
0
- 1002
- 817
+ 1192
+ 809
+
+
+ 50
+ false
+
+
- MainWindow
+ School Table
@@ -20,6 +26,12 @@
-
+
+
+ 75
+ true
+
+
0
@@ -68,52 +80,6 @@
- -
-
-
-
- 240
- 370
-
-
-
-
-
-
-
-
- 14
-
-
-
- QLable { font-size: 14px; }
-
-
- Понедельник
-
-
-
- -
-
-
- -
-
-
-
- 16777215
- 80
-
-
-
-
- 0
- 0
-
-
-
-
-
-
-
-
@@ -234,30 +200,76 @@
- -
-
+
-
+
+
+
+ 240
+ 370
+
+
+
+
-
+
+
+
+ 14
+
+
+
+ QLable { font-size: 14px; }
+
+
+ Понедельник
+
+
+
+ -
+
+
+ -
+
+
+
+ 16777215
+ 80
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+ -
+
190
0
-
-
- 190
- 16777215
-
-
-
+
-
-
+
-
-
+
+
+
+ 0
+ 0
+
+
16777215
- 170
+ 210
@@ -268,261 +280,50 @@
- Добавить предмет
+ Предмет
Qt::AlignCenter
-
+
+
+ 6
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-
-
-
-
- 152
- 30
-
-
-
-
- 9
-
-
- QLayout::SetFixedSize
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 72
- 25
-
-
-
-
-
- Пн
-
-
- -
-
- Вт
-
-
- -
-
- Ср
-
-
- -
-
- Чт
-
-
- -
-
- Пт
-
-
- -
-
- Сб
-
-
-
-
- -
-
-
-
- 71
- 25
-
-
-
-
-
- След.
-
-
- -
-
- 1
-
-
- -
-
- 2
-
-
- -
-
- 3
-
-
- -
-
- 4
-
-
- -
-
- 5
-
-
- -
-
- 6
-
-
- -
-
- 7
-
-
- -
-
- 8
-
-
-
-
-
-
-
- -
-
+
0
- 25
+ 32
-
-
+
0
- 25
-
-
-
-
- -
-
-
-
- 0
- 37
-
-
-
-
- -1
-
-
-
- QPushButton {
- padding:10px;
- color: #fffff;
- font-size: 18px;
- border-radius: 10px;
- border: 1px solid #3873d9;
- background-color: white;
- box-shadow: 0 0 10px rgb(0, 0, 0);\n
- transition: all 1s;
-}
-
-QPushButton:hover{
- background-color: rgb(171, 211, 247);
- effect = QtWidgets.QGraphicsDropShadowEffect(QPushButton)
- effect.setOffset(0, 0)
- effect.setBlurRadius(20)
- effect.setColor(QColor(57, 219, 255))
- QPushButton.setGraphicsEffect(effect)
-}
-
-
- Обновить
-
-
-
-
-
-
- -
-
-
- -
-
-
-
- 16777215
- 170
-
-
-
-
- 10
- 75
- true
-
-
-
- Изменть предмет
-
-
- Qt::AlignCenter
-
-
-
-
-
-
-
- 0
- 25
-
-
-
-
- -
-
-
-
- 0
- 25
-
-
-
-
- -
-
-
-
- 0
- 35
-
-
-
-
- 16777215
- 37
+ 40
-1
+ 50
+ false
@@ -544,7 +345,83 @@ QPushButton:hover{
}
- Изменить
+ Выделить
+
+
+
+ -
+
+
+
+ 0
+ 40
+
+
+
+
+ -1
+ 50
+ false
+
+
+
+ QPushButton {
+ padding:10px;
+ color: #fffff;
+ font-size: 18px;
+ border-radius: 10px;
+ border: 1px solid #3873d9;
+ background-color: white; }
+
+QPushButton:hover{
+ background-color: rgb(171, 211, 247);
+ effect = QtWidgets.QGraphicsDropShadowEffect(QPushButton)
+ effect.setOffset(0, 0)
+ effect.setBlurRadius(20)
+ effect.setColor(QColor(57, 219, 255))
+ QPushButton.setGraphicsEffect(effect)
+}
+
+
+ Отменить
+
+
+
+ -
+
+
+
+ 0
+ 40
+
+
+
+
+ -1
+ 50
+ false
+
+
+
+ QPushButton {
+ padding:10px;
+ color: #fffff;
+ font-size: 18px;
+ border-radius: 10px;
+ border: 1px solid #3873d9;
+ background-color: white; }
+
+QPushButton:hover{
+ background-color: rgb(171, 211, 247);
+ effect = QtWidgets.QGraphicsDropShadowEffect(QPushButton)
+ effect.setOffset(0, 0)
+ effect.setBlurRadius(20)
+ effect.setColor(QColor(57, 219, 255))
+ QPushButton.setGraphicsEffect(effect)
+}
+
+
+ Очистить
@@ -594,176 +471,284 @@ QPushButton:hover{
- -
-
+
-
+
190
0
-
+
+
+ 190
+ 16777215
+
+
+
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 170
-
-
+
- 10
+ 8
75
true
-
- Убрать предмет
+
+ 0
-
- Qt::AlignCenter
-
-
-
- 6
-
-
- 9
-
-
- 9
-
-
- 9
-
-
- 9
-
-
-
-
-
-
- 0
- 30
-
-
-
-
-
- Везде
+
+
+ Добавить
+
+
+
-
+
+
+
+ 148
+ 30
+
-
- -
-
- Пн
+
+
+ 9
+
+
+ QLayout::SetFixedSize
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 69
+ 25
+
+
+
+
+ 10
+
+
+
-
+
+ Пн
+
+
+ -
+
+ Вт
+
+
+ -
+
+ Ср
+
+
+ -
+
+ Чт
+
+
+ -
+
+ Пт
+
+
+ -
+
+ Сб
+
+
+
+
+ -
+
+
+
+ 69
+ 25
+
+
+
+
+ 10
+
+
+
-
+
+ След.
+
+
+ -
+
+ 1
+
+
+ -
+
+ 2
+
+
+ -
+
+ 3
+
+
+ -
+
+ 4
+
+
+ -
+
+ 5
+
+
+ -
+
+ 6
+
+
+ -
+
+ 7
+
+
+ -
+
+ 8
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 25
+
-
- -
-
- Вт
+
+
+ 10
+
-
- -
-
- Ср
+
+
+ -
+
+
+
+ 0
+ 25
+
-
- -
-
- Чт
+
+
+ 10
+
-
- -
-
- Пт
+
+
+ -
+
+
+
+ 0
+ 37
+
-
- -
-
- Сб
+
+
+ -1
+
-
-
-
- -
-
-
-
- 0
- 30
-
-
-
-
-
- Все
+
+ QPushButton {
+ padding:10px;
+ color: #fffff;
+ font-size: 18px;
+ border-radius: 10px;
+ border: 1px solid #3873d9;
+ background-color: white;
+ box-shadow: 0 0 10px rgb(0, 0, 0);\n
+ transition: all 1s;
+}
+
+QPushButton:hover{
+ background-color: rgb(171, 211, 247);
+ effect = QtWidgets.QGraphicsDropShadowEffect(QPushButton)
+ effect.setOffset(0, 0)
+ effect.setBlurRadius(20)
+ effect.setColor(QColor(57, 219, 255))
+ QPushButton.setGraphicsEffect(effect)
+}
-
- -
- 1
+ Обновить
-
- -
-
- 2
+
+
+
+
+
+
+ Удалить
+
+
+ -
+
+
+
+ 0
+ 32
+
-
- -
-
- 3
+
+
+ 10
+
-
- -
-
- 4
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 37
+
-
- -
-
- 5
+
+
+ -1
+ 50
+ false
+
-
- -
-
- 6
-
-
- -
-
- 7
-
-
- -
-
- 8
-
-
-
-
- -
-
-
-
- 0
- 40
-
-
-
-
- -1
-
-
-
- QPushButton {
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -779,86 +764,85 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Убрать
-
-
-
-
+
+
+ Удалить
+
+
+
+
+
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 170
-
-
+
- 10
75
true
-
- Удалить предмет
+
+ 0
-
- Qt::AlignCenter
-
-
-
- 6
-
-
- 9
-
-
- 9
-
-
- 9
-
-
- 9
-
-
-
-
-
-
- 0
- 30
-
-
-
-
- -
-
-
-
- 0
- 40
-
-
-
-
- -1
-
-
-
- QPushButton {
+
+
+ Изменить
+
+
+
-
+
+
+
+ 0
+ 30
+
+
+
+
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 30
+
+
+
+
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 40
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+
+ -1
+ 50
+ false
+
+
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -874,27 +858,181 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Удалить
-
-
-
-
+
+
+ Изменить
+
+
+
+
+
+
+
+ Убрать
+
+
+ -
+
+
+
+ 0
+ 30
+
+
+
+
+ 10
+
+
+
-
+
+ Везде
+
+
+ -
+
+ Пн
+
+
+ -
+
+ Вт
+
+
+ -
+
+ Ср
+
+
+ -
+
+ Чт
+
+
+ -
+
+ Пт
+
+
+ -
+
+ Сб
+
+
+
+
+ -
+
+
+
+ 0
+ 30
+
+
+
+
+ 10
+
+
+
-
+
+ Все
+
+
+ -
+
+ 1
+
+
+ -
+
+ 2
+
+
+ -
+
+ 3
+
+
+ -
+
+ 4
+
+
+ -
+
+ 5
+
+
+ -
+
+ 6
+
+
+ -
+
+ 7
+
+
+ -
+
+ 8
+
+
+
+
+ -
+
+
+
+ 0
+ 40
+
+
+
+
+ -1
+
+
+
+ QPushButton {
+ padding:10px;
+ color: #fffff;
+ font-size: 18px;
+ border-radius: 10px;
+ border: 1px solid #3873d9;
+ background-color: white; }
+
+QPushButton:hover{
+ background-color: rgb(171, 211, 247);
+ effect = QtWidgets.QGraphicsDropShadowEffect(QPushButton)
+ effect.setOffset(0, 0)
+ effect.setBlurRadius(20)
+ effect.setColor(QColor(57, 219, 255))
+ QPushButton.setGraphicsEffect(effect)
+}
+
+
+ Убрать
+
+
+
+
+
- Add_Upd
Saturday
Friday
Thursday
Wednesday
Tuesday
Monday
- Clear_Del
+ Check_Obj
+ AToolBars
diff --git a/table.db b/table.db
index 77524f9c6a0a1d752098c6ebf95b7e0b46853758..baa778c760067148051d21961aea3aa3c6b9a345 100644
GIT binary patch
delta 109
zcmZoTz}Rqrae_3X$wV1vMw5*Ri}X1-8QA!a>GDf&<}&!tr^#=@ASBEP0SvzRd9t#i
ojNA;UB64yG5-J<}&!tH(AiP?(Vc0)i7u
d)FvC*TT4LszWI6l{CsTO48l->&8_y;3IL7{5lH|5