blob: 06efe7f43c5565caa90af1ab163356bee29e2ab4 (
plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
void RdpPrefs::resolutionChanged( int selection )
{
bool enable = (selection==3);
spinWidth->setEnabled(enable);
spinHeight->setEnabled(enable);
widthLabel->setEnabled(enable);
heightLabel->setEnabled(enable);
switch(selection)
{
case 0:
spinWidth->setValue(640);
spinHeight->setValue(480);
break;
case 1:
spinWidth->setValue(800);
spinHeight->setValue(600);
break;
case 2:
spinWidth->setValue(1024);
spinHeight->setValue(768);
break;
case 3:
default:
break;
}
}
void RdpPrefs::setRdpWidth( int w )
{
spinWidth->setValue(w);
}
int RdpPrefs::rdpWidth()
{
return spinWidth->value();
}
void RdpPrefs::setRdpHeight( int h )
{
spinHeight->setValue(h);
}
int RdpPrefs::rdpHeight()
{
return spinHeight->value();
}
int RdpPrefs::colorDepth()
{
qDebug("current depth: %i", cmbColorDepth->currentItem() );
switch (cmbColorDepth->currentItem())
{
case 0:
return 8;
case 1:
return 16;
case 2:
return 24;
default:
// shouldn't happen, but who knows..
return 8;
break;
}
}
void RdpPrefs::setColorDepth(int depth)
{
switch (depth)
{
case 8:
cmbColorDepth->setCurrentItem(0);
break;
case 16:
cmbColorDepth->setCurrentItem(1);
break;
case 24:
cmbColorDepth->setCurrentItem(2);
break;
default:
break;
}
}
void RdpPrefs::setResolution()
{
if (rdpWidth()==640 && rdpHeight()==480)
{
cmbResolution->setCurrentItem(0);
}
else if (rdpWidth()==800 && rdpHeight()==600)
{
cmbResolution->setCurrentItem(1);
}
else if (rdpWidth()==1024 && rdpHeight()==768)
{
cmbResolution->setCurrentItem(2);
}
else
{
cmbResolution->setCurrentItem(3);
}
resolutionChanged( cmbResolution->currentItem() );
}
int RdpPrefs::resolution()
{
return cmbResolution->currentItem();
}
void RdpPrefs::setKbLayout( int i )
{
cmbKbLayout->setCurrentItem( i );
}
int RdpPrefs::kbLayout()
{
return cmbKbLayout->currentItem();
}
void RdpPrefs::setShowPrefs( bool b )
{
cbShowPrefs->setChecked( b );
}
bool RdpPrefs::showPrefs()
{
return cbShowPrefs->isChecked();
}
void RdpPrefs::setUseKWallet( bool b )
{
cbUseKWallet->setChecked(b);
}
bool RdpPrefs::useKWallet()
{
return cbUseKWallet->isChecked();
}
|