Tweak automatic qr code view appearing

This commit is contained in:
Leon Böttger committed 2025-03-14 21:39:19 +01:00
1 parent c5d4197562
commit 45b89cd391
10 files changed
+15 -9

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.
Binary file not shown.
+6 -4
View File
@@ -246,10 +246,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, MainAppDelegate{
guard let transfer = self.activeIncomingTransfers[id] else { return }
if let error = error {
let alert = NSAlert()
alert.alertStyle = .critical
alert.messageText = String(format: NSLocalizedString("TransferError", value: "Failed to receive files from %@", comment: ""), arguments: [transfer.device.name])
var description = ""
if let ne = (error as? NearbyError){
@@ -269,7 +265,13 @@ class AppDelegate: NSObject, NSApplicationDelegate, MainAppDelegate{
description = error.localizedDescription
}
let alert = NSAlert()
alert.alertStyle = .critical
alert.messageText = String(format: NSLocalizedString("TransferError", value: "Failed to receive files from %@", comment: ""), arguments: [transfer.device.name])
alert.informativeText = description
alert.addButton(withTitle: "TypeNotSupportedButton".localized())
let _ = alert.runModal()
}
else {
+2 -2
View File
@@ -783,7 +783,7 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SHARED_BUILD = 19;
SHARED_BUILD = 20;
SHARED_VERSION = 1.4.5;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -842,7 +842,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SHARED_BUILD = 19;
SHARED_BUILD = 20;
SHARED_VERSION = 1.4.5;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
+7 -3
View File
@@ -354,7 +354,6 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
alert.informativeText = "TimeoutDescription".localized()
alert.addButton(withTitle: "TimeoutButton".localized())
alert.beginSheetModal(for: self.view.window!) { _ in }
}
}
@@ -394,15 +393,20 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
NearbyConnectionManager.shared.startDeviceDiscovery()
self.isDiscovering = true
self.scheduleAutomaticQrCodeView()
}
}
else {
log("Main app is already running")
NearbyConnectionManager.shared.startDeviceDiscovery()
self.isDiscovering = true
self.scheduleAutomaticQrCodeView()
}
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
}
private func scheduleAutomaticQrCodeView() {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
if self.foundDevices.isEmpty {
self.openQrCodeView()
}