Skip to content

Commit

Permalink
Renamed 'Raivo OTP' to 'Raivo Receiver'. More extensive debug logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
tijme committed Jul 3, 2023
1 parent 03f163a commit 150c7e1
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 45 deletions.
34 changes: 17 additions & 17 deletions Raivo MacOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
70BF4827295221F300C18237 /* FileHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70BF4826295221F300C18237 /* FileHelper.swift */; };
70C7F21A26713A6E00A109AC /* LaunchAtLogin in Frameworks */ = {isa = PBXBuildFile; productRef = 70C7F21926713A6E00A109AC /* LaunchAtLogin */; };
70C7F21D26713A9800A109AC /* EFQRCode in Frameworks */ = {isa = PBXBuildFile; productRef = 70C7F21C26713A9800A109AC /* EFQRCode */; };
70C7F22026713AAB00A109AC /* Preferences in Frameworks */ = {isa = PBXBuildFile; productRef = 70C7F21F26713AAB00A109AC /* Preferences */; };
70C7F2222671412D00A109AC /* Development.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 70C7F2212671412D00A109AC /* Development.xcassets */; };
70CC256F2A534A3200E8FD40 /* Settings in Frameworks */ = {isa = PBXBuildFile; productRef = 70CC256E2A534A3200E8FD40 /* Settings */; };
70DD2A7023EC8E8E003DE95F /* DataExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70DD2A6F23EC8E8E003DE95F /* DataExtension.swift */; };
70FF64FF23EDEE4A00B94593 /* NotificationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70FF64FE23EDEE4A00B94593 /* NotificationHelper.swift */; };
70FF650323EDF1A600B94593 /* ClipboardHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70FF650223EDF1A600B94593 /* ClipboardHelper.swift */; };
Expand Down Expand Up @@ -78,11 +78,11 @@
buildActionMask = 2147483647;
files = (
7092B99A26C85AED00B10065 /* RNCryptor in Frameworks */,
70CC256F2A534A3200E8FD40 /* Settings in Frameworks */,
70BEFE7526CC0DB60062151A /* Valet in Frameworks */,
70024C9F26EA823D00DC398A /* SwiftyStoreKit in Frameworks */,
70C7F21A26713A6E00A109AC /* LaunchAtLogin in Frameworks */,
70024C9C26EA7FA000DC398A /* StoreKit.framework in Frameworks */,
70C7F22026713AAB00A109AC /* Preferences in Frameworks */,
70C7F21D26713A9800A109AC /* EFQRCode in Frameworks */,
707DE8A8294A661900ADB0F5 /* SwiftyBeaver in Frameworks */,
);
Expand Down Expand Up @@ -265,11 +265,11 @@
packageProductDependencies = (
70C7F21926713A6E00A109AC /* LaunchAtLogin */,
70C7F21C26713A9800A109AC /* EFQRCode */,
70C7F21F26713AAB00A109AC /* Preferences */,
7092B99926C85AED00B10065 /* RNCryptor */,
70BEFE7426CC0DB60062151A /* Valet */,
70024C9E26EA823D00DC398A /* SwiftyStoreKit */,
707DE8A7294A661900ADB0F5 /* SwiftyBeaver */,
70CC256E2A534A3200E8FD40 /* Settings */,
);
productName = "Raivo MacOS";
productReference = 7069B41923E631BC0045B0F3 /* Raivo OTP.app */;
Expand Down Expand Up @@ -302,11 +302,11 @@
packageReferences = (
70C7F21826713A6E00A109AC /* XCRemoteSwiftPackageReference "LaunchAtLogin" */,
70C7F21B26713A9800A109AC /* XCRemoteSwiftPackageReference "EFQRCode" */,
70C7F21E26713AAB00A109AC /* XCRemoteSwiftPackageReference "Preferences" */,
7092B99826C85AED00B10065 /* XCRemoteSwiftPackageReference "RNCryptor" */,
70BEFE7326CC0DB60062151A /* XCRemoteSwiftPackageReference "Valet" */,
70024C9D26EA823D00DC398A /* XCRemoteSwiftPackageReference "SwiftyStoreKit" */,
707DE8A6294A661900ADB0F5 /* XCRemoteSwiftPackageReference "SwiftyBeaver" */,
70CC256D2A534A3200E8FD40 /* XCRemoteSwiftPackageReference "Settings" */,
);
productRefGroup = 7069B41A23E631BC0045B0F3 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -509,7 +509,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 19;
CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "\"Raivo MacOS/Supporting/Development.xcassets\"";
DEVELOPMENT_TEAM = 564B4ETY69;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -523,7 +523,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = "me.tij.Raivo-MacOS";
PRODUCT_NAME = "Raivo OTP";
SKIP_INSTALL = NO;
Expand All @@ -540,7 +540,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 19;
CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "\"Raivo MacOS/Supporting/Development.xcassets\"";
DEVELOPMENT_TEAM = 564B4ETY69;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -554,7 +554,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
MARKETING_VERSION = 1.1.2;
PRODUCT_BUNDLE_IDENTIFIER = "me.tij.Raivo-MacOS";
PRODUCT_NAME = "Raivo OTP";
SKIP_INSTALL = NO;
Expand Down Expand Up @@ -599,7 +599,7 @@
repositoryURL = "https://github.com/SwiftyBeaver/SwiftyBeaver.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.9.6;
minimumVersion = 2.0.0;
};
};
7092B99826C85AED00B10065 /* XCRemoteSwiftPackageReference "RNCryptor" */ = {
Expand All @@ -615,7 +615,7 @@
repositoryURL = "https://github.com/Square/Valet";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.1.3;
minimumVersion = 4.2.0;
};
};
70C7F21826713A6E00A109AC /* XCRemoteSwiftPackageReference "LaunchAtLogin" */ = {
Expand All @@ -631,15 +631,15 @@
repositoryURL = "https://github.com/EFPrefix/EFQRCode";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.2.0;
minimumVersion = 6.2.2;
};
};
70C7F21E26713AAB00A109AC /* XCRemoteSwiftPackageReference "Preferences" */ = {
70CC256D2A534A3200E8FD40 /* XCRemoteSwiftPackageReference "Settings" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/Preferences";
repositoryURL = "https://github.com/sindresorhus/Settings";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.6.0;
minimumVersion = 3.0.2;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down Expand Up @@ -675,10 +675,10 @@
package = 70C7F21B26713A9800A109AC /* XCRemoteSwiftPackageReference "EFQRCode" */;
productName = EFQRCode;
};
70C7F21F26713AAB00A109AC /* Preferences */ = {
70CC256E2A534A3200E8FD40 /* Settings */ = {
isa = XCSwiftPackageProductDependency;
package = 70C7F21E26713AAB00A109AC /* XCRemoteSwiftPackageReference "Preferences" */;
productName = Preferences;
package = 70CC256D2A534A3200E8FD40 /* XCRemoteSwiftPackageReference "Settings" */;
productName = Settings;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/EFPrefix/EFQRCode",
"state" : {
"revision" : "bebbd09eaf28243ec576f6d53cbf9cc5b10eaffb",
"version" : "6.2.1"
"revision" : "2991c2f318ad9529d93b2a73a382a3f9c72c64ce",
"version" : "6.2.2"
}
},
{
Expand All @@ -19,21 +19,21 @@
}
},
{
"identity" : "preferences",
"identity" : "rncryptor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sindresorhus/Preferences",
"location" : "https://github.com/RNCryptor/RNCryptor",
"state" : {
"revision" : "2651cd144615009242c994b087508fef99e9275c",
"version" : "2.6.0"
"revision" : "5e3bbf44f08bf90049537cb8902d8f4fa911a79a",
"version" : "5.1.0"
}
},
{
"identity" : "rncryptor",
"identity" : "settings",
"kind" : "remoteSourceControl",
"location" : "https://github.com/RNCryptor/RNCryptor",
"location" : "https://github.com/sindresorhus/Settings",
"state" : {
"revision" : "5e3bbf44f08bf90049537cb8902d8f4fa911a79a",
"version" : "5.1.0"
"revision" : "11e232f5f928ff9bf5260f40b6b40047ae37c9f2",
"version" : "3.0.2"
}
},
{
Expand All @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyBeaver/SwiftyBeaver.git",
"state" : {
"revision" : "12b5acf96d98f91d50de447369bd18df74600f1a",
"version" : "1.9.6"
"revision" : "1080914828ef1c9ca9cd2bad50667b3d847dabff",
"version" : "2.0.0"
}
},
{
Expand All @@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Square/Valet",
"state" : {
"revision" : "26689601804b0cc86ed212a6b137232c22210d28",
"version" : "4.1.3"
"revision" : "89f12b93553055f4908c0d2548c9b8655926940a",
"version" : "4.2.0"
}
}
],
Expand Down
7 changes: 2 additions & 5 deletions Raivo MacOS/ApplicationDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings
import LaunchAtLogin
import SwiftyStoreKit
import UserNotifications
Expand Down Expand Up @@ -52,10 +52,6 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCe
func applicationDidFinishLaunching(_ notification: Notification) {
log.verbose("Application did finish launching.")

// Migrate `LaunchAtLogin` module
LaunchAtLogin.migrateIfNeeded()
log.verbose("Migrating `LaunchAtLogin` module if needed.")

// Initialise status bar
statusBarFeature = StatusBarFeature()
log.verbose("Status bar feature initialized.")
Expand Down Expand Up @@ -95,6 +91,7 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCe

// If this is the first launch, open the welcome screen
if !StorageHelper.shared.getHasLaunchedBefore() {
log.verbose("Did not launch before according to settings.")
try? StorageHelper.shared.setHasLaunchedBefore()
self.welcomeView.showStartOnBootAlert = true
statusBarFeature?.onOpen()
Expand Down
4 changes: 2 additions & 2 deletions Raivo MacOS/Features/StatusBarFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings

/// The available panes in the GUI of the app
extension Preferences.PaneIdentifier {
Expand Down Expand Up @@ -86,7 +86,7 @@ class StatusBarFeature: NSObject {
func getMenu() -> NSMenu {
let menu = NSMenu()

menu.addItem(NSMenuItem(title: "Raivo OTP v\(AppHelper.version)", action: nil, keyEquivalent: ""))
menu.addItem(NSMenuItem(title: "Raivo Receiver v\(AppHelper.version)", action: nil, keyEquivalent: ""))
menu.addItem(NSMenuItem.separator())

#if DEBUG
Expand Down
3 changes: 3 additions & 0 deletions Raivo MacOS/Helpers/StorageHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class StorageHelper {

/// Mark that the app has been launched before.
public func setHasLaunchedBefore() throws {
log.verbose("Setting has launched before to true.")
return try globals().setString(String(true), forKey: Key.HAS_LAUNCHED_BEFORE)
}

Expand All @@ -137,10 +138,12 @@ class StorageHelper {
/// - Returns: Positive if this is the first launch
public func getHasLaunchedBefore() -> Bool {
guard let resultString = try? globals().string(forKey: Key.HAS_LAUNCHED_BEFORE) else {
log.warning("Could not find 'HAS_LAUNCHED_BEFORE' key in globals.")
return false
}

guard let resultBool = Bool(resultString) else {
log.error("Could not cast 'HAS_LAUNCHED_BEFORE' value to boolean.")
return false
}

Expand Down
2 changes: 1 addition & 1 deletion Raivo MacOS/Views/Tabs/LinkingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings
import EFQRCode

/// A scan tab view shown in the preferences window
Expand Down
2 changes: 1 addition & 1 deletion Raivo MacOS/Views/Tabs/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings
import LaunchAtLogin

/// A tab view shown in the preferences window
Expand Down
2 changes: 1 addition & 1 deletion Raivo MacOS/Views/Tabs/SupportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings
import LaunchAtLogin

/// A support tab view shown in the preferences window
Expand Down
8 changes: 4 additions & 4 deletions Raivo MacOS/Views/Tabs/WelcomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import Cocoa
import SwiftUI
import Preferences
import Settings
import SwiftyStoreKit
import LaunchAtLogin

Expand All @@ -25,7 +25,7 @@ struct WelcomeView: View {
let preferencePaneTitle: String = "Welcome"

/// Request start on boot alert
@State public var showStartOnBootAlert = true
@State public var showStartOnBootAlert = false

/// The actual view shown when someone clicks on the support tab
var body: some View {
Expand Down Expand Up @@ -53,7 +53,7 @@ struct WelcomeView: View {
Text("This menu bar app copies all one-time passwords tapped in Raivo for iOS to your MacOS clipboard.")
HStack {
Button("Get started") {
getAppDelegate().statusBarFeature?.preferencesWindowController.show(preferencePane: .linking)
getAppDelegate().statusBarFeature?.preferencesWindowController.show(pane: .linking)
}
Button("Buy me a coffee") {
TipJarView().openInWindow(title: "Tip Jar", sender: self)
Expand All @@ -65,7 +65,7 @@ struct WelcomeView: View {
.offset(x: +225)
}
.frame(width: 550, height: 250, alignment: .topLeading)
.alert("Would you like Raivo OTP to start on boot of MacOS?", isPresented: $showStartOnBootAlert) {
.alert("Would you like Raivo Receiver to start on boot of MacOS?", isPresented: $showStartOnBootAlert) {
Button("Yes", role: .none) {
LaunchAtLogin.isEnabled = true
}
Expand Down

0 comments on commit 150c7e1

Please sign in to comment.