This commit is contained in:
Ylva Selling
2023-05-15 15:34:14 -04:00
7 changed files with 20 additions and 8 deletions

View File

@@ -47,12 +47,14 @@ public:
* \param profileName The name of the profile to create
* \param assetBasePath The path to the folder where the assets live
* \param userAssetBasePath The path to the folder where the user assets live
* \param profileName The path to the folder in which all profiles live
* \param builtInProfileBasePath The path to the folder in which the built-in profiles
* live
* \param profileBasePath The path to the folder in which all profiles live
* \param parent Pointer to parent Qt widget
*/
ProfileEdit(openspace::Profile& profile, const std::string& profileName,
std::string assetBasePath, std::string userAssetBasePath,
std::string profileBasePath, QWidget* parent);
std::string builtInProfileBasePath, std::string profileBasePath, QWidget* parent);
/**
* Gets the status of the save when the window is closed; was the file saved?
@@ -99,6 +101,7 @@ private:
const std::string _assetBasePath;
const std::string _userAssetBasePath;
const std::string _profileBasePath;
const std::string _builtInProfilesPath;
bool _saveSelected = false;
QLineEdit* _profileEdit = nullptr;

View File

@@ -721,6 +721,7 @@ void LauncherWindow::openProfileEditor(const std::string& profile, bool isUserPr
profile,
_assetPath,
_userAssetPath,
_profilePath,
saveProfilePath,
this
);

View File

@@ -98,6 +98,7 @@ namespace {
ProfileEdit::ProfileEdit(Profile& profile, const std::string& profileName,
std::string assetBasePath,
std::string userAssetBasePath,
std::string builtInProfileBasePath,
std::string profileBasePath,
QWidget* parent)
: QDialog(parent)
@@ -105,6 +106,7 @@ ProfileEdit::ProfileEdit(Profile& profile, const std::string& profileName,
, _assetBasePath(std::move(assetBasePath))
, _userAssetBasePath(std::move(userAssetBasePath))
, _profileBasePath(std::move(profileBasePath))
, _builtInProfilesPath(std::move(builtInProfileBasePath))
{
setWindowTitle("Profile Editor");
createWidgets(profileName);
@@ -487,7 +489,9 @@ void ProfileEdit::approved() {
return;
}
std::filesystem::path p = fmt::format("{}/{}.profile", _profileBasePath, profileName);
std::filesystem::path p = fmt::format(
"{}/{}.profile", _builtInProfilesPath, profileName
);
if (std::filesystem::exists(p)) {
// The filename exists in the OpenSpace-provided folder, so we don't want to allow
// a user to overwrite it

View File

@@ -1,4 +1,7 @@
{
"additional_scripts": [
"openspace.scriptScheduler.loadScheduledScript(\"2014-07-03T09:00:00\", \"openspace.setPropertyValueSingle([[Scene.67P.Renderable.PerformShading]], false);\", \"openspace.setPropertyValueSingle([[Scene.67P.Renderable.PerformShading]], true)\"); openspace.scriptScheduler.loadScheduledScript(\"2015-09-23T00:00:00\", \"openspace.setPropertyValueSingle([[Scene.67P.Renderable.PerformShading]], true); openspace.setPropertyValueSingle([[Scene.67P.Renderable.ProjectionComponent.ClearAllProjections]], true);\", \"openspace.setPropertyValueSingle([[Scene.67P.Renderable.PerformShading]], false);\");"
],
"assets": [
"base",
"base_keybindings",
@@ -91,7 +94,7 @@
"license": "MIT License",
"name": "Rosetta",
"url": "https://www.openspaceproject.com",
"version": "1.1"
"version": "1.2"
},
"properties": [
{
@@ -106,11 +109,12 @@
}
],
"time": {
"is_paused": false,
"type": "absolute",
"value": "2014-08-01T03:05:00"
},
"version": {
"major": 1,
"minor": 1
"minor": 2
}
}