mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-30 10:36:40 +00:00
Resolutions are now sorted descendingly and removed some debug stuff
This commit is contained in:
parent
797c2c538d
commit
6fe471c1c6
3 changed files with 16 additions and 3 deletions
|
@ -7,6 +7,17 @@
|
||||||
#include <components/files/configurationmanager.hpp>
|
#include <components/files/configurationmanager.hpp>
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
|
//sort resolutions descending
|
||||||
|
bool resolutionLessThan(const QString &str1, const QString &str2)
|
||||||
|
{
|
||||||
|
// Get the first parts of the resolution strings
|
||||||
|
int width1 = str1.left(str1.indexOf(" ")).toInt();
|
||||||
|
int width2 = str2.left(str2.indexOf(" ")).toInt();
|
||||||
|
|
||||||
|
return (width1 > width2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, QWidget *parent)
|
GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, mCfgMgr(cfg)
|
, mCfgMgr(cfg)
|
||||||
|
@ -162,7 +173,7 @@ bool GraphicsPage::setupOgre()
|
||||||
mAntiAliasingComboBox->clear();
|
mAntiAliasingComboBox->clear();
|
||||||
mResolutionComboBox->clear();
|
mResolutionComboBox->clear();
|
||||||
mAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mSelectedRenderSystem));
|
mAntiAliasingComboBox->addItems(getAvailableOptions(QString("FSAA"), mSelectedRenderSystem));
|
||||||
mResolutionComboBox->addItems(getAvailableOptions(QString("Video Mode"), mSelectedRenderSystem));
|
mResolutionComboBox->addItems(getAvailableResolutions(mSelectedRenderSystem));
|
||||||
|
|
||||||
readConfig();
|
readConfig();
|
||||||
return true;
|
return true;
|
||||||
|
@ -229,6 +240,8 @@ QStringList GraphicsPage::getAvailableOptions(const QString &key, Ogre::RenderSy
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort ascending
|
||||||
|
result.sort();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,6 +278,8 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort the resolutions in descending order
|
||||||
|
qSort(result.begin(), result.end(), resolutionLessThan);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,6 @@ void MainDialog::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
// Save user settings
|
// Save user settings
|
||||||
const std::string settingspath = (mCfgMgr.getUserPath() / "settings.cfg").string();
|
const std::string settingspath = (mCfgMgr.getUserPath() / "settings.cfg").string();
|
||||||
qDebug() << QString::fromStdString(settingspath);
|
|
||||||
mSettings.saveUser(settingspath);
|
mSettings.saveUser(settingspath);
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#include <QDebug>
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
#include "pluginsview.hpp"
|
#include "pluginsview.hpp"
|
||||||
|
|
Loading…
Reference in a new issue