Commit 7b29a21e authored by Antoine Lima's avatar Antoine Lima

Auth2P and leaderboard modules

parent 41ec7952
/__pycache__/
*/__pycache__/
*/*.log
*/*_ui.py
......
......@@ -21,7 +21,7 @@ class MainWin(QtWidgets.QMainWindow):
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.modules = [MenuModule, GameModule, OptionsModule]
self.modules = [MenuModule, GameModule, OptionsModule, AuthModule, LeaderboardModule]
for mod in self.modules:
self.ui.panels.addWidget(mod(self))
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 18:34:40 2018
@author: Antoine Lima, Leo Reynaert, Domitille Jehenne
"""
import logging
from PyQt5.QtCore import QTime
from module import Module
import modules
from ui.auth2p_ui import Ui_Form as Auth2pWidget
class AuthModule(Module):
def __init__(self, parent):
super().__init__(parent, Auth2pWidget())
self.ui.btnDone.clicked.connect (self.ui_handleClick_btnDone)
self.ui.btnCancel.clicked.connect(self.ui_handleClick_btnCancel)
def load(self):
logging.debug('Loading AuthModule')
def unload(self):
logging.debug('Unloading AuthModule')
def other(self, **kwargs):
logging.debug('Other AuthModule')
def ui_handleClick_btnCancel(self):
self.switchModule(modules.MenuModule)
def ui_handleClick_btnDone(self):
self.switchModule(modules.GameModule)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 18 18:34:40 2018
@author: Antoine Lima, Leo Reynaert, Domitille Jehenne
"""
import logging
from PyQt5.QtCore import QTime
from module import Module
import modules
from ui.leaderboard_ui import Ui_Form as LeaderboardWidget
class LeaderboardModule(Module):
def __init__(self, parent):
super().__init__(parent, LeaderboardWidget())
self.ui.btnExit.clicked.connect(self.ui_handleClick_btnExit)
def load(self):
logging.debug('Loading LeaderboardModule')
def unload(self):
logging.debug('Unloading LeaderboardModule')
def other(self, **kwargs):
logging.debug('Other LeaderboardModule')
def ui_handleClick_btnExit(self):
self.switchModule(modules.MenuModule)
......@@ -17,11 +17,12 @@ class MenuModule(Module):
super().__init__(parent, MenuWidget())
# Button connections
self.ui.btnStart2p.clicked.connect(self.ui_handleClick_btnStart)
self.ui.btnStartParty.clicked.connect(self.ui_handleClick_btnStart)
self.ui.btnStartLeague.clicked.connect(self.ui_handleClick_btnStart)
self.ui.btnOptions.clicked.connect(self.ui_handleClick_btnOptions)
self.ui.btnExit.clicked.connect(self.ui_handleClick_btnExit)
self.ui.btnStart2p.clicked.connect (lambda: self.switchModule(modules.AuthModule))
self.ui.btnStartParty.clicked.connect (lambda: self.switchModule(modules.GameModule))
self.ui.btnStartLeague.clicked.connect(lambda: self.switchModule(modules.GameModule))
self.ui.btnLeaderboard.clicked.connect(lambda: self.switchModule(modules.LeaderboardModule))
self.ui.btnOptions.clicked.connect (lambda: self.switchModule(modules.OptionsModule))
self.ui.btnExit.clicked.connect (self.ui_handleClick_btnExit)
def load(self):
logging.debug('Loading MenuModule')
......@@ -32,13 +33,6 @@ class MenuModule(Module):
def other(self, **kwargs):
logging.debug('Other MenuModule')
def ui_handleClick_btnStart(self):
logging.debug('start')
self.switchModule(modules.GameModule)
def ui_handleClick_btnOptions(self):
self.switchModule(modules.OptionsModule)
def ui_handleClick_btnExit(self):
logging.debug('exit')
logging.info('Closing..')
self.parent_win.close()
......@@ -41,9 +41,9 @@ class OptionsModule(Module):
def ui_handleClick_btnSave(self):
if self.ui.options.cellWidget(0, 1).currentText().lower() == 'true':
self.parentWin.showFullScreen()
self.parent_win.showFullScreen()
else:
self.parentWin.showNormal()
self.parent_win.showNormal()
self.switchModule(modules.MenuModule)
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>720</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>45</pointsize>
</font>
</property>
<property name="text">
<string>Leadderboard</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Sort By</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="radioButton_3">
<property name="text">
<string>Score</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>Time Played</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>Games Played</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Jump to</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
</item>
</layout>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1260</width>
<height>464</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTableWidget" name="tableWidget"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnExit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Exit</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
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