From 9cc2c7bb1282afaa58002c0b1a1369a04a9d202f Mon Sep 17 00:00:00 2001 From: Rusty Myers Date: Thu, 18 Feb 2021 11:29:01 -0500 Subject: [PATCH] Updating to version 1.7! Fixes Tool tip and adds QnA path to title bar. Added a preferences window that will hold something in the future. Better containerize QnA module by moving code into method. Adding ability to check multiple paths for QnA binary, will make it a preference...I hope. --- QnA GUI.xcodeproj/project.pbxproj | 8 +++---- QnA/AppDelegate.swift | 29 ------------------------- QnA/Base.lproj/Main.storyboard | 20 +++++++++--------- QnA/PrefsViewController.swift | 5 ++++- QnA/QnA.swift | 31 ++++++++++++++++++++++++--- QnA/ViewController.swift | 35 ++++++++++++++++++------------- 6 files changed, 67 insertions(+), 61 deletions(-) diff --git a/QnA GUI.xcodeproj/project.pbxproj b/QnA GUI.xcodeproj/project.pbxproj index ea582ab..725f709 100644 --- a/QnA GUI.xcodeproj/project.pbxproj +++ b/QnA GUI.xcodeproj/project.pbxproj @@ -273,12 +273,12 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6; + CURRENT_PROJECT_VERSION = 1.7; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = QnA/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.6; + MARKETING_VERSION = 1.7; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = edu.psu.QnAGUI; PRODUCT_NAME = "QnA GUI"; @@ -293,12 +293,12 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6; + CURRENT_PROJECT_VERSION = 1.7; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = QnA/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.6; + MARKETING_VERSION = 1.7; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = edu.psu.QnAGUI; PRODUCT_NAME = "QnA GUI"; diff --git a/QnA/AppDelegate.swift b/QnA/AppDelegate.swift index d4b0c21..4ba5d34 100644 --- a/QnA/AppDelegate.swift +++ b/QnA/AppDelegate.swift @@ -12,37 +12,8 @@ import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { @IBOutlet weak var runQueryMenuItem: NSMenuItem! - var qnaPath = String() - var qna_file_paths:[String] = ["/Library/BESAgent/BESAgent.app/Contents/MacOS/QnA","QnA","/usr/local/bin/QnA"] - func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application - NSLog("Starting App") - - // Create a FileManager instance - let fileManager = FileManager.default - - // Check if file exists, given its path - for qna_test_Path in qna_file_paths { - // Example: http://stackoverflow.com/questions/30097521/messagebox-from-daemon-in-swift-os-x - if fileManager.fileExists(atPath: qna_test_Path) { - print("File exists: \(qna_test_Path)") - qnaPath = qna_test_Path - return - } else { - print("File not found: \(qna_test_Path)") - } - } - if qnaPath == "" { - let alert:NSAlert = NSAlert(); - alert.messageText = "Missing QnA Binary"; - alert.informativeText = "QnA GUI.app could not find the QnA binary! Please install and try again."; - alert.runModal(); - exit(3) - - } else { - print("We found qna! \(qnaPath)") - } } func applicationWillTerminate(_ aNotification: Notification) { diff --git a/QnA/Base.lproj/Main.storyboard b/QnA/Base.lproj/Main.storyboard index b9eea1a..f0b0fe3 100644 --- a/QnA/Base.lproj/Main.storyboard +++ b/QnA/Base.lproj/Main.storyboard @@ -679,9 +679,8 @@ - + - @@ -700,10 +699,10 @@ - + - + @@ -717,7 +716,7 @@ - + @@ -754,15 +753,15 @@ - + - + - + @@ -773,11 +772,11 @@ - + -