Diffstat (limited to 'noncore/net/opierdesktop/qtwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opierdesktop/qtwin.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/noncore/net/opierdesktop/qtwin.cpp b/noncore/net/opierdesktop/qtwin.cpp index 181d275..54a5a03 100644 --- a/noncore/net/opierdesktop/qtwin.cpp +++ b/noncore/net/opierdesktop/qtwin.cpp | |||
@@ -171,35 +171,24 @@ QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true) | |||
171 | connect(SaveButton, SIGNAL(clicked()), this, SLOT(SaveClicked())); | 171 | connect(SaveButton, SIGNAL(clicked()), this, SLOT(SaveClicked())); |
172 | // remove an item button | 172 | // remove an item button |
173 | RemoveButton = new QPushButton(this); | 173 | RemoveButton = new QPushButton(this); |
174 | RemoveButton->move(180, 180); | 174 | RemoveButton->move(180, 180); |
175 | RemoveButton->resize(50, 20); | 175 | RemoveButton->resize(50, 20); |
176 | RemoveButton->setText("Remove"); | 176 | RemoveButton->setText("Remove"); |
177 | connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked())); | 177 | connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked())); |
178 | // full screen check box | 178 | // full screen check box |
179 | FullScreenCheckBox = new QCheckBox(this, "Full Screen"); | 179 | FullScreenCheckBox = new QCheckBox(this, "Full Screen"); |
180 | FullScreenCheckBox->setText("Full Screen"); | 180 | FullScreenCheckBox->setText("Full Screen"); |
181 | FullScreenCheckBox->move(10, 230); | 181 | FullScreenCheckBox->move(10, 230); |
182 | // ok button | 182 | // ok button |
183 | OKButton = new QPushButton(this); | ||
184 | OKButton->setText("OK"); | ||
185 | OKButton->move(100, 240); | ||
186 | OKButton->resize(50, 20); | ||
187 | connect(OKButton, SIGNAL(clicked()), this, SLOT(OKClicked())); | ||
188 | // cancel button | ||
189 | CancelButton = new QPushButton(this); | ||
190 | CancelButton->setText("Cancel"); | ||
191 | CancelButton->move(160, 240); | ||
192 | CancelButton->resize(50, 20); | ||
193 | connect(CancelButton, SIGNAL(clicked()), this, SLOT(CancelClicked())); | ||
194 | 183 | ||
195 | for (i = 0; i < 10; i++) | 184 | for (i = 0; i < 10; i++) |
196 | { | 185 | { |
197 | ConnectionList[i] = new QMyConnectionItem; | 186 | ConnectionList[i] = new QMyConnectionItem; |
198 | ConnectionList[i]->ServerName = ""; | 187 | ConnectionList[i]->ServerName = ""; |
199 | ConnectionList[i]->UserName = ""; | 188 | ConnectionList[i]->UserName = ""; |
200 | ConnectionList[i]->ServerIP = ""; | 189 | ConnectionList[i]->ServerIP = ""; |
201 | ConnectionList[i]->Width = 0; | 190 | ConnectionList[i]->Width = 0; |
202 | ConnectionList[i]->Height = 0; | 191 | ConnectionList[i]->Height = 0; |
203 | ConnectionList[i]->FullScreen = 0; | 192 | ConnectionList[i]->FullScreen = 0; |
204 | } | 193 | } |
205 | home = getenv("HOME"); | 194 | home = getenv("HOME"); |
@@ -268,41 +257,37 @@ void QMyDialog::ComboChanged(int index) | |||
268 | { | 257 | { |
269 | WidthEdit->setText("640"); | 258 | WidthEdit->setText("640"); |
270 | HeightEdit->setText("480"); | 259 | HeightEdit->setText("480"); |
271 | } | 260 | } |
272 | else if (index == 2) | 261 | else if (index == 2) |
273 | { | 262 | { |
274 | WidthEdit->setText("800"); | 263 | WidthEdit->setText("800"); |
275 | HeightEdit->setText("600"); | 264 | HeightEdit->setText("600"); |
276 | } | 265 | } |
277 | } | 266 | } |
278 | 267 | ||
279 | //***************************************************************************** | 268 | //***************************************************************************** |
280 | void QMyDialog::OKClicked() | 269 | void QMyDialog::accept() |
281 | { | 270 | { |
282 | ServerName = ServerNameEdit->text(); | 271 | ServerName = ServerNameEdit->text(); |
283 | UserName = UserNameEdit->text(); | 272 | UserName = UserNameEdit->text(); |
284 | Width = WidthEdit->text().toInt(); | 273 | Width = WidthEdit->text().toInt(); |
285 | Height = HeightEdit->text().toInt(); | 274 | Height = HeightEdit->text().toInt(); |
286 | ServerIP = IPEdit->text(); | 275 | ServerIP = IPEdit->text(); |
287 | FullScreen = FullScreenCheckBox->isChecked(); | 276 | FullScreen = FullScreenCheckBox->isChecked(); |
288 | done(1); | ||
289 | } | ||
290 | 277 | ||
291 | //***************************************************************************** | 278 | QDialog::accept(); |
292 | void QMyDialog::CancelClicked() | ||
293 | { | ||
294 | done(0); | ||
295 | } | 279 | } |
296 | 280 | ||
281 | |||
297 | //***************************************************************************** | 282 | //***************************************************************************** |
298 | void QMyDialog::AddClicked() | 283 | void QMyDialog::AddClicked() |
299 | { | 284 | { |
300 | int i; | 285 | int i; |
301 | QMyConnectionItem* Item; | 286 | QMyConnectionItem* Item; |
302 | 287 | ||
303 | i = ListBox->count(); | 288 | i = ListBox->count(); |
304 | if (i < 10) | 289 | if (i < 10) |
305 | { | 290 | { |
306 | ListBox->insertItem(ServerNameEdit->text()); | 291 | ListBox->insertItem(ServerNameEdit->text()); |
307 | Item = ConnectionList[i]; | 292 | Item = ConnectionList[i]; |
308 | Item->ServerName = ServerNameEdit->text(); | 293 | Item->ServerName = ServerNameEdit->text(); |