forked from Michael33881/adbLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcachedialog.cpp
107 lines (76 loc) · 1.86 KB
/
cachedialog.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
99
100
101
102
103
104
105
106
#include "cachedialog.h"
#include "ui_cachedialog.h"
int cval1;
int cacheDialog::cbuffermode() {
return ui->buffermode->currentIndex();
}
QString cacheDialog::cbufferfactor() {
return ui->bufferfactor->text();
}
QString cacheDialog::cbuffersize() {
return ui->buffersize->text();
}
void cacheDialog::setcbuffersize(const QString &cbuffersize)
{
ui->buffersize->setText(cbuffersize);
}
void cacheDialog::setcbuffermode(const int &cbuffermode)
{
ui->buffermode->setCurrentIndex(cbuffermode);
}
void cacheDialog::setcbufferfactor(const QString &cbufferfactor)
{
ui->bufferfactor->setText(cbufferfactor);
}
int cacheDialog::returncval1() {
return cval1;
}
cacheDialog::cacheDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::cacheDialog)
{
ui->setupUi(this);
}
cacheDialog::~cacheDialog()
{
delete ui;
}
void cacheDialog::on_cpreset1_clicked()
{
setcbuffermode(1);
setcbuffersize("0");
setcbufferfactor("10");
}
void cacheDialog::on_cpreset2_clicked()
{
setcbuffermode(2);
setcbuffersize("104857600");
setcbufferfactor("1");
}
void cacheDialog::on_cpreset3_clicked()
{
setcbuffermode(2);
setcbuffersize("52428800");
setcbufferfactor("1");
}
////////////////////////////////////
void cacheDialog::on_writecxml_clicked()
{
cval1 = 2;
QDialog::accept();
}
void cacheDialog::on_resetcxml_clicked()
{
ui->buffersize->setText("20971520");
ui->buffermode->setCurrentIndex(2);
ui->bufferfactor->setText("1");
ui->cpreset1->setAutoExclusive(false);
ui->cpreset2->setAutoExclusive(false);
ui->cpreset3->setAutoExclusive(false);
ui->cpreset1->setChecked(false);
ui->cpreset2->setChecked(false);
ui->cpreset3->setChecked(false);
ui->cpreset1->setAutoExclusive(true);
ui->cpreset2->setAutoExclusive(true);
ui->cpreset3->setAutoExclusive(true);
}