mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 23:06:41 +00:00
added user setting for cyclic prev/next
This commit is contained in:
parent
95522fcad2
commit
e27a75bd10
2 changed files with 21 additions and 3 deletions
|
@ -356,6 +356,14 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
formatId->setToolTip ("(Default: Blue) Use one of the following formats:" + tooltip);
|
formatId->setToolTip ("(Default: Blue) Use one of the following formats:" + tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declareSection ("general-input", "General Input");
|
||||||
|
{
|
||||||
|
Setting *cycle = createSetting (Type_CheckBox, "cycle", "Cyclic next/previous");
|
||||||
|
cycle->setDefaultValue ("false");
|
||||||
|
cycle->setToolTip ("When using next/previous functions at the last/first item of a "
|
||||||
|
"list go to the first/last item");
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* There are three types of values:
|
* There are three types of values:
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "../../model/world/idtable.hpp"
|
#include "../../model/world/idtable.hpp"
|
||||||
#include "../../model/world/commanddispatcher.hpp"
|
#include "../../model/world/commanddispatcher.hpp"
|
||||||
|
|
||||||
|
#include "../../model/settings/usersettings.hpp"
|
||||||
|
|
||||||
#include "../world/tablebottombox.hpp"
|
#include "../world/tablebottombox.hpp"
|
||||||
|
|
||||||
void CSVWorld::RecordButtonBar::updateModificationButtons()
|
void CSVWorld::RecordButtonBar::updateModificationButtons()
|
||||||
|
@ -132,12 +134,16 @@ void CSVWorld::RecordButtonBar::cloneRequest()
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::RecordButtonBar::nextId()
|
void CSVWorld::RecordButtonBar::nextId()
|
||||||
{
|
{
|
||||||
int newRow = mTable.getModelIndex (mId.getId(), 0).row() + 1;
|
int newRow = mTable.getModelIndex (mId.getId(), 0).row() + 1;
|
||||||
|
|
||||||
if (newRow >= mTable.rowCount())
|
if (newRow >= mTable.rowCount())
|
||||||
{
|
{
|
||||||
return;
|
if (CSMSettings::UserSettings::instance().settingValue ("general-input/cycle")
|
||||||
|
=="true")
|
||||||
|
newRow = 0;
|
||||||
|
else
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit switchToRow (newRow);
|
emit switchToRow (newRow);
|
||||||
|
@ -149,7 +155,11 @@ void CSVWorld::RecordButtonBar::prevId()
|
||||||
|
|
||||||
if (newRow < 0)
|
if (newRow < 0)
|
||||||
{
|
{
|
||||||
return;
|
if (CSMSettings::UserSettings::instance().settingValue ("general-input/cycle")
|
||||||
|
=="true")
|
||||||
|
newRow = mTable.rowCount()-1;
|
||||||
|
else
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit switchToRow (newRow);
|
emit switchToRow (newRow);
|
||||||
|
|
Loading…
Reference in a new issue