forked from mirror/openmw-tes3mp
Moved script editor settings to its own section.
This commit is contained in:
parent
8e49ccc2f4
commit
7b4a9f1ea1
4 changed files with 25 additions and 10 deletions
|
@ -143,10 +143,6 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
minWidth->setDefaultValue (325);
|
minWidth->setDefaultValue (325);
|
||||||
minWidth->setRange (50, 10000);
|
minWidth->setRange (50, 10000);
|
||||||
minWidth->setToolTip ("Minimum width of subviews.");
|
minWidth->setToolTip ("Minimum width of subviews.");
|
||||||
|
|
||||||
Setting *monoFont = createSetting (Type_CheckBox, "mono-font", "Use monospace font");
|
|
||||||
monoFont->setDefaultValue ("true");
|
|
||||||
monoFont->setToolTip ("Whether to use monospaced fonts on script edit subview.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declareSection ("records", "Records");
|
declareSection ("records", "Records");
|
||||||
|
@ -230,6 +226,18 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
autoDelete->setDefaultValue ("true");
|
autoDelete->setDefaultValue ("true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declareSection ("script-editor", "Script Editor");
|
||||||
|
{
|
||||||
|
Setting *lineNum = createSetting (Type_CheckBox, "show-linenum", "Show Line Numbers");
|
||||||
|
lineNum->setDefaultValue ("true");
|
||||||
|
lineNum->setToolTip ("Show line numbers to the left of the script editor window."
|
||||||
|
"The current row and column numbers of the text cursor are shown at the bottom.");
|
||||||
|
|
||||||
|
Setting *monoFont = createSetting (Type_CheckBox, "mono-font", "Use monospace font");
|
||||||
|
monoFont->setDefaultValue ("true");
|
||||||
|
monoFont->setToolTip ("Whether to use monospaced fonts on script edit subview.");
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* There are three types of values:
|
* There are three types of values:
|
||||||
|
|
|
@ -80,7 +80,7 @@ CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighli
|
||||||
|
|
||||||
// TODO: provide a font selector dialogue
|
// TODO: provide a font selector dialogue
|
||||||
std::string useMonoFont =
|
std::string useMonoFont =
|
||||||
CSMSettings::UserSettings::instance().setting("window/mono-font", "true").toStdString();
|
CSMSettings::UserSettings::instance().setting("script-editor/mono-font", "true").toStdString();
|
||||||
if (useMonoFont == "true")
|
if (useMonoFont == "true")
|
||||||
{
|
{
|
||||||
QFont font("Monospace");
|
QFont font("Monospace");
|
||||||
|
@ -95,7 +95,7 @@ CSVWorld::ScriptEdit::ScriptEdit (const CSMDoc::Document& document, ScriptHighli
|
||||||
connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
|
connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int)));
|
||||||
|
|
||||||
std::string showStatusBar =
|
std::string showStatusBar =
|
||||||
CSMSettings::UserSettings::instance().settingValue("window/show-statusbar").toStdString();
|
CSMSettings::UserSettings::instance().settingValue("script-editor/show-linenum").toStdString();
|
||||||
|
|
||||||
showLineNum(showStatusBar == "true");
|
showLineNum(showStatusBar == "true");
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "../../model/world/columnbase.hpp"
|
#include "../../model/world/columnbase.hpp"
|
||||||
#include "../../model/world/commands.hpp"
|
#include "../../model/world/commands.hpp"
|
||||||
#include "../../model/world/idtable.hpp"
|
#include "../../model/world/idtable.hpp"
|
||||||
|
#include "../../model/settings/usersettings.hpp"
|
||||||
|
|
||||||
#include "scriptedit.hpp"
|
#include "scriptedit.hpp"
|
||||||
|
|
||||||
|
@ -65,10 +66,16 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||||
connect(mEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateStatusBar()));
|
connect(mEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateStatusBar()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::ScriptSubView::setStatusBar (bool show)
|
void CSVWorld::ScriptSubView::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
{
|
{
|
||||||
mEditor->showLineNum(show);
|
if (name != "script-editor/show-linenum")
|
||||||
mBottom->setVisible(show);
|
return;
|
||||||
|
|
||||||
|
std::string showLinenum =
|
||||||
|
CSMSettings::UserSettings::instance().settingValue("script-editor/show-linenum").toStdString();
|
||||||
|
|
||||||
|
mEditor->showLineNum(showLinenum == "true");
|
||||||
|
mBottom->setVisible(showLinenum == "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::ScriptSubView::updateStatusBar ()
|
void CSVWorld::ScriptSubView::updateStatusBar ()
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace CSVWorld
|
||||||
|
|
||||||
virtual void useHint (const std::string& hint);
|
virtual void useHint (const std::string& hint);
|
||||||
|
|
||||||
virtual void setStatusBar (bool show);
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue