initial commit for deck repository tab
This commit is contained in:
parent
c0e64f3f42
commit
f31405743e
12 changed files with 1047 additions and 10 deletions
|
@ -43,6 +43,7 @@ HEADERS += src/counter.h \
|
|||
src/tab_server.h \
|
||||
src/tab_chatchannel.h \
|
||||
src/tab_game.h \
|
||||
src/tab_deck_storage.h \
|
||||
src/tab_supervisor.h \
|
||||
../common/decklist.h \
|
||||
../common/protocol.h \
|
||||
|
@ -86,6 +87,7 @@ SOURCES += src/counter.cpp \
|
|||
src/tab_server.cpp \
|
||||
src/tab_chatchannel.cpp \
|
||||
src/tab_game.cpp \
|
||||
src/tab_deck_storage.cpp \
|
||||
src/tab_supervisor.cpp \
|
||||
../common/decklist.cpp \
|
||||
../common/protocol.cpp \
|
||||
|
|
|
@ -20,10 +20,11 @@
|
|||
<file>translations/cockatrice_de.qm</file>
|
||||
<file>translations/cockatrice_en.qm</file>
|
||||
<file>resources/icon.svg</file>
|
||||
<file>resources/add_to_deck.svg</file>
|
||||
<file>resources/add_to_sideboard.svg</file>
|
||||
<file>resources/decrement.svg</file>
|
||||
<file>resources/increment.svg</file>
|
||||
<file>resources/remove_row.svg</file>
|
||||
<file>resources/arrow_left_green.svg</file>
|
||||
<file>resources/arrow_right_green.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
792
cockatrice/resources/arrow_left_green.svg
Normal file
792
cockatrice/resources/arrow_left_green.svg
Normal file
|
@ -0,0 +1,792 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64"
|
||||
height="64"
|
||||
id="svg2646"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.47pre4 r22446"
|
||||
version="1.0"
|
||||
sodipodi:docname="add_to_deck.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
||||
<defs
|
||||
id="defs2648">
|
||||
<linearGradient
|
||||
id="linearGradient3169">
|
||||
<stop
|
||||
style="stop-color:#0000ff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3171" />
|
||||
<stop
|
||||
style="stop-color:#000067;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3173" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient3175"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient4766">
|
||||
<stop
|
||||
style="stop-color:#784421;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4768" />
|
||||
<stop
|
||||
style="stop-color:#3d2210;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop4770" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2396"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)" />
|
||||
<linearGradient
|
||||
id="linearGradient4758">
|
||||
<stop
|
||||
style="stop-color:#a05a2c;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4760" />
|
||||
<stop
|
||||
style="stop-color:#3d2210;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop4762" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2399"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 526.18109 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
||||
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
||||
id="perspective2654" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2691"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2693"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2695"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2707"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2709"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2711"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient3508"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient3510"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient3512"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient3514"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient3516"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient3518"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient3520"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient3522"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient3524"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2444"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2446"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2448"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2450"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2452"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2454"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2456"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2458"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2460"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2478"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2480"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2482"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2484"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2486"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2488"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2490"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2492"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2494"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2527"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2529"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2531"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2533"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2535"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2537"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2539"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2541"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2543"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2545"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2547"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2549"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2561"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2563"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2565"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2594"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2596"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2598"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2600"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2602"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2604"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2606"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2608"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2610"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2612"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2614"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2616"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4758"
|
||||
id="linearGradient2618"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="590.62201"
|
||||
y1="434.7522"
|
||||
x2="698.54004"
|
||||
y2="517.79218" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4766"
|
||||
id="linearGradient2620"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
|
||||
x1="661.24402"
|
||||
y1="602.90814"
|
||||
x2="431.5"
|
||||
y2="201.5482" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3169"
|
||||
id="radialGradient2622"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.2116376,0,44.257186)"
|
||||
cx="120.07376"
|
||||
cy="56.138123"
|
||||
fx="120.07376"
|
||||
fy="56.138123"
|
||||
r="82.790039" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.625"
|
||||
inkscape:cx="58.42623"
|
||||
inkscape:cy="31.460692"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1272"
|
||||
inkscape:window-height="723"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="25"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata2651">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
style="display:inline" />
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Pfeil"
|
||||
style="display:inline">
|
||||
<path
|
||||
style="fill:#96ff96;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 28.61871,53.104623 0,-12.351931 32.248315,0 0,-17.505386 -32.248315,0 0,-12.351929 L 3.132975,31.999999 28.61871,53.104623 z"
|
||||
id="rect2714"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
179
cockatrice/src/tab_deck_storage.cpp
Normal file
179
cockatrice/src/tab_deck_storage.cpp
Normal file
|
@ -0,0 +1,179 @@
|
|||
#include <QtGui>
|
||||
#include <QDebug>
|
||||
#include "tab_deck_storage.h"
|
||||
#include "client.h"
|
||||
#include "decklist.h"
|
||||
#include "protocol_items.h"
|
||||
|
||||
enum { TWIFolderType = QTreeWidgetItem::UserType + 1, TWIDeckType = QTreeWidgetItem::UserType + 2 };
|
||||
|
||||
TabDeckStorage::TabDeckStorage(Client *_client)
|
||||
: QWidget(), client(_client)
|
||||
{
|
||||
localDirModel = new QFileSystemModel(this);
|
||||
QSettings settings;
|
||||
localDirModel->setRootPath(settings.value("paths/decks").toString());
|
||||
|
||||
sortFilter = new QSortFilterProxyModel(this);
|
||||
sortFilter->setSourceModel(localDirModel);
|
||||
sortFilter->setDynamicSortFilter(true);
|
||||
|
||||
localDirView = new QTreeView;
|
||||
localDirView->setModel(sortFilter);
|
||||
localDirView->setColumnHidden(1, true);
|
||||
localDirView->setRootIndex(sortFilter->mapFromSource(localDirModel->index(localDirModel->rootPath(), 0)));
|
||||
localDirView->setSortingEnabled(true);
|
||||
localDirView->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
QVBoxLayout *leftVbox = new QVBoxLayout;
|
||||
leftVbox->addWidget(localDirView);
|
||||
leftGroupBox = new QGroupBox;
|
||||
leftGroupBox->setLayout(leftVbox);
|
||||
|
||||
toolBar = new QToolBar;
|
||||
toolBar->setOrientation(Qt::Vertical);
|
||||
toolBar->setIconSize(QSize(24, 24));
|
||||
|
||||
serverDirView = new QTreeWidget;
|
||||
serverDirView->header()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
serverDirView->setColumnCount(3);
|
||||
|
||||
QVBoxLayout *rightVbox = new QVBoxLayout;
|
||||
rightVbox->addWidget(serverDirView);
|
||||
rightGroupBox = new QGroupBox;
|
||||
rightGroupBox->setLayout(rightVbox);
|
||||
|
||||
QHBoxLayout *hbox = new QHBoxLayout;
|
||||
hbox->addWidget(leftGroupBox);
|
||||
hbox->addWidget(toolBar);
|
||||
hbox->addWidget(rightGroupBox);
|
||||
|
||||
aUpload = new QAction(this);
|
||||
aUpload->setIcon(QIcon(":/resources/arrow_right_green.svg"));
|
||||
connect(aUpload, SIGNAL(triggered()), this, SLOT(actUpload()));
|
||||
aDownload = new QAction(this);
|
||||
aDownload->setIcon(QIcon(":/resources/arrow_left_green.svg"));
|
||||
connect(aDownload, SIGNAL(triggered()), this, SLOT(actDownload()));
|
||||
aNewFolder = new QAction(this);
|
||||
connect(aNewFolder, SIGNAL(triggered()), this, SLOT(actNewFolder()));
|
||||
aDelete = new QAction(this);
|
||||
aDelete->setIcon(QIcon(":/resources/remove_row.svg"));
|
||||
connect(aDelete, SIGNAL(triggered()), this, SLOT(actDelete()));
|
||||
|
||||
toolBar->addAction(aUpload);
|
||||
toolBar->addAction(aDownload);
|
||||
toolBar->addAction(aNewFolder);
|
||||
toolBar->addAction(aDelete);
|
||||
|
||||
retranslateUi();
|
||||
setLayout(hbox);
|
||||
|
||||
refreshServerList();
|
||||
}
|
||||
|
||||
void TabDeckStorage::retranslateUi()
|
||||
{
|
||||
leftGroupBox->setTitle(tr("Local file system"));
|
||||
rightGroupBox->setTitle(tr("Server deck storage"));
|
||||
|
||||
aUpload->setText(tr("Upload deck"));
|
||||
aDownload->setText(tr("Download deck"));
|
||||
aNewFolder->setText(tr("New folder"));
|
||||
aDelete->setText(tr("Delete"));
|
||||
|
||||
QTreeWidgetItem *header = serverDirView->headerItem();
|
||||
header->setText(0, tr("Name"));
|
||||
header->setText(1, tr("ID"));
|
||||
header->setText(2, tr("Upload time"));
|
||||
header->setTextAlignment(1, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void TabDeckStorage::refreshServerList()
|
||||
{
|
||||
Command_DeckList *command = new Command_DeckList;
|
||||
connect(command, SIGNAL(finished(ProtocolResponse *)), this, SLOT(deckListFinished(ProtocolResponse *)));
|
||||
client->sendCommand(command);
|
||||
}
|
||||
|
||||
void TabDeckStorage::populateDeckList(Response_DeckList::Directory *folder, QTreeWidgetItem *parent)
|
||||
{
|
||||
QFileIconProvider fip;
|
||||
QTreeWidgetItem *newItem = new QTreeWidgetItem(TWIFolderType);
|
||||
newItem->setIcon(0, fip.icon(QFileIconProvider::Folder));
|
||||
newItem->setText(0, parent ? folder->getName() : "/");
|
||||
QString parentPath;
|
||||
if (parent) {
|
||||
parent->addChild(newItem);
|
||||
parentPath = parent->data(0, Qt::UserRole).toString();
|
||||
} else
|
||||
serverDirView->addTopLevelItem(newItem);
|
||||
newItem->setData(0, Qt::UserRole, parentPath + "/" + folder->getName());
|
||||
|
||||
for (int i = 0; i < folder->size(); ++i) {
|
||||
Response_DeckList::Directory *subFolder = dynamic_cast<Response_DeckList::Directory *>(folder->at(i));
|
||||
if (subFolder)
|
||||
populateDeckList(subFolder, newItem);
|
||||
else {
|
||||
Response_DeckList::File *file = dynamic_cast<Response_DeckList::File *>(folder->at(i));
|
||||
QTreeWidgetItem *newDeck = new QTreeWidgetItem(TWIDeckType);
|
||||
newDeck->setIcon(0, fip.icon(QFileIconProvider::File));
|
||||
newDeck->setData(0, Qt::DisplayRole, file->getName());
|
||||
newDeck->setData(1, Qt::DisplayRole, file->getId());
|
||||
newDeck->setTextAlignment(1, Qt::AlignRight);
|
||||
newDeck->setData(2, Qt::DisplayRole, file->getUploadTime());
|
||||
|
||||
newItem->addChild(newDeck);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TabDeckStorage::deckListFinished(ProtocolResponse *r)
|
||||
{
|
||||
Response_DeckList *resp = qobject_cast<Response_DeckList *>(r);
|
||||
if (!resp)
|
||||
return;
|
||||
|
||||
serverDirView->clear();
|
||||
populateDeckList(resp->getRoot(), 0);
|
||||
}
|
||||
|
||||
void TabDeckStorage::actUpload()
|
||||
{
|
||||
QModelIndex cur = sortFilter->mapToSource(localDirView->selectionModel()->currentIndex());
|
||||
if (localDirModel->isDir(cur))
|
||||
return;
|
||||
QString filePath = localDirModel->filePath(cur);
|
||||
DeckList *deck = new DeckList;
|
||||
if (!deck->loadFromFile(filePath, DeckList::CockatriceFormat))
|
||||
return;
|
||||
|
||||
QString targetPath;
|
||||
QTreeWidgetItem *curRight = serverDirView->currentItem();
|
||||
while ((curRight != 0) && (curRight->type() != TWIFolderType))
|
||||
curRight = curRight->parent();
|
||||
if (curRight)
|
||||
targetPath = curRight->data(0, Qt::UserRole).toString();
|
||||
qDebug() << "targetPath:" << targetPath;
|
||||
|
||||
Command_DeckUpload *command = new Command_DeckUpload(-1, deck, targetPath);
|
||||
connect(command, SIGNAL(finished(ProtocolResponse *)), this, SLOT(uploadFinished(ProtocolResponse *)));
|
||||
client->sendCommand(command);
|
||||
}
|
||||
|
||||
void TabDeckStorage::uploadFinished(ProtocolResponse *r)
|
||||
{
|
||||
qDebug() << "buh";
|
||||
}
|
||||
|
||||
void TabDeckStorage::actDownload()
|
||||
{
|
||||
}
|
||||
|
||||
void TabDeckStorage::actNewFolder()
|
||||
{
|
||||
}
|
||||
|
||||
void TabDeckStorage::actDelete()
|
||||
{
|
||||
}
|
||||
|
44
cockatrice/src/tab_deck_storage.h
Normal file
44
cockatrice/src/tab_deck_storage.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#ifndef TAB_DECK_STORAGE_H
|
||||
#define TAB_DECK_STORAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "protocol.h"
|
||||
|
||||
class Client;
|
||||
class QTreeView;
|
||||
class QFileSystemModel;
|
||||
class QSortFilterProxyModel;
|
||||
class QToolBar;
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
class QGroupBox;
|
||||
|
||||
class TabDeckStorage : public QWidget {
|
||||
Q_OBJECT
|
||||
private:
|
||||
Client *client;
|
||||
QTreeView *localDirView;
|
||||
QFileSystemModel *localDirModel;
|
||||
QSortFilterProxyModel *sortFilter;
|
||||
QToolBar *toolBar;
|
||||
QTreeWidget *serverDirView;
|
||||
QGroupBox *leftGroupBox, *rightGroupBox;
|
||||
|
||||
QAction *aUpload, *aDownload, *aNewFolder, *aDelete;
|
||||
void populateDeckList(Response_DeckList::Directory *folder, QTreeWidgetItem *parent);
|
||||
void refreshServerList();
|
||||
private slots:
|
||||
void deckListFinished(ProtocolResponse *r);
|
||||
|
||||
void actUpload();
|
||||
void uploadFinished(ProtocolResponse *r);
|
||||
|
||||
void actDownload();
|
||||
void actNewFolder();
|
||||
void actDelete();
|
||||
public:
|
||||
TabDeckStorage(Client *_client);
|
||||
void retranslateUi();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -3,10 +3,11 @@
|
|||
#include "tab_server.h"
|
||||
#include "tab_chatchannel.h"
|
||||
#include "tab_game.h"
|
||||
#include "tab_deck_storage.h"
|
||||
#include "protocol_items.h"
|
||||
|
||||
TabSupervisor:: TabSupervisor(QWidget *parent)
|
||||
: QTabWidget(parent), client(0), tabServer(0)
|
||||
: QTabWidget(parent), client(0), tabServer(0), tabDeckStorage(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -15,6 +16,8 @@ void TabSupervisor::retranslateUi()
|
|||
{
|
||||
if (tabServer)
|
||||
setTabText(0, tr("Server"));
|
||||
if (tabDeckStorage)
|
||||
setTabText(1, tr("Deck storage"));
|
||||
}
|
||||
|
||||
void TabSupervisor::start(Client *_client)
|
||||
|
@ -27,8 +30,10 @@ void TabSupervisor::start(Client *_client)
|
|||
tabServer = new TabServer(client);
|
||||
connect(tabServer, SIGNAL(gameJoined(int)), this, SLOT(addGameTab(int)));
|
||||
connect(tabServer, SIGNAL(chatChannelJoined(const QString &)), this, SLOT(addChatChannelTab(const QString &)));
|
||||
|
||||
addTab(tabServer, QString());
|
||||
|
||||
tabDeckStorage = new TabDeckStorage(client);
|
||||
addTab(tabDeckStorage, QString());
|
||||
|
||||
retranslateUi();
|
||||
}
|
||||
|
@ -45,6 +50,9 @@ void TabSupervisor::stop()
|
|||
delete tabServer;
|
||||
tabServer = 0;
|
||||
|
||||
delete tabDeckStorage;
|
||||
tabDeckStorage = 0;
|
||||
|
||||
QMapIterator<QString, TabChatChannel *> chatChannelIterator(chatChannelTabs);
|
||||
while (chatChannelIterator.hasNext())
|
||||
delete chatChannelIterator.next().value();
|
||||
|
|
|
@ -8,6 +8,7 @@ class Client;
|
|||
class TabServer;
|
||||
class TabChatChannel;
|
||||
class TabGame;
|
||||
class TabDeckStorage;
|
||||
class ChatEvent;
|
||||
class GameEvent;
|
||||
class Event_GameJoined;
|
||||
|
@ -17,6 +18,7 @@ class TabSupervisor : public QTabWidget {
|
|||
private:
|
||||
Client *client;
|
||||
TabServer *tabServer;
|
||||
TabDeckStorage *tabDeckStorage;
|
||||
QMap<QString, TabChatChannel *> chatChannelTabs;
|
||||
QMap<int, TabGame *> gameTabs;
|
||||
public:
|
||||
|
|
|
@ -141,7 +141,7 @@ WndDeckEditor::WndDeckEditor(QWidget *parent)
|
|||
|
||||
aAddCard = new QAction(tr("Add card to &maindeck"), this);
|
||||
aAddCard->setShortcuts(QList<QKeySequence>() << QKeySequence(tr("Return")) << QKeySequence(tr("Enter")));
|
||||
aAddCard->setIcon(QIcon(":/resources/add_to_deck.svg"));
|
||||
aAddCard->setIcon(QIcon(":/resources/arrow_right_green.svg"));
|
||||
connect(aAddCard, SIGNAL(triggered()), this, SLOT(actAddCard()));
|
||||
aAddCardToSideboard = new QAction(tr("Add card to &sideboard"), this);
|
||||
aAddCardToSideboard->setIcon(QIcon(":/resources/add_to_sideboard.svg"));
|
||||
|
|
|
@ -187,6 +187,7 @@ void Response_DeckList::File::writeElement(QXmlStreamWriter *xml)
|
|||
xml->writeStartElement("file");
|
||||
xml->writeAttribute("name", name);
|
||||
xml->writeAttribute("id", QString::number(id));
|
||||
xml->writeAttribute("upload_time", QString::number(uploadTime.toTime_t()));
|
||||
xml->writeEndElement();
|
||||
}
|
||||
|
||||
|
@ -207,7 +208,7 @@ bool Response_DeckList::Directory::readElement(QXmlStreamReader *xml)
|
|||
currentItem = new Directory(xml->attributes().value("name").toString());
|
||||
append(currentItem);
|
||||
} else if (xml->isStartElement() && (xml->name() == "file")) {
|
||||
currentItem = new File(xml->attributes().value("name").toString(), xml->attributes().value("id").toString().toInt());
|
||||
currentItem = new File(xml->attributes().value("name").toString(), xml->attributes().value("id").toString().toInt(), QDateTime::fromTime_t(xml->attributes().value("upload_time").toString().toUInt()));
|
||||
append(currentItem);
|
||||
} else if (xml->isEndElement() && (xml->name() == "directory"))
|
||||
return true;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QDateTime>
|
||||
#include "protocol_item_ids.h"
|
||||
#include "protocol_datastructures.h"
|
||||
|
||||
|
@ -180,10 +181,13 @@ public:
|
|||
virtual void writeElement(QXmlStreamWriter *xml) = 0;
|
||||
};
|
||||
class File : public TreeItem {
|
||||
private:
|
||||
QDateTime uploadTime;
|
||||
public:
|
||||
File(const QString &_name, int _id) : TreeItem(_name, _id) { }
|
||||
File(const QString &_name, int _id, QDateTime _uploadTime) : TreeItem(_name, _id), uploadTime(_uploadTime) { }
|
||||
bool readElement(QXmlStreamReader *xml);
|
||||
void writeElement(QXmlStreamWriter *xml);
|
||||
QDateTime getUploadTime() const { return uploadTime; }
|
||||
};
|
||||
class Directory : public TreeItem, public QList<TreeItem *> {
|
||||
private:
|
||||
|
|
|
@ -151,13 +151,13 @@ bool ServerSocketInterface::deckListHelper(Response_DeckList::Directory *folder)
|
|||
return false;
|
||||
}
|
||||
|
||||
query.prepare("select id, name from decklist_files where id_folder = :id_folder");
|
||||
query.prepare("select id, name, upload_time from decklist_files where id_folder = :id_folder");
|
||||
query.bindValue(":id_folder", folder->getId());
|
||||
if (!servatrice->execSqlQuery(query))
|
||||
return false;
|
||||
|
||||
while (query.next()) {
|
||||
Response_DeckList::File *newFile = new Response_DeckList::File(query.value(1).toString(), query.value(0).toInt());
|
||||
Response_DeckList::File *newFile = new Response_DeckList::File(query.value(1).toString(), query.value(0).toInt(), query.value(2).toDateTime());
|
||||
folder->append(newFile);
|
||||
}
|
||||
|
||||
|
@ -267,11 +267,15 @@ ResponseCode ServerSocketInterface::cmdDeckUpload(Command_DeckUpload *cmd)
|
|||
cmd->getDeck()->writeElement(&deckWriter);
|
||||
deckWriter.writeEndDocument();
|
||||
|
||||
QString deckName = cmd->getDeck()->getName();
|
||||
if (deckName.isEmpty())
|
||||
deckName = "Unnamed deck";
|
||||
|
||||
QSqlQuery query;
|
||||
query.prepare("insert into decklist_files (id_folder, user, name, content) value(:id_folder, :user, :name, :content)");
|
||||
query.prepare("insert into decklist_files (id_folder, user, name, upload_time, content) values(:id_folder, :user, :name, NOW(), :content)");
|
||||
query.bindValue(":id_folder", folderId);
|
||||
query.bindValue(":user", playerName);
|
||||
query.bindValue(":name", cmd->getDeck()->getName());
|
||||
query.bindValue(":name", deckName);
|
||||
query.bindValue(":content", deckContents);
|
||||
servatrice->execSqlQuery(query);
|
||||
|
||||
|
|
Loading…
Reference in a new issue