forked from Rescator7/Hearts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspeed.cpp
98 lines (82 loc) · 2.67 KB
/
speed.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "speed.h"
#include "ui_speed.h"
#include "config.h"
CSpeed::CSpeed(QWidget *parent, CConfig *config) :
QWidget(parent),
ui(new Ui::CSpeed)
{
ui->setupUi(this);
mConfig = config;
}
CSpeed::~CSpeed()
{
delete ui;
}
void CSpeed::popup()
{
reset();
show();
}
void CSpeed::reset()
{
ui->horizontalSlider_play_a_card->setValue(mConfig->get_speed(SPEED_PLAY_CARD));
ui->horizontalSlider_play_2_clubs->setValue(mConfig->get_speed(SPEED_PLAY_TWO_CLUBS));
ui->horizontalSlider_shuffle->setValue(mConfig->get_speed(SPEED_SHUFFLE));
ui->horizontalSlider_clear_table->setValue(mConfig->get_speed(SPEED_CLEAR_TABLE));
ui->horizontalSlider_your_turn->setValue(mConfig->get_speed(SPEED_YOUR_TURN));
ui->horizontalSlider_pass_cards->setValue(mConfig->get_speed(SPEED_PASS_CARDS));
ui->horizontalSlider_animate_pass_cards->setValue(mConfig->get_speed(SPEED_ANIMATE_PASS_CARDS));
ui->horizontalSlider_animate_play_card->setValue(mConfig->get_speed(SPEED_ANIMATE_PLAY_CARD));
}
void CSpeed::on_pushButton_cancel_clicked()
{
hide();
}
void CSpeed::Translate()
{
ui->retranslateUi(this);
}
void CSpeed::on_horizontalSlider_play_a_card_valueChanged(int value)
{
ui->lcdNumber_play_a_card->display(value);
}
void CSpeed::on_horizontalSlider_play_2_clubs_valueChanged(int value)
{
ui->lcdNumber_play_2_clubs->display(value);
}
void CSpeed::on_horizontalSlider_shuffle_valueChanged(int value)
{
ui->lcdNumber_shuffle->display(value);
}
void CSpeed::on_horizontalSlider_clear_table_valueChanged(int value)
{
ui->lcdNumber_clear_table->display(value);
}
void CSpeed::on_horizontalSlider_your_turn_valueChanged(int value)
{
ui->lcdNumber_your_turn->display(value);
}
void CSpeed::on_horizontalSlider_pass_cards_valueChanged(int value)
{
ui->lcdNumber_pass_cards->display(value);
}
void CSpeed::on_horizontalSlider_animate_pass_cards_valueChanged(int value)
{
ui->lcdNumber_animate_pass_cards->display(value);
}
void CSpeed::on_horizontalSlider_animate_play_card_valueChanged(int value)
{
ui->lcdNumber_animate_play_card->display(value);
}
void CSpeed::on_pushButton_save_clicked()
{
mConfig->set_expert_speeds(ui->horizontalSlider_play_a_card->value(),
ui->horizontalSlider_play_2_clubs->value(),
ui->horizontalSlider_shuffle->value(),
ui->horizontalSlider_clear_table->value(),
ui->horizontalSlider_your_turn->value(),
ui->horizontalSlider_pass_cards->value(),
ui->horizontalSlider_animate_pass_cards->value(),
ui->horizontalSlider_animate_play_card->value());
hide();
}