From 1e82707ed0f783c3fa77a8efbea11544142c8527 Mon Sep 17 00:00:00 2001
From: Tamara Steinwender <tamara.steinwender@tugraz.at>
Date: Tue, 22 Jun 2021 10:41:21 +0200
Subject: [PATCH] Small fixes in file-handling

---
 packages/file-handling/src/clipboard.js                 | 5 +++--
 packages/file-handling/src/dbp-nextcloud-file-picker.js | 2 ++
 packages/file-handling/src/i18n/de/translation.json     | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js
index cafdafe0..e68b84f1 100644
--- a/packages/file-handling/src/clipboard.js
+++ b/packages/file-handling/src/clipboard.js
@@ -501,6 +501,7 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) {
      * @return html
      */
     getAdditionalButtons() {
+        let buttonsAreDisabled = this.clipboardFiles.files.length === 0 ? true : this.clipboardSelectBtnDisabled;
         return html`
             <div class="flex-container additional-button-container">
                         <div class="btn-flex-container-mobile">
@@ -510,13 +511,13 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) {
                             </button>
                             <button @click="${() => { this.clearClipboard(); }}"
                                     class="button" title="${(this.numberOfSelectedFiles > 0) ? i18n.t('clipboard.remove-count', {count: this.numberOfSelectedFiles}) : i18n.t('clipboard.remove-all')}"
-                                    ?disabled="${this.clipboardFiles.files.length === 0}">
+                                    ?disabled="${buttonsAreDisabled}">
                                 ${(this.numberOfSelectedFiles > 0) ? i18n.t('clipboard.remove-count-btn', {count: this.numberOfSelectedFiles}) : i18n.t('clipboard.remove-all-btn')}
                             </button>
                         </div>
                         <div class="btn-flex-container-mobile">
                             <button @click="${() => { this.openFileSink(); }}"
-                                    ?disabled="${this.clipboardFiles.files.length === 0}"
+                                    ?disabled="${buttonsAreDisabled}"
                                     class="button" title="${(this.numberOfSelectedFiles > 0) ? i18n.t('clipboard.save-count', {count: this.numberOfSelectedFiles}) : i18n.t('clipboard.save-all')}">
                                 ${(this.numberOfSelectedFiles > 0) ? i18n.t('clipboard.save-count-btn', {count: this.numberOfSelectedFiles}) : i18n.t('clipboard.save-all-btn')}
                             </button>
diff --git a/packages/file-handling/src/dbp-nextcloud-file-picker.js b/packages/file-handling/src/dbp-nextcloud-file-picker.js
index 23506dd4..97fecc4a 100644
--- a/packages/file-handling/src/dbp-nextcloud-file-picker.js
+++ b/packages/file-handling/src/dbp-nextcloud-file-picker.js
@@ -346,6 +346,8 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
         this.statusText = i18n.t('nextcloud-file-picker.loadpath-nextcloud-file-picker', {name: this.nextcloudName});
         this.lastDirectoryPath = this.directoryPath;
         this.directoryPath = path;
+        if (this._("#select_all"))
+            this._("#select_all").checked = false;
 
         // see https://github.com/perry-mitchell/webdav-client#getdirectorycontents
         if (this.webDavClient === null) {
diff --git a/packages/file-handling/src/i18n/de/translation.json b/packages/file-handling/src/i18n/de/translation.json
index e9dfc4f3..ee20bbcc 100644
--- a/packages/file-handling/src/i18n/de/translation.json
+++ b/packages/file-handling/src/i18n/de/translation.json
@@ -90,13 +90,13 @@
     "add-files": "Dateien der Zwischenablage hinzufügen",
     "add-files-btn": "Dateien hinzufügen",
     "remove-all": "Alle Dateien aus der Zwischenablage entfernen",
-    "remove-all-btn": "Alle entfernen",
+    "remove-all-btn": "Dateien entfernen",
     "remove-count": "Eine Datei aus der Zwischenablage entfernen",
     "remove-count_plural": "{{count}} Dateien aus der Zwischenablage entfernen",
     "remove-count-btn": "Datei entfernen",
     "remove-count-btn_plural": "{{count}} Dateien entfernen",
     "save-all": "Alle Dateien aus der Zwischenablage sichern",
-    "save-all-btn": "Alle sichern",
+    "save-all-btn": "Dateien sichern",
     "save-count-btn": "Datei sichern",
     "save-count-btn_plural": "{{count}} Dateien sichern",
     "save-count": "Eine Datei aus der Zwischenablage sichern",
-- 
GitLab