mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-18 16:50:17 +00:00
22 lines
686 B
Python
22 lines
686 B
Python
from arcaea_offline.database import Database
|
|
from PySide6.QtWidgets import QWidget
|
|
|
|
from ui.designer.tabs.tabInputScore_ui import Ui_TabInputScore
|
|
|
|
|
|
class TabInputScore(Ui_TabInputScore, QWidget):
|
|
def __init__(self, parent=None):
|
|
super().__init__(parent)
|
|
self.setupUi(self)
|
|
self.chartAndScoreInput.scoreCommited.connect(self.commit)
|
|
|
|
def commit(self):
|
|
score = self.chartAndScoreInput.value()
|
|
if not score:
|
|
return
|
|
Database().insert_score(score)
|
|
self.chartAndScoreInput.scoreEditor.reset()
|
|
self.chartAndScoreInput.scoreEditor.setChart(
|
|
self.chartAndScoreInput.chartSelector.value()
|
|
)
|