diff --git a/RSwitch/AppDelegate.swift b/RSwitch/AppDelegate.swift index 321d589..e6a4d31 100644 --- a/RSwitch/AppDelegate.swift +++ b/RSwitch/AppDelegate.swift @@ -123,6 +123,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { @objc func download_latest_rstudio(_ sender: NSMenuItem?) { let url = URL(string: "https://dailies.rstudio.com/rstudio/oss/mac/") + do { let html = try String.init(contentsOf: url!) let document = try SwiftSoup.parse(html) @@ -142,23 +143,25 @@ class AppDelegate: NSObject, NSApplicationDelegate { try FileManager.default.copyItem(at: tempURL, to: dlfile) NSWorkspace.shared.openFile(dldir.path, withApplication: "Finder") + + DispatchQueue.main.async { infoAlert("Download of latest RStudio daily successful.") } } catch { - //infoAlert("Error downloading and saving file.") + DispatchQueue.main.async { infoAlert("Error downloading and saving latest RStudio daily.") } } } else { - // infoAlert("File not found.") + DispatchQueue.main.async { infoAlert("Latest RStudio daily not found.") } } } else { - //infoAlert("Error downloading file.") + DispatchQueue.main.async { infoAlert("Error downloading latest RStudio daily.") } } } task.resume() } catch { - // error + DispatchQueue.main.async { infoAlert("Error downloading latrest RStudio daily.") } } } @@ -179,16 +182,19 @@ class AppDelegate: NSObject, NSApplicationDelegate { try FileManager.default.copyItem(at: tempURL, to: dlfile) NSWorkspace.shared.openFile(dldir.path, withApplication: "Finder") + + DispatchQueue.main.async { infoAlert("Download of latest r-devel successful.") } + } catch { - //infoAlert("Error downloading and saving file.") + DispatchQueue.main.async { infoAlert("Error downloading and saving latest r-devel .") } } } else { - // infoAlert("File not found.") + DispatchQueue.main.async { infoAlert("Latest r-devel file not found.") } } } else { - //infoAlert("Error downloading file.") + DispatchQueue.main.async { infoAlert("Error downloading latest r-devel .") } } } diff --git a/RSwitch/Base.lproj/Main.storyboard b/RSwitch/Base.lproj/Main.storyboard index 35d919b..e494233 100644 --- a/RSwitch/Base.lproj/Main.storyboard +++ b/RSwitch/Base.lproj/Main.storyboard @@ -734,14 +734,14 @@ - + -RSwitch v1.1.0 +RSwitch v1.2.0 Copyright © 2019 Bob Rudis @@ -749,14 +749,14 @@ MIT Licensed - + - + @@ -768,7 +768,7 @@ MIT Licensed dial app icon by IconMark from the Noun Project - + diff --git a/releases/RSwitch-1.2.0.app.zip b/releases/RSwitch-1.2.0.app.zip new file mode 100644 index 0000000..6c0040d Binary files /dev/null and b/releases/RSwitch-1.2.0.app.zip differ diff --git a/rswitch-menu-example.png b/rswitch-menu-example.png index accc7c9..9d9c6a3 100644 Binary files a/rswitch-menu-example.png and b/rswitch-menu-example.png differ