mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 21:45:33 +00:00
Merge branch 'sdl-error-message-fix' into 'master'
SDL resolution list fixes in launcher graphics page Closes #5558 See merge request OpenMW/openmw!286
This commit is contained in:
commit
51bec5948f
2 changed files with 7 additions and 2 deletions
|
@ -65,16 +65,19 @@ bool Launcher::GraphicsPage::setupSDL()
|
||||||
msgBox.setWindowTitle(tr("Error receiving number of screens"));
|
msgBox.setWindowTitle(tr("Error receiving number of screens"));
|
||||||
msgBox.setIcon(QMessageBox::Critical);
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
msgBox.setText(tr("<br><b>SDL_GetNumDisplayModes failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
|
msgBox.setText(tr("<br><b>SDL_GetNumVideoDisplays failed:</b><br><br>") + QString::fromUtf8(SDL_GetError()) + "<br>");
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
screenComboBox->clear();
|
screenComboBox->clear();
|
||||||
|
mResolutionsPerScreen.clear();
|
||||||
for (int i = 0; i < displays; i++)
|
for (int i = 0; i < displays; i++)
|
||||||
{
|
{
|
||||||
|
mResolutionsPerScreen.append(getAvailableResolutions(i));
|
||||||
screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1));
|
screenComboBox->addItem(QString(tr("Screen ")) + QString::number(i + 1));
|
||||||
}
|
}
|
||||||
|
screenChanged(0);
|
||||||
|
|
||||||
// Disconnect from SDL processes
|
// Disconnect from SDL processes
|
||||||
quitSDL();
|
quitSDL();
|
||||||
|
@ -331,7 +334,7 @@ void Launcher::GraphicsPage::screenChanged(int screen)
|
||||||
{
|
{
|
||||||
if (screen >= 0) {
|
if (screen >= 0) {
|
||||||
resolutionComboBox->clear();
|
resolutionComboBox->clear();
|
||||||
resolutionComboBox->addItems(getAvailableResolutions(screen));
|
resolutionComboBox->addItems(mResolutionsPerScreen[screen]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,8 @@ namespace Launcher
|
||||||
Files::ConfigurationManager &mCfgMgr;
|
Files::ConfigurationManager &mCfgMgr;
|
||||||
Settings::Manager &mEngineSettings;
|
Settings::Manager &mEngineSettings;
|
||||||
|
|
||||||
|
QVector<QStringList> mResolutionsPerScreen;
|
||||||
|
|
||||||
static QStringList getAvailableResolutions(int screen);
|
static QStringList getAvailableResolutions(int screen);
|
||||||
static QRect getMaximumResolution();
|
static QRect getMaximumResolution();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue