mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-02 04:46:42 -05:00
Add preferred text editor to PorymapConfig
This commit is contained in:
@@ -187,6 +187,8 @@ void PorymapConfig::parseConfigKeyValue(QString key, QString value) {
|
||||
}
|
||||
} else if (key == "theme") {
|
||||
this->theme = value;
|
||||
} else if (key == "text_editor") {
|
||||
this->textEditorCommand = value;
|
||||
} else {
|
||||
logWarn(QString("Invalid config key found in config file %1: '%2'").arg(this->getConfigFilepath()).arg(key));
|
||||
}
|
||||
@@ -216,6 +218,7 @@ QMap<QString, QString> PorymapConfig::getKeyValueMap() {
|
||||
map.insert("region_map_dimensions", QString("%1x%2").arg(this->regionMapDimensions.width())
|
||||
.arg(this->regionMapDimensions.height()));
|
||||
map.insert("theme", this->theme);
|
||||
map.insert("text_editor", this->textEditorCommand);
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -316,6 +319,11 @@ void PorymapConfig::setTheme(QString theme) {
|
||||
this->theme = theme;
|
||||
}
|
||||
|
||||
void PorymapConfig::setTextEditorCommand(const QString &command) {
|
||||
this->textEditorCommand = command;
|
||||
this->save();
|
||||
}
|
||||
|
||||
QString PorymapConfig::getRecentProject() {
|
||||
return this->recentProject;
|
||||
}
|
||||
@@ -398,6 +406,10 @@ QString PorymapConfig::getTheme() {
|
||||
return this->theme;
|
||||
}
|
||||
|
||||
QString PorymapConfig::getTextEditorCommand() {
|
||||
return this->textEditorCommand;
|
||||
}
|
||||
|
||||
const QMap<BaseGameVersion, QString> baseGameVersionMap = {
|
||||
{BaseGameVersion::pokeruby, "pokeruby"},
|
||||
{BaseGameVersion::pokefirered, "pokefirered"},
|
||||
|
||||
Reference in New Issue
Block a user