Release 0.4.5 with metadata tools and responsive layers
This commit is contained in:
1 parent
00053e4d5f
commit
f480ce23ca
8 files changed
+253
-17
No files matched your search
@@ -354,6 +354,7 @@
|
||||
</label>
|
||||
<div class="project-command-stack">
|
||||
<button class="secondary-command" @onclick="UpdateProjectFolder" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Sposta</button>
|
||||
<button class="secondary-command" @onclick="RenameProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId) || SelectedProject?.IsReadOnly == true)">Rinomina</button>
|
||||
<button class="secondary-command" @onclick="DuplicateProject" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Duplica</button>
|
||||
<button class="secondary-command" @onclick="ToggleProjectArchive" disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">@(SelectedProject?.IsArchived == true ? "Ripristina" : "Archivia")</button>
|
||||
<button class="secondary-command" @onclick='() => ShareProject(false)' disabled="@(ProjectBusy || string.IsNullOrWhiteSpace(SelectedProjectId))">Condividi modificabile</button>
|
||||
@@ -1403,6 +1404,39 @@
|
||||
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto duplicato: {copy.Name}.");
|
||||
}
|
||||
|
||||
private async Task RenameProject()
|
||||
{
|
||||
if (SelectedProject is not { } project) return;
|
||||
var requestedName = await JS.InvokeAsync<string?>("lmeMap.promptProjectName", project.Name);
|
||||
if (string.IsNullOrWhiteSpace(requestedName)
|
||||
|| string.Equals(requestedName.Trim(), project.Name, StringComparison.CurrentCulture))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectBusy = true;
|
||||
try
|
||||
{
|
||||
var renamed = await ProjectStorageService.RenameAsync(project.Id, requestedName);
|
||||
await RefreshProjectsAsync();
|
||||
SelectedProjectId = renamed.Id;
|
||||
NewProjectName = renamed.Name;
|
||||
if (!HasUnsavedChanges)
|
||||
{
|
||||
ExportFileName = renamed.Name;
|
||||
}
|
||||
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto rinominato: {renamed.Name}.");
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto non rinominato: {error.GetBaseException().Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
ProjectBusy = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateProjectFolder()
|
||||
{
|
||||
if (SelectedProject is null) return;
|
||||
|
||||
Reference in new issue
Block a user