Skip to content
Snippets Groups Projects
Commit b3025d9e authored by Eunice Sarah Siregar's avatar Eunice Sarah Siregar
Browse files

feat: update controller dashboard

parent 5430137d
1 merge request!7Plan
...@@ -5,6 +5,8 @@ from register import register ...@@ -5,6 +5,8 @@ from register import register
from dashboard import dashboard from dashboard import dashboard
from listlatihan2 import listLatihan2 from listlatihan2 import listLatihan2
from tesBacaDB import tesBaca from tesBacaDB import tesBaca
from customize import customizeWorkout
from plan import plan
class controller: class controller:
def __init__(self): def __init__(self):
self.conn = sqlite3.connect('fitu.db') self.conn = sqlite3.connect('fitu.db')
...@@ -12,9 +14,11 @@ class controller: ...@@ -12,9 +14,11 @@ class controller:
self.registerWin = register() self.registerWin = register()
self.registerWin.switch.connect(self.fromRegister) self.registerWin.switch.connect(self.fromRegister)
self.dashboard = dashboard() self.dashboard = dashboard()
# self.dashboard.switch.connect(self.fromDashboard) self.dashboard.switch.connect(self.fromDashboard)
# self.listLatihan = listLatihan2() self.listLatihan = listLatihan2()
# self.listLatihan.switch.connect(self.fromListLatihan) self.listLatihan.switch.connect(self.fromListLatihan)
self.customize = customizeWorkout()
self.plan = plan()
pass pass
...@@ -32,15 +36,23 @@ class controller: ...@@ -32,15 +36,23 @@ class controller:
self.registerWin.close() self.registerWin.close()
self.dashboard.show() self.dashboard.show()
# def fromDashboard(self, page): def fromDashboard(self, page):
# self.registerWin.close() self.registerWin.close()
# if (page == "listLatihan"): self.dashboard.close()
# self.listLatihan.show() if (page == "listLatihan"):
self.listLatihan.show()
elif (page == "customize"):
self.customize.show()
elif (page == "plan"):
self.plan.show()
# def fromListLatihan(self, page): def fromListLatihan(self, page):
# self.listLatihan.close() self.listLatihan.close()
# if (page == "dashboard"): if (page == "dashboard"):
# self.dashboard.show() self.dashboard.show()
elif (page == "customize"):
self.customize.show()
if __name__ == "__main__": if __name__ == "__main__":
app = QApplication(sys.argv) app = QApplication(sys.argv)
......
import sqlite3 import sqlite3
import sys import sys
from PyQt6.QtCore import Qt, QSize, QPropertyAnimation, QAbstractAnimation, QEasingCurve, QAnimationGroup from PyQt6.QtCore import Qt, QSize, QPropertyAnimation, QAbstractAnimation, QEasingCurve, QAnimationGroup, pyqtSignal
from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QGridLayout, from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QGridLayout,
QGroupBox, QRadioButton, QCheckBox, QMessageBox, QGroupBox, QRadioButton, QCheckBox, QMessageBox,
...@@ -13,8 +13,8 @@ text_color = '#EEEEE2' ...@@ -13,8 +13,8 @@ text_color = '#EEEEE2'
cardColor = '#D2DCC4' cardColor = '#D2DCC4'
class customizeWorkout(QWidget): class customizeWorkout(QWidget):
switch = pyqtSignal(str, dict)
def __init__(self): def __init__(self):
super().__init__() super().__init__()
...@@ -435,6 +435,7 @@ class customizeWorkout(QWidget): ...@@ -435,6 +435,7 @@ class customizeWorkout(QWidget):
saveButton.setCursor( saveButton.setCursor(
QCursor(Qt.CursorShape.PointingHandCursor)) QCursor(Qt.CursorShape.PointingHandCursor))
saveButton.clicked.connect(saveButtonClicked) saveButton.clicked.connect(saveButtonClicked)
if __name__ == '__main__': if __name__ == '__main__':
app = QApplication(sys.argv) app = QApplication(sys.argv)
......
import sys import sys
from PyQt6.QtCore import Qt, pyqtSignal, QSize from PyQt6.QtCore import Qt, pyqtSignal, QSize, pyqtSignal
from PyQt6.QtGui import QCursor, QFont, QPixmap, QMovie from PyQt6.QtGui import QCursor, QFont, QPixmap, QMovie
from PyQt6.QtWidgets import QApplication, QLabel, QPushButton, QWidget, QScrollArea, QVBoxLayout, QHBoxLayout from PyQt6.QtWidgets import QApplication, QLabel, QPushButton, QWidget, QScrollArea, QVBoxLayout, QHBoxLayout
import sqlite3 import sqlite3
...@@ -53,7 +53,7 @@ styleSheetCard = ( ...@@ -53,7 +53,7 @@ styleSheetCard = (
class dashboard(QWidget): class dashboard(QWidget):
switch_window = pyqtSignal(str, dict) switch = pyqtSignal(str, dict)
def __init__(self, user=None): def __init__(self, user=None):
super().__init__() super().__init__()
if (user == None): if (user == None):
...@@ -268,6 +268,7 @@ class dashboard(QWidget): ...@@ -268,6 +268,7 @@ class dashboard(QWidget):
customizeButton.move(649, 58) customizeButton.move(649, 58)
customizeButton.setCursor( customizeButton.setCursor(
QCursor(Qt.CursorShape.PointingHandCursor)) QCursor(Qt.CursorShape.PointingHandCursor))
customizeButton.clicked.connect(self.customWindow)
# tombol plan # tombol plan
planButton = QPushButton(self) planButton = QPushButton(self)
...@@ -301,6 +302,7 @@ class dashboard(QWidget): ...@@ -301,6 +302,7 @@ class dashboard(QWidget):
listButton.move(898, 58) listButton.move(898, 58)
listButton.setCursor( listButton.setCursor(
QCursor(Qt.CursorShape.PointingHandCursor)) QCursor(Qt.CursorShape.PointingHandCursor))
listButton.clicked.connect(self.listWindow)
# tombol history # tombol history
...@@ -355,6 +357,7 @@ class dashboard(QWidget): ...@@ -355,6 +357,7 @@ class dashboard(QWidget):
start.setFixedSize(233, 47) #pake ini buat kalau dia buletan start.setFixedSize(233, 47) #pake ini buat kalau dia buletan
start.move(101, 511) start.move(101, 511)
start.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) start.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
start.clicked.connect(self.planWindow)
# membuat history card # membuat history card
historyDate = cur.execute(""" historyDate = cur.execute("""
...@@ -476,11 +479,13 @@ class dashboard(QWidget): ...@@ -476,11 +479,13 @@ class dashboard(QWidget):
self.historyElement(historyDate, self.index_history+1) self.historyElement(historyDate, self.index_history+1)
def planWindow(self): def planWindow(self):
self.label = QLabel("") self.switch.emit("plan", {})
self.label.setParent(self)
# self.window = plan(self.user) def listWindow(self):
# self.window.show() self.switch.emit("listLatihan", {})
# self.close()
def customWindow(self):
self.switch.emit("customize", {})
def boxdelete(self, box): def boxdelete(self, box):
for i in range(self.vlayout.count()): for i in range(self.vlayout.count()):
......
...@@ -3,7 +3,7 @@ import sys ...@@ -3,7 +3,7 @@ import sys
import textwrap import textwrap
from functools import partial from functools import partial
from PyQt6.QtCore import Qt, QSize from PyQt6.QtCore import Qt, QSize, pyqtSignal
from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie
from PyQt6.QtWidgets import (QWidget, QApplication, QWidget, from PyQt6.QtWidgets import (QWidget, QApplication, QWidget,
QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QScrollArea, QDialog) QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QScrollArea, QDialog)
...@@ -21,8 +21,8 @@ titleLat = None ...@@ -21,8 +21,8 @@ titleLat = None
class listLatihan2(QWidget): class listLatihan2(QWidget):
switch = pyqtSignal(str, dict)
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.con = sqlite3.connect('fitu.db') self.con = sqlite3.connect('fitu.db')
self.listLat = self.fetchListLatihan() self.listLat = self.fetchListLatihan()
......
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