From a43614dd9ac1f5019cbc72db4e0aa1612109d717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Mon, 11 Aug 2025 21:26:27 +0200 Subject: [PATCH] Add alert if clipboard empty and trying to send clipboard --- QuickDrop/AppDelegate.swift | 11 +- QuickDrop/Localizable.xcstrings | 317 +++++++++++++++++++++++++++++++- 2 files changed, 325 insertions(+), 3 deletions(-) diff --git a/QuickDrop/AppDelegate.swift b/QuickDrop/AppDelegate.swift index debe4e6..3746c76 100644 --- a/QuickDrop/AppDelegate.swift +++ b/QuickDrop/AppDelegate.swift @@ -172,8 +172,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele let pasteboard = NSPasteboard.general let clipboardString = pasteboard.string(forType: .string) ?? "" - let sharingService = NSSharingService(named: NSSharingService.Name("com.leonboettger.neardrop.ShareExtension")) - sharingService?.perform(withItems: [clipboardString]) + if clipboardString.isEmpty { + DispatchQueue.main.async { + BezelNotification.show(messageText: "ClipboardEmpty".localized(), icon: .clipboard) + } + } + else { + let sharingService = NSSharingService(named: NSSharingService.Name("com.leonboettger.neardrop.ShareExtension")) + sharingService?.perform(withItems: [clipboardString]) + } } diff --git a/QuickDrop/Localizable.xcstrings b/QuickDrop/Localizable.xcstrings index 1e5ce82..11b23c8 100644 --- a/QuickDrop/Localizable.xcstrings +++ b/QuickDrop/Localizable.xcstrings @@ -1175,6 +1175,113 @@ } } }, + "ClipboardEmpty" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "الحافظة فارغة" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Zwischenablage leer" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Clipboard Empty" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Portapapeles vacío" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Presse-papiers vide" + } + }, + "hu" : { + "stringUnit" : { + "state" : "translated", + "value" : "Vágólap üres" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Appunti Vuoti" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "クリップボードは空です" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "클립보드가 비어 있습니다" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Klembord Leeg" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Área de transferência vazia" + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "translated", + "value" : "Área de transferência vazia" + } + }, + "ro" : { + "stringUnit" : { + "state" : "translated", + "value" : "Clipboard gol" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Буфер обмена пуст" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "คลิปบอร์ดว่างเปล่า" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Буфер обміну порожній" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "剪贴板为空" + } + } + } + }, "CloseAlert" : { "extractionState" : "manual", "localizations" : { @@ -6621,6 +6728,110 @@ } }, "QuickDrop" : { + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "de" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "es" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "fr" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "hu" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "it" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ja" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ko" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "nl" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ro" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ru" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "th" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "uk" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + } + }, "shouldTranslate" : false }, "QuickDropAndroidAppAdvertisement" : { @@ -7159,7 +7370,111 @@ } }, "Reset UD" : { - + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "de" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "es" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "fr" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "hu" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "it" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ja" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ko" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "nl" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "pt-PT" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ro" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "ru" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "th" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "uk" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "new", + "value" : "" + } + } + }, + "shouldTranslate" : false }, "SaveFilesLocation" : { "extractionState" : "manual",