Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
Jeopardy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hacksaar
Jeopardy
Commits
db0dd8b1
Commit
db0dd8b1
authored
Jan 17, 2017
by
Agrigor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some minor changes regarding renaming and preperation for further programming of the question GUI
parent
4294f06f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
client/GUIs/main.ui
client/GUIs/main.ui
+6
-0
client/GUIs/question.ui
client/GUIs/question.ui
+1
-1
client/gui.py
client/gui.py
+21
-14
No files found.
client/GUIs/main.ui
View file @
db0dd8b1
...
...
@@ -10,6 +10,12 @@
<height>
900
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Minimum"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"windowTitle"
>
<string>
Hacker Jeopardy by Hacksaar
</string>
</property>
...
...
client/GUIs/question.ui
View file @
db0dd8b1
...
...
@@ -3,7 +3,7 @@
<class>
Question
</class>
<widget
class=
"QDialog"
name=
"Question"
>
<property
name=
"windowModality"
>
<enum>
Qt::
N
onModal
</enum>
<enum>
Qt::
Applicati
onModal
</enum>
</property>
<property
name=
"geometry"
>
<rect>
...
...
client/gui.py
View file @
db0dd8b1
...
...
@@ -31,7 +31,7 @@ TIMEOUT = 30
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class
Comunication
:
class
Com
m
unication
:
def
__init__
(
self
,
ip
,
port
):
self
.
ip
=
ip
self
.
port
=
port
...
...
@@ -61,7 +61,7 @@ class Player:
self
.
solved
=
[[
0
for
i
in
range
(
5
)]
for
j
in
range
(
5
)]
class
WaitForBu
tton
(
QThread
):
class
WaitForBu
zzer
(
QThread
):
def
__init__
(
self
,
socket
):
QThread
.
__init__
(
self
)
self
.
socket
=
socket
...
...
@@ -361,28 +361,33 @@ class QuestionGUI(QDialog):
self
.
socket
=
socket
self
.
UI_Main
=
UI_Main
self
.
buttonNumber
=
0
self
.
wait
=
5
self
.
wait
forbutton
=
WaitForButton
(
self
.
socket
)
self
.
connect
(
self
.
wait
forbutton
,
SIGNAL
(
"finished(int)"
),
self
.
done
)
self
.
wait
forbutton
.
start
()
self
.
wait
ForBuzzer
=
WaitForBuzzer
(
self
.
socket
)
self
.
connect
(
self
.
wait
ForBuzzer
,
SIGNAL
(
"finished(int)"
),
self
.
buzzerTriggered
)
self
.
wait
ForBuzzer
.
start
()
self
.
time
=
TIMEOUT
self
.
timer
=
QTimer
(
self
)
self
.
timer
.
timeout
.
connect
(
self
.
time
Handler
)
self
.
timer
.
timeout
.
connect
(
self
.
time
rFunction
)
self
.
timer
.
start
(
1000
)
self
.
UI_Question
.
show
()
def
done
(
self
,
buttonNumber
):
self
.
waitforbutton
.
exit
()
self
.
timer
.
stop
()
def
buzzerTriggered
(
self
,
buttonNumber
):
self
.
waitForBuzzer
.
exit
()
self
.
UI_Main
.
showMsg
(
"Player "
+
str
(
buttonNumber
)
+
" pressed the button"
)
def
time
Handler
(
self
):
if
self
.
time
>
0
:
def
time
rFunction
(
self
):
if
self
.
time
>
0
and
self
.
waitForBuzzer
.
isRunning
()
:
self
.
time
-=
1
self
.
UI_Question
.
TimeLCD
.
display
(
self
.
time
)
else
:
elif
self
.
waitForBuzzer
.
isFinished
():
if
self
.
wait
>
0
:
self
.
wait
-=
1
else
:
self
.
wait
=
5
self
.
waitForBuzzer
.
start
()
elif
self
.
time
==
0
:
self
.
UI_Main
.
showMsg
(
"No one pressed a button"
)
def
closeEvent
(
self
,
event
):
...
...
@@ -393,11 +398,13 @@ class MainGUI(QMainWindow):
def
__init__
(
self
):
QMainWindow
.
__init__
(
self
)
self
.
UI_Main
=
loadUi
(
"GUIs/main.ui"
,
self
)
self
.
socket
=
Comunication
(
""
,
PORT
)
self
.
socket
=
Com
m
unication
(
""
,
PORT
)
self
.
players
=
[
Player
()
for
i
in
range
(
PLAYERS_MAX
)]
self
.
questionPaths
=
[]
self
.
numberOfPlayers
=
0
self
.
UI_Main
.
showMaximized
()
self
.
categoryNames
=
[
self
.
UI_Main
.
Cat_Name_1
,
self
.
UI_Main
.
Cat_Name_2
,
self
.
UI_Main
.
Cat_Name_3
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment