Skip to content

Commit

Permalink
Increased MacOS target from 11 to 12 to support alerts. Request user …
Browse files Browse the repository at this point in the history
…to allow start on boot, upon installing the application.
  • Loading branch information
tijme committed Dec 29, 2022
1 parent 41995a2 commit 03f163a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 39 deletions.
12 changes: 6 additions & 6 deletions Raivo MacOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 18;
CURRENT_PROJECT_VERSION = 19;
DEVELOPMENT_ASSET_PATHS = "\"Raivo MacOS/Supporting/Development.xcassets\"";
DEVELOPMENT_TEAM = 564B4ETY69;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -522,8 +522,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
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 = 18;
CURRENT_PROJECT_VERSION = 19;
DEVELOPMENT_ASSET_PATHS = "\"Raivo MacOS/Supporting/Development.xcassets\"";
DEVELOPMENT_TEAM = 564B4ETY69;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -553,8 +553,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1.0;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = "me.tij.Raivo-MacOS";
PRODUCT_NAME = "Raivo OTP";
SKIP_INSTALL = NO;
Expand Down
4 changes: 2 additions & 2 deletions Raivo MacOS/ApplicationDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCe

/// We need to keep a strong reference to the status bar to make sure it keeps working
var statusBarFeature: StatusBarFeature?

/// Our status item (menu bar item) that was generated using the status bar featured
var statusItem: NSStatusItem?

Expand Down Expand Up @@ -96,7 +96,7 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCe
// If this is the first launch, open the welcome screen
if !StorageHelper.shared.getHasLaunchedBefore() {
try? StorageHelper.shared.setHasLaunchedBefore()
LaunchAtLogin.isEnabled = true
self.welcomeView.showStartOnBootAlert = true
statusBarFeature?.onOpen()
}
}
Expand Down
74 changes: 43 additions & 31 deletions Raivo MacOS/Views/Tabs/WelcomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,56 @@ struct WelcomeView: View {
/// The title of the tab
let preferencePaneTitle: String = "Welcome"

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

/// The actual view shown when someone clicks on the support tab
var body: some View {
ZStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .center, spacing: 0) {
Image("image-titlebar-icon")
ZStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .center, spacing: 0) {
Image("image-titlebar-icon")
.resizable()
.scaledToFit()
.frame(width: 45, height: 45, alignment: .center)
Text("Menu bar app").opacity(0.5)
Spacer()
}
Image("image-titlebar-dropdown")
.resizable()
.scaledToFit()
.frame(width: 45, height: 45, alignment: .center)
Text("Menu bar app").opacity(0.5)
Spacer()
.frame(width: 200, height: 150, alignment: .leading)
.offset(x: -10, y: -15)
}
.frame(width: 175, height: 250, alignment: .center)
.offset(x: 50, y: 10)
.opacity(0.5)
VStack (alignment: .leading, spacing: 5) {
Text("Welcome to Raivo").font(.largeTitle).bold()
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)
}
Button("Buy me a coffee") {
TipJarView().openInWindow(title: "Tip Jar", sender: self)
}.buttonStyle(MainButtonStyle())
}.padding(.vertical)
}
Image("image-titlebar-dropdown")
.resizable()
.scaledToFit()
.frame(width: 200, height: 150, alignment: .leading)
.offset(x: -10, y: -15)
.padding()
.frame(width: 325, height: 250)
.offset(x: +225)
}
.frame(width: 175, height: 250, alignment: .center)
.offset(x: 50, y: 10)
.opacity(0.5)
VStack (alignment: .leading, spacing: 5) {
Text("Welcome to Raivo").font(.largeTitle).bold()
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)
}
Button("Buy me a coffee") {
TipJarView().openInWindow(title: "Tip Jar", sender: self)
}.buttonStyle(MainButtonStyle())
}.padding(.vertical)
.frame(width: 550, height: 250, alignment: .topLeading)
.alert("Would you like Raivo OTP to start on boot of MacOS?", isPresented: $showStartOnBootAlert) {
Button("Yes", role: .none) {
LaunchAtLogin.isEnabled = true
}
Button("No", role: .cancel) {
LaunchAtLogin.isEnabled = false
}
}
.padding()
.frame(width: 325, height: 250)
.offset(x: +225)
}
.frame(width: 550, height: 250, alignment: .topLeading)

}

}
Expand Down

0 comments on commit 03f163a

Please sign in to comment.