From 6fd56ddcc5621b387873b8a954d387b653fbb4aa Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 18:19:43 +0200 Subject: [PATCH 1/7] Addons.xcu - update German translations --- timeStampBackup/Addons.xcu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/timeStampBackup/Addons.xcu b/timeStampBackup/Addons.xcu index 5411bd8..2530bf4 100644 --- a/timeStampBackup/Addons.xcu +++ b/timeStampBackup/Addons.xcu @@ -18,7 +18,7 @@ Save and Timestamp-backup Mentés és időbélyeges archiválás - Speichern und Zeitstempelspeichern + Speichern, auch als Backup mit Zeitstempel Salva e archivio con date e ora Guardar y archivar con fecha y hora Сохранение и архив с указанием даты и времени @@ -64,7 +64,7 @@ Save and Timestamp-backup Mentés és időbélyeges archiválás - Speichern und Zeitstempelspeichern + Speichern, auch als Backup mit Zeitstempel Salva e archivio con date e ora Guardar y archivar con fecha y hora Сохранение и архив с указанием даты и времени @@ -103,7 +103,7 @@ Save and Timestamp-backup Mentés és időbélyeges archiválás - Speichern und Zeitstempelspeichern + Speichern, auch als Backup mit Zeitstempel Salva e archivio con date e ora Guardar y archivar con fecha y hora Сохранение и архив с указанием даты и времени From 768820a5909b958fc86a36210ca6220839efffce Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 18:31:42 +0200 Subject: [PATCH 2/7] Update README.md --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 26db7b0..88f8dca 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,25 @@ -# Timestamp Backup LibreOffice extension - -This extension created for the LibreOffice and OpenOffice enables the -user to make normal Save and to create a TimeStamped Backup copy of the -actual document at once. -The archiv file with a time stamped filename will placed into the -Backup directory given in the -Tools - Options - Open/LibreOffice - Paths -It is better to adjust the path of the Backup directory to a user +# Timestamp Backup LibreOffice Extension + +This extension for LibreOffice and OpenOffice enables the +user to make a normal save and to additionally create a timestamped backup copy of the +document with just one click. + +The backup copy will be placed into the +backup directory set in `Tools - Options - Open/LibreOffice - Paths - Backups` + +It is recommended to adjust the path of the backup directory to a user friendly place. -The extension has a menu item in the File menu, and a toolbar icon -in the Standard toolbar, and it works in the applications listed below: -Writer, WriterWeb, WriterMaster; Calc, Draw, Impress, Math applications. +The extension has a menu item in the `File` menu, and a toolbar icon +in the `standard` toolbar. + +It works in these applications: Writer, WriterWeb, WriterMaster, Calc, Draw, Impress, Math. You can download the latest version of this extension for LibreOffice -and for OpenOffice from the page: +and for OpenOffice from this page: http://flowcont.hu/LO_oxt_store/ -This extension under licenced in the GPL v3 licence. +License: GPL v3 Original creator: Kovács Tibor From d87c79acfca833db26e696a6ed2da047c32b0775 Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 18:35:15 +0200 Subject: [PATCH 3/7] Update timeStampBackup.xba --- timeStampBackup/timeStampBackup/timeStampBackup.xba | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timeStampBackup/timeStampBackup/timeStampBackup.xba b/timeStampBackup/timeStampBackup/timeStampBackup.xba index cb76ce4..abe71c9 100644 --- a/timeStampBackup/timeStampBackup/timeStampBackup.xba +++ b/timeStampBackup/timeStampBackup/timeStampBackup.xba @@ -50,11 +50,11 @@ Sub timeStampBackup sLocale = GetRegistryKeyContent("org.openoffice.Setup/L10N",FALSE).getByName("ooLocale") Select case sLocale case "en-GB", "en-US" - MsgBox("The document have not any URL (have not a valid file name and / or path) yet." & Chr(10) & "The document will not be archived. Save your document first.",16,"Attention:") + MsgBox("The document has not any URL (has not a valid file name and / or path) yet." & Chr(10) & "The document will not be archived. Save your document first.",16,"Attention:") case "hu" MsgBox("A dokumentum még nem rendelkezik fájlnévvel és/vagy elérési útvonallal!" & Chr(10) & "Az archiválás nem végrahajtható. Előbb mentsd el a dokumentumot!",16,"Figyelem:") case "de" - MsgBox("Das Dokument haben keine URL (keine gültige Dateinamen und / oder Pfad) noch." & Chr(10) & "Das Dokument wird nicht archiviert. Speichern Sie zuerst das Dokument.",16,"Achtung:") + MsgBox("Das Dokument hat noch keine URL (keinen gültigen Dateinamen und / oder Pfad)." & Chr(10) & "Das Dokument wird nicht archiviert. Speichern Sie zuerst das Dokument.",16,"Achtung:") case "it" MsgBox("Il documento non ha alcun URL (non hanno un nome valido di file e / o percorso) ancora." & Chr(10) & "Il documento non verrà archiviato. Salvare il documento prima.",16,"Attenzione:") case "es" From 4c7779457fdd3916c1af697d432065f622427dc2 Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 18:43:48 +0200 Subject: [PATCH 4/7] Update pkg-description.de --- timeStampBackup/pkg-desc/pkg-description.de | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/timeStampBackup/pkg-desc/pkg-description.de b/timeStampBackup/pkg-desc/pkg-description.de index 9eaa130..409bc4f 100644 --- a/timeStampBackup/pkg-desc/pkg-description.de +++ b/timeStampBackup/pkg-desc/pkg-description.de @@ -1,14 +1,19 @@ -Diese Erweiterung wurde für LibreOffice und OpenOffice erstellt und ermöglicht es den Benutzern, normale Save zu erstellen und eine TimeStamped Backup-Kopie des aktuellen Dokuments auf einmal zu erstellen. -Die Archivdatei mit einem zeitgestempelten Dateinamen wird in das Backup-Verzeichnis in den Tools - Optionen - Open / LibreOffice - Pfade platziert -Es ist besser, den Pfad des Backup-Verzeichnisses an einen benutzerfreundlichen Ort anzupassen. +Diese Erweiterung wurde für LibreOffice und OpenOffice erstellt und ermöglicht es dem Benutzer, +gleichzeitig die Datei zu speichern und eine Backup-Kopie mit Zeitspempel zu erstellen. -Die Erweiterung verfügt über einen Menüpunkt im Menü Datei und ein Symbolleistensymbol in der Symbolleiste Standard, und es funktioniert in den folgenden Anwendungen: -Writer, WriterWeb, WriterMaster; Calc, Draw, Impress, Base, Mathematische Anwendungen. +Diese Backup-Kopie wird in das unter Extras - Optionen - Open-/LibreOffice - Pfade - Backup +eingestellte Verzeichnis gespeichert. Es wird empfohlen, das Backup-Verzeichnis auf einen +benutzerfreundlicheren Ort umzustellen. -Sie können die neueste Version dieser Erweiterung für LibreOffice herunterladen -Und für OpenOffice von der Seite: +Die Erweiterung fügt einen Eintrag im Menü Datei und ein Symbol in der Symbolleiste Standard hinzu. + +Die Erweiterung funktioniert in den folgenden Anwendungen: +Writer, WriterWeb, WriterMaster; Calc, Draw, Impress, Base, Math + +Sie können die neueste Version dieser Erweiterung für LibreOffice und OpenOffice +von dieser Seite herunterladen: Http://flowcont.hu/LO_oxt_store/ -Diese Erweiterung lizenziert unter der GPL v3 Lizenz. +Diese Erweiterung ist lizenziert unter der GPL v3. Tibor Kovács - Flow-Cont Ltd. From 1fb066eae508310e437a9b264b7311589d3fd291 Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 21:05:21 +0200 Subject: [PATCH 5/7] include path into name of backup file --- timeStampBackup/timeStampBackup/timeStampBackup.xba | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timeStampBackup/timeStampBackup/timeStampBackup.xba b/timeStampBackup/timeStampBackup/timeStampBackup.xba index abe71c9..cd8d4a9 100644 --- a/timeStampBackup/timeStampBackup/timeStampBackup.xba +++ b/timeStampBackup/timeStampBackup/timeStampBackup.xba @@ -40,7 +40,9 @@ Sub timeStampBackup If oDoc.hasLocation() then sDocURL = oDoc.getURL() + dirname=DirectoryNameoutofPath(sDocURL, "/") sBackupURL = CreateUnoService("com.sun.star.util.PathSettings").Backup & "/" & _ + ReplaceString(RIGHT(dirname,LEN(dirname)-8),"_","/") & "___" & _ GetFileNameWithoutExtension(sDocURL, "/") & _ sTimeStamp() & "." & _ GetFileNameExtension(sDocURL, "/") From 97bd14c6a4ef01104277c3d395889796f8bfaf63 Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 21:19:35 +0200 Subject: [PATCH 6/7] Update pkg-description.en --- timeStampBackup/pkg-desc/pkg-description.en | 25 ++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/timeStampBackup/pkg-desc/pkg-description.en b/timeStampBackup/pkg-desc/pkg-description.en index af50ec3..92925e0 100644 --- a/timeStampBackup/pkg-desc/pkg-description.en +++ b/timeStampBackup/pkg-desc/pkg-description.en @@ -1,14 +1,19 @@ -This extension was created for the LibreOffice and OpenOffice and it enables the users to make normal Save and to create a TimeStamped Backup copy of the actual document at once. -The archive file with a time stamped filename will placed into the Backup directory given in the Tools - Options - Open/LibreOffice - Paths -It is better to adjust the path of the Backup directory to a user friendly place. +This extension for LibreOffice and OpenOffice enables the user to make a normal save and to additionally create a timestamped backup copy of the document with just one click. -The extension has a menu item in the File menu, and a toolbar icon in the Standard toolbar, and it works in the applications listed below: -Writer, WriterWeb, WriterMaster; Calc, Draw, Impress, Base, Math applications. +The backup copy will be placed into the backup directory set in Tools - Options - Open/LibreOffice - Paths - Backups -You can download the latest version of this extension for LibreOffice -and for OpenOffice from the page: -http://flowcont.hu/LO_oxt_store/ +It is recommended to adjust the path of the backup directory to a user friendly place. -This extension licenced under the GPL v3 licence. +The extension has a menu item in the File menu, and a toolbar icon in the standard toolbar. -Tibor Kovács - Flow-Cont Ltd. +It works in these applications: Writer, WriterWeb, WriterMaster, Calc, Draw, Impress, Math. + +You can download the latest version of this extension for LibreOffice and for OpenOffice from this page: http://flowcont.hu/LO_oxt_store/ + +License: GPL v3 + +Original creator: Kovács Tibor + +Project maintainer: kovlev, however any contribution is appreciated + +Relevant OOo forum thread: https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=86742 From a7d42233eba2db3d42dc4de4ed7d6ebc8b383fba Mon Sep 17 00:00:00 2001 From: swhib <37251710+swhib@users.noreply.github.com> Date: Sun, 25 Mar 2018 22:01:28 +0200 Subject: [PATCH 7/7] add path of source into name of backup file I use `dirname=ReplaceString(...` to remove `:` from paths in windows. Tested on win10 and linux --- timeStampBackup/timeStampBackup/timeStampBackup.xba | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/timeStampBackup/timeStampBackup/timeStampBackup.xba b/timeStampBackup/timeStampBackup/timeStampBackup.xba index cb76ce4..0f893c0 100644 --- a/timeStampBackup/timeStampBackup/timeStampBackup.xba +++ b/timeStampBackup/timeStampBackup/timeStampBackup.xba @@ -30,17 +30,20 @@ Sub timeStampBackup Dim sTimeStamp as string Dim sLocale as string Dim oDoc as object + Dim dirname as string If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then GlobalScope.BasicLibraries.LoadLibrary("Tools") End If - sTimeStamp = "_" & Format(Year(Now), "0000") & Format(Month(Now), "00") & Format(Day(Now), "00") & "_" & _ + sTimeStamp = "___" & Format(Year(Now), "0000") & Format(Month(Now), "00") & Format(Day(Now), "00") & "_" & _ Format(Hour(Now), "00") & Format(Minute(Now), "00") & Format(Second(Now), "00") oDoc = Thiscomponent If oDoc.hasLocation() then sDocURL = oDoc.getURL() + dirname=ReplaceString(DirectoryNameoutofPath(sDocURL, "/"),"_",":") sBackupURL = CreateUnoService("com.sun.star.util.PathSettings").Backup & "/" & _ + ReplaceString(RIGHT(dirname,LEN(dirname)-8),"_","/") & "___" & _ GetFileNameWithoutExtension(sDocURL, "/") & _ sTimeStamp() & "." & _ GetFileNameExtension(sDocURL, "/")