ajtruckle / meeting-schedule-assistant-support

Get support for Meeting Schedule Assistant.
https://www.publictalksoftware.co.uk/meeting-schedule-assistant/
5 stars 0 forks source link

Add Set / Clear Read-Only Flag to Script Editor #71

Closed ajtruckle closed 6 months ago

ajtruckle commented 6 months ago

At the moment it is not clear to the user that the file might be read only, other than the fact that they can't edit it.

In NotePad++ It handles this issue like this:

image

Fortunately, Notepad++ has their translations available online! So I have collated the ones we need:

Language Translation Translation
eng Clear Read-Only Flag Set Read-Only
csy Zrušit příznak Pouze pro čtení Nastavit p&říznak Pouze pro čtení
dan Fjern skrivebeskyttelse Sæt skrivebeskyttelse
deu Schreibschutz-Attribut löschen Schreibschutz
ell Καθαρισμός μόνο για ανάγνωση μεταβητής flag Ορισμός Μόνο για Ανάγνωση
esp Desactivar solo lectura Solo lectura
fin Poista kirjoitussuojaus Aseta kirjoitussuojaus
fra Enlever l'attribut de lecture seule du fichier Lecture seule pour le document actuel
hun Írásvédett attribútum törlése Írásvédett
ita Rimuovi attributo di sola lettura del file Sessione documento in sola lettura
jpn ファイルの読み取り専用を解除 読み取り専用モード
nld Alleen-lezen opheffen Instellen als alleen-lezen
plk Usuń atrybut tylko do odczytu z pliku Zablokuj edycję
ptb Desmarcar como somente leitura Definir como somente leitura
ptg Limpar o símbolo só de leitura do ficheiro Definir como só de leitura
rom Eliminare stare doar citire Setare stare doar citire
rus Снять "Только Чтение" "Только Чтение" файла
slv Počisti zastavico Samo za branje Nastavi samo za branje
sqi Pastro flamurin vetëm-lexo Vendos vetëm-lexo
sve Inaktivera skrivskydd Aktivera skrivskydd
trk Salt Okunur İşaretini Kaldır Salt Okunur Yap
ukr Прибрати атрибут «Лише читання» Лише читання

I propose implementing the same functionality. This way, it becomes easier for the user:

  1. View the read-only template.
  2. Save as a new template.
  3. Clear the read-only flag.

Originally posted by @ajtruckle in https://github.com/ajtruckle/meeting-schedule-assistant-support/issues/65#issuecomment-2094912838

ajtruckle commented 6 months ago

The feature is now accessible in the Script Editor. However, it's important to note that users are advised against modifying the built-in templates. Any alterations made to these templates will be overwritten, as the software compares the timestamps with the original installation files. Nonetheless, users can now modify the read-only status.

Updates to Edit Help Topic

Help topic: https://www.publictalksoftware.co.uk/help-msa/msa-advanced-editor-menu-edit.html

  • Set Read-Only Sets the Windows Operating System (OS) read-only attribute on the current document. This prevents further editing until the read-only flag is cleared. This is useful for protecting the file from accidental modification.
  • Clear Read-Only Flag Clears the Windows Operating System (OS) read-only attribute on the file, allowing it to be edited again. Use this command if you need to make changes to a previously protected text file.
cengizu commented 6 months ago

@ajtruckle

When trying to edit built-in files (CSS, XML, XSL) the file should be read-only by default. No editing possible. If the user decides to remove the read-only flag of these files, maybe Save As dialog might open first to direct them save it under different file name and then they can modify file as they wish.

ajtruckle commented 6 months ago

@cengizu I am sending you a new beta with addresses two issues:

  1. It was not setting the read-only flag correctly. My code was incorrect.
  2. It was not changing the state of the editor itself to read-only. So you were able to continue typing.

The editor should now reflect the read-only flag state. But there is one scenario that I did not cater for:

When trying to edit built-in files (CSS, XML, XSL) the file should be read-only by default. No editing possible. But normal circumstances this is the case. Unless the user fiddles with the files or installer setup. At the moment the software will only revert to the original file if te time stamp had been tampered with. It won't replace it if they removed the read-only flag. If you think this behaviour should change then I feel it should be a separate ticket.

If the user decides to remove the read-only flag of these files, maybe Save As dialog might open first to direct them save it under different file name and then they can modify file as they wish.

I hear what you're saying. But I feel that this would not be normal behaviour. If I chose an option to remove a setting, then I expect it to remove that setting. For it to suddenly show up a Save As window with no explanation will be confusing IMHO. For now I think I will leave it as it is.

The only alternative is to disable the Clear Read-Only Flag" menu item when they have a built-in file open. But I don't want to make this overly complex. I already have my safety mechanism to reset the files if tampered with. They'll soon learn that they should save the file with a new name first. I don't have to address every situation. Agreed?

New beta on it's way to you.

ajtruckle commented 6 months ago

@cengizu I have made the necessary changes. It is now not possible to change the read-only flag state when the file is in a modified state.

New beta on it's way to you.

cengizu commented 6 months ago

@ajtruckle

Works good 👍