Skip to content

v1.1 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions TempBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
7501771C26F38A9E00A47F7D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7501770226F38A9E00A47F7D /* Assets.xcassets */; };
7501772C26F38E0B00A47F7D /* RootNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7501772B26F38E0B00A47F7D /* RootNavigationView.swift */; };
7501772F26F38E4200A47F7D /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7501772E26F38E4200A47F7D /* SidebarView.swift */; };
751E7117272AB2AD005EB503 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 751E7116272AB2AD005EB503 /* Sparkle */; };
751E711A272AB3B8005EB503 /* CheckForUpdatesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 751E7119272AB3B8005EB503 /* CheckForUpdatesView.swift */; };
751E711C272AB3D3005EB503 /* UpdaterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 751E711B272AB3D3005EB503 /* UpdaterViewController.swift */; };
752D57072711C61C0015D26D /* MessageDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752D57062711C61C0015D26D /* MessageDetailViewController.swift */; };
752D57092711D7730015D26D /* MessageDownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752D57082711D7730015D26D /* MessageDownloadManager.swift */; };
7535D98F2708663300D39FAB /* MTMessage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7535D98E2708663300D39FAB /* MTMessage+Extensions.swift */; };
Expand Down Expand Up @@ -101,6 +104,8 @@
7501771226F38A9E00A47F7D /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = "<group>"; };
7501772B26F38E0B00A47F7D /* RootNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootNavigationView.swift; sourceTree = "<group>"; };
7501772E26F38E4200A47F7D /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = "<group>"; };
751E7119272AB3B8005EB503 /* CheckForUpdatesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckForUpdatesView.swift; sourceTree = "<group>"; };
751E711B272AB3D3005EB503 /* UpdaterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdaterViewController.swift; sourceTree = "<group>"; };
752D57062711C61C0015D26D /* MessageDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageDetailViewController.swift; sourceTree = "<group>"; };
752D57082711D7730015D26D /* MessageDownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageDownloadManager.swift; sourceTree = "<group>"; };
7535D98E2708663300D39FAB /* MTMessage+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MTMessage+Extensions.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -170,6 +175,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
751E7117272AB2AD005EB503 /* Sparkle in Frameworks */,
75C3204D26FBA229009AAB26 /* Resolver in Frameworks */,
75C8D5D327131F1C0013F64A /* MailTMSwift in Frameworks */,
);
Expand Down Expand Up @@ -207,6 +213,7 @@
7501771026F38A9E00A47F7D /* macOS */ = {
isa = PBXGroup;
children = (
751E7118272AB3AB005EB503 /* Updater */,
750176FF26F38A9D00A47F7D /* TempBoxApp.swift */,
756E473D2712C1E000E8A439 /* AppDelegate.swift */,
75752EFC26F39C3D004EA6C1 /* AppController.swift */,
Expand Down Expand Up @@ -256,6 +263,15 @@
path = Sidebar;
sourceTree = "<group>";
};
751E7118272AB3AB005EB503 /* Updater */ = {
isa = PBXGroup;
children = (
751E7119272AB3B8005EB503 /* CheckForUpdatesView.swift */,
751E711B272AB3D3005EB503 /* UpdaterViewController.swift */,
);
path = Updater;
sourceTree = "<group>";
};
753D3927270050B900911B58 /* Fakes */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -497,6 +513,7 @@
packageProductDependencies = (
75C3204C26FBA229009AAB26 /* Resolver */,
75C8D5D227131F1C0013F64A /* MailTMSwift */,
751E7116272AB2AD005EB503 /* Sparkle */,
);
productName = "TempBox (macOS)";
productReference = 7501770F26F38A9E00A47F7D /* TempBox.app */;
Expand Down Expand Up @@ -551,6 +568,7 @@
packageReferences = (
75C3204B26FBA229009AAB26 /* XCRemoteSwiftPackageReference "Resolver" */,
75C8D5D127131F1C0013F64A /* XCRemoteSwiftPackageReference "MailTMSwift" */,
751E7115272AB2AD005EB503 /* XCRemoteSwiftPackageReference "Sparkle" */,
);
productRefGroup = 7501770826F38A9E00A47F7D /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -631,6 +649,7 @@
75DE87472702D8D0008C089B /* MessagesListenerService.swift in Sources */,
75640F2827063A1B00C7BCF6 /* MTLiveMessagesService+Extensions.swift in Sources */,
7501771626F38A9E00A47F7D /* TempBoxApp.swift in Sources */,
751E711A272AB3B8005EB503 /* CheckForUpdatesView.swift in Sources */,
75A3C4D12708CC99004ED1AB /* MessageDetailHeader.swift in Sources */,
7501772F26F38E4200A47F7D /* SidebarView.swift in Sources */,
757EA59B270CE724004793CA /* AttachmentDownloadManager.swift in Sources */,
Expand All @@ -643,6 +662,7 @@
75C3202626FB5AEE009AAB26 /* String+Extensions.swift in Sources */,
7575A2B426F472C200A90CFE /* TempBox.xcdatamodeld in Sources */,
75C3205726FBA89D009AAB26 /* Respositories+Injection.swift in Sources */,
751E711C272AB3D3005EB503 /* UpdaterViewController.swift in Sources */,
75752EFD26F39C3D004EA6C1 /* AppController.swift in Sources */,
75DF252526F3D9D9003F69FE /* WebView.swift in Sources */,
75C3204A26FBA1A2009AAB26 /* AccountService.swift in Sources */,
Expand Down Expand Up @@ -824,6 +844,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.waseem.TempBox;
PRODUCT_NAME = TempBox;
SDKROOT = macosx;
Expand All @@ -850,6 +871,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.waseem.TempBox;
PRODUCT_NAME = TempBox;
SDKROOT = macosx;
Expand Down Expand Up @@ -943,6 +965,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
751E7115272AB2AD005EB503 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sparkle-project/Sparkle";
requirement = {
branch = 2.x;
kind = branch;
};
};
75C3204B26FBA229009AAB26 /* XCRemoteSwiftPackageReference "Resolver" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/hmlongco/Resolver";
Expand All @@ -962,6 +992,11 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
751E7116272AB2AD005EB503 /* Sparkle */ = {
isa = XCSwiftPackageProductDependency;
package = 751E7115272AB2AD005EB503 /* XCRemoteSwiftPackageReference "Sparkle" */;
productName = Sparkle;
};
75C3204C26FBA229009AAB26 /* Resolver */ = {
isa = XCSwiftPackageProductDependency;
package = 75C3204B26FBA229009AAB26 /* XCRemoteSwiftPackageReference "Resolver" */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion macOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent

var window: NSWindow?
@Injected var persistenceManager: PersistenceManager

func applicationDidFinishLaunching(_ notification: Notification) {
registerNotifications()
NSWindow.allowsAutomaticWindowTabbing = false
Expand Down
12 changes: 0 additions & 12 deletions macOS/Features/Sidebar/SidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@

import SwiftUI

let placeholderAddresses = [
"[email protected]",
"[email protected]",
"[email protected]"
]

let placeholderArchivedAddresses = [
"[email protected]",
"[email protected]",
"[email protected]"
]

struct SidebarView: View {

@EnvironmentObject var appController: AppController
Expand Down
2 changes: 1 addition & 1 deletion macOS/RootNavigationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct RootNavigationView: View {
}

}
.frame(minWidth: 1000, minHeight: 600, idealHeight: 800)
.frame(minHeight: 600, idealHeight: 800)
.alert(item: $appController.alertData, content: { alertData in
var messageText: Text?
if let messsage = alertData.message {
Expand Down
6 changes: 5 additions & 1 deletion macOS/Supporting files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -33,5 +33,9 @@
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>SUFeedURL</key>
<string>https://tempbox.waseem.works/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>PT4SSsorf7XqzStOwHacUK94e0TYMueytNvSQWfvPgQ=</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions macOS/TempBoxApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI
import Combine
import Resolver
import Sparkle

@main
struct TempBoxApp: App {
Expand All @@ -17,6 +18,7 @@ struct TempBoxApp: App {
// swiftlint:enable weak_delegate

@StateObject var appController = AppController()
@StateObject var updaterViewController = UpdaterViewController()

var body: some Scene {
WindowGroup {
Expand All @@ -26,6 +28,16 @@ struct TempBoxApp: App {
.commands {
SidebarCommands()
CommandGroup(replacing: .help) {
Button("Github") {
NSWorkspace.shared.open(URL(string: "https://github.com/devwaseem/TempBox")!)
}
Button("Website") {
NSWorkspace.shared.open(URL(string: "https://tempbox.waseem.works")!)
}
Button("Developer") {
NSWorkspace.shared.open(URL(string: "https://waseem.works")!)
}
Divider()
Button("API") {
NSWorkspace.shared.open(URL(string: "https://docs.mail.tm")!)
}
Expand All @@ -47,6 +59,10 @@ struct TempBoxApp: App {
.keyboardShortcut("n")

}

CommandGroup(after: .appInfo) {
CheckForUpdatesView(updaterViewController: updaterViewController)
}
}

}
Expand Down
17 changes: 17 additions & 0 deletions macOS/Updater/CheckForUpdatesView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CheckForUpdatesView.swift
// TempBox (macOS)
//
// Created by Waseem Akram on 28/10/21.
//

import SwiftUI

struct CheckForUpdatesView: View {
@ObservedObject var updaterViewController: UpdaterViewController

var body: some View {
Button("Check For Updates…", action: updaterViewController.checkForUpdates)
.disabled(!updaterViewController.canCheckForUpdates)
}
}
29 changes: 29 additions & 0 deletions macOS/Updater/UpdaterViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// UpdaterViewController.swift
// TempBox (macOS)
//
// Created by Waseem Akram on 28/10/21.
//

import Foundation
import Sparkle
import SwiftUI

final class UpdaterViewController: ObservableObject {
private let updaterController: SPUStandardUpdaterController

@Published var canCheckForUpdates = false

init() {
// If you want to start the updater manually, pass false to startingUpdater and call .startUpdater() later
// This is where you can also pass an updater delegate if you need one
updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)

updaterController.updater.publisher(for: \.canCheckForUpdates)
.assign(to: &$canCheckForUpdates)
}

func checkForUpdates() {
updaterController.checkForUpdates(nil)
}
}