22 #include <QInputDialog> |
22 #include <QInputDialog> |
23 #include <QCryptographicHash> |
23 #include <QCryptographicHash> |
24 #include <QStandardItemModel> |
24 #include <QStandardItemModel> |
25 #include <QNetworkProxy> |
25 #include <QNetworkProxy> |
26 #include <QNetworkProxyFactory> |
26 #include <QNetworkProxyFactory> |
|
27 #include <utility> |
27 |
28 |
28 #include "gameuiconfig.h" |
29 #include "gameuiconfig.h" |
29 #include "hwform.h" |
30 #include "hwform.h" |
30 #include "pageoptions.h" |
31 #include "pageoptions.h" |
31 #include "pagevideos.h" |
32 #include "pagevideos.h" |
350 QString GameUIConfig::language() |
351 QString GameUIConfig::language() |
351 { |
352 { |
352 return Form->ui.pageOptions->CBLanguage->itemData(Form->ui.pageOptions->CBLanguage->currentIndex()).toString(); |
353 return Form->ui.pageOptions->CBLanguage->itemData(Form->ui.pageOptions->CBLanguage->currentIndex()).toString(); |
353 } |
354 } |
354 |
355 |
|
356 std::pair<QRect, QRect> GameUIConfig::vid_ResolutionPair() { |
|
357 // returns a pair of both the fullscreen and the windowed resolution |
|
358 QRect full(0, 0, 640, 480); |
|
359 QRect windowed(0, 0, 640, 480); |
|
360 QStringList wh = Form->ui.pageOptions->CBResolution->currentText().split('x'); |
|
361 if (wh.size() == 2) |
|
362 { |
|
363 full.setWidth(wh[0].toInt()); |
|
364 full.setHeight(wh[1].toInt()); |
|
365 } |
|
366 windowed.setWidth(Form->ui.pageOptions->windowWidthEdit->text().toInt()); |
|
367 windowed.setHeight(Form->ui.pageOptions->windowHeightEdit->text().toInt()); |
|
368 return std::make_pair(full, windowed); |
|
369 } |
|
370 |
355 QRect GameUIConfig::vid_Resolution() |
371 QRect GameUIConfig::vid_Resolution() |
356 { |
372 { |
357 QRect result(0, 0, 640, 480); |
373 std::pair<QRect, QRect> result = vid_ResolutionPair(); |
358 if(Form->ui.pageOptions->CBFullscreen->isChecked()) { |
374 if(Form->ui.pageOptions->CBFullscreen->isChecked()) |
359 QStringList wh = Form->ui.pageOptions->CBResolution->currentText().split('x'); |
375 return result.first; |
360 if (wh.size() == 2) |
376 else |
361 { |
377 return result.second; |
362 result.setWidth(wh[0].toInt()); |
|
363 result.setHeight(wh[1].toInt()); |
|
364 } |
|
365 } |
|
366 else { |
|
367 result.setWidth(Form->ui.pageOptions->windowWidthEdit->text().toInt()); |
|
368 result.setHeight(Form->ui.pageOptions->windowHeightEdit->text().toInt()); |
|
369 } |
|
370 return result; |
|
371 } |
378 } |
372 |
379 |
373 bool GameUIConfig::vid_Fullscreen() |
380 bool GameUIConfig::vid_Fullscreen() |
374 { |
381 { |
375 return Form->ui.pageOptions->CBFullscreen->isChecked(); |
382 return Form->ui.pageOptions->CBFullscreen->isChecked(); |