diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dc5caf9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.afdesign filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index a6c2a92..e71b57f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,350 +1,110 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ +# Created by https://www.gitignore.io/api/swift,macos +# Edit at https://www.gitignore.io/?templates=swift,macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +# End of https://www.gitignore.io/api/swift,macos diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b3485bf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "Carthage/Checkouts/SwiftyUserDefaults"] + path = Carthage/Checkouts/SwiftyUserDefaults + url = https://github.com/radex/SwiftyUserDefaults.git +[submodule "Carthage/Checkouts/Preferences"] + path = Carthage/Checkouts/Preferences + url = https://github.com/sindresorhus/Preferences.git +[submodule "Carthage/Checkouts/Alamofire"] + path = Carthage/Checkouts/Alamofire + url = https://github.com/Alamofire/Alamofire.git diff --git a/Artwork/StatusBarIcon.afdesign b/Artwork/StatusBarIcon.afdesign new file mode 100644 index 0000000..7815861 --- /dev/null +++ b/Artwork/StatusBarIcon.afdesign @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c88c5084293d24622023dea018293dffb0d4c818e5a3c6076dbf85c29fe8978 +size 46191 diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..cb8fafc --- /dev/null +++ b/Cartfile @@ -0,0 +1,4 @@ +github "Alamofire/Alamofire" ~>4.8 +github "radex/SwiftyUserDefaults" ~>4.0 +github "sindresorhus/Preferences" ~>0.4 + diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..4cc87d0 --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1,3 @@ +github "Alamofire/Alamofire" "4.8.2" +github "radex/SwiftyUserDefaults" "4.0.0" +github "sindresorhus/Preferences" "v0.4.0" diff --git a/Carthage/Checkouts/Alamofire b/Carthage/Checkouts/Alamofire new file mode 160000 index 0000000..75bba56 --- /dev/null +++ b/Carthage/Checkouts/Alamofire @@ -0,0 +1 @@ +Subproject commit 75bba56748359f297a83f620d45f72cf4ebee4e7 diff --git a/Carthage/Checkouts/Preferences b/Carthage/Checkouts/Preferences new file mode 160000 index 0000000..0feb15b --- /dev/null +++ b/Carthage/Checkouts/Preferences @@ -0,0 +1 @@ +Subproject commit 0feb15b0e1293d6aa6b8721bc6468139b66b6094 diff --git a/Carthage/Checkouts/SwiftyUserDefaults b/Carthage/Checkouts/SwiftyUserDefaults new file mode 160000 index 0000000..566ace1 --- /dev/null +++ b/Carthage/Checkouts/SwiftyUserDefaults @@ -0,0 +1 @@ +Subproject commit 566ace16ee91242b61e2e9da6cdbe7dfdadd926c diff --git a/EhautX.sln b/EhautX.sln deleted file mode 100644 index 8822dc2..0000000 --- a/EhautX.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EhautX", "EhautX\EhautX.csproj", "{75BF3CFF-AC12-49FA-88A7-AFD4889FA758}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/EhautX.xcodeproj/project.pbxproj b/EhautX.xcodeproj/project.pbxproj new file mode 100644 index 0000000..a4bcc83 --- /dev/null +++ b/EhautX.xcodeproj/project.pbxproj @@ -0,0 +1,654 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + FB1483A422CB898300449969 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483A322CB898300449969 /* AppDelegate.swift */; }; + FB1483A622CB898300449969 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FB1483A522CB898300449969 /* Assets.xcassets */; }; + FB1483A922CB898300449969 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483A722CB898300449969 /* MainMenu.xib */; }; + FB1483B522CB898300449969 /* EhautXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483B422CB898300449969 /* EhautXTests.swift */; }; + FB1483C022CB898300449969 /* EhautXUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483BF22CB898300449969 /* EhautXUITests.swift */; }; + FB1483D122CB8B9800449969 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483CE22CB8B9800449969 /* Alamofire.framework */; }; + FB1483D222CB8B9800449969 /* Preferences.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483CF22CB8B9800449969 /* Preferences.framework */; }; + FB1483D322CB8B9800449969 /* SwiftyUserDefaults.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */; }; + FB1483D822CBA20200449969 /* GeneralPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */; }; + FB1483D922CBA20200449969 /* GeneralPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */; }; + FB1483E022CBA82200449969 /* AdvancedPrefsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */; }; + FB1483E122CBA82200449969 /* AdvancedPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + FB1483B122CB898300449969 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB14839822CB898300449969 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB14839F22CB898300449969; + remoteInfo = EhautX; + }; + FB1483BC22CB898300449969 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FB14839822CB898300449969 /* Project object */; + proxyType = 1; + remoteGlobalIDString = FB14839F22CB898300449969; + remoteInfo = EhautX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + FB1483A022CB898300449969 /* EhautX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EhautX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483A322CB898300449969 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FB1483A522CB898300449969 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FB1483A822CB898300449969 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + FB1483AA22CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483AB22CB898300449969 /* EhautX.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = EhautX.entitlements; sourceTree = ""; }; + FB1483B022CB898300449969 /* EhautXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483B422CB898300449969 /* EhautXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXTests.swift; sourceTree = ""; }; + FB1483B622CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483BB22CB898300449969 /* EhautXUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EhautXUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + FB1483BF22CB898300449969 /* EhautXUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EhautXUITests.swift; sourceTree = ""; }; + FB1483C122CB898300449969 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FB1483CE22CB8B9800449969 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = ""; }; + FB1483CF22CB8B9800449969 /* Preferences.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Preferences.framework; path = Carthage/Build/Mac/Preferences.framework; sourceTree = ""; }; + FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyUserDefaults.framework; path = Carthage/Build/Mac/SwiftyUserDefaults.framework; sourceTree = ""; }; + FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralPrefsViewController.swift; sourceTree = ""; }; + FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GeneralPrefsViewController.xib; sourceTree = ""; }; + FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedPrefsViewController.swift; sourceTree = ""; }; + FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AdvancedPrefsViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FB14839D22CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D122CB8B9800449969 /* Alamofire.framework in Frameworks */, + FB1483D222CB8B9800449969 /* Preferences.framework in Frameworks */, + FB1483D322CB8B9800449969 /* SwiftyUserDefaults.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AD22CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B822CB898300449969 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FB14839722CB898300449969 = { + isa = PBXGroup; + children = ( + FB1483A222CB898300449969 /* EhautX */, + FB1483B322CB898300449969 /* EhautXTests */, + FB1483BE22CB898300449969 /* EhautXUITests */, + FB1483A122CB898300449969 /* Products */, + FB1483CD22CB8B9800449969 /* Frameworks */, + ); + sourceTree = ""; + }; + FB1483A122CB898300449969 /* Products */ = { + isa = PBXGroup; + children = ( + FB1483A022CB898300449969 /* EhautX.app */, + FB1483B022CB898300449969 /* EhautXTests.xctest */, + FB1483BB22CB898300449969 /* EhautXUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + FB1483A222CB898300449969 /* EhautX */ = { + isa = PBXGroup; + children = ( + FB1483D522CBA1D800449969 /* Views */, + FB1483A322CB898300449969 /* AppDelegate.swift */, + FB1483A522CB898300449969 /* Assets.xcassets */, + FB1483A722CB898300449969 /* MainMenu.xib */, + FB1483AA22CB898300449969 /* Info.plist */, + FB1483AB22CB898300449969 /* EhautX.entitlements */, + ); + path = EhautX; + sourceTree = ""; + }; + FB1483B322CB898300449969 /* EhautXTests */ = { + isa = PBXGroup; + children = ( + FB1483B422CB898300449969 /* EhautXTests.swift */, + FB1483B622CB898300449969 /* Info.plist */, + ); + path = EhautXTests; + sourceTree = ""; + }; + FB1483BE22CB898300449969 /* EhautXUITests */ = { + isa = PBXGroup; + children = ( + FB1483BF22CB898300449969 /* EhautXUITests.swift */, + FB1483C122CB898300449969 /* Info.plist */, + ); + path = EhautXUITests; + sourceTree = ""; + }; + FB1483CD22CB8B9800449969 /* Frameworks */ = { + isa = PBXGroup; + children = ( + FB1483CE22CB8B9800449969 /* Alamofire.framework */, + FB1483CF22CB8B9800449969 /* Preferences.framework */, + FB1483D022CB8B9800449969 /* SwiftyUserDefaults.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + FB1483D522CBA1D800449969 /* Views */ = { + isa = PBXGroup; + children = ( + FB1483D622CBA20200449969 /* GeneralPrefsViewController.swift */, + FB1483D722CBA20200449969 /* GeneralPrefsViewController.xib */, + FB1483DE22CBA82200449969 /* AdvancedPrefsViewController.swift */, + FB1483DF22CBA82200449969 /* AdvancedPrefsViewController.xib */, + ); + path = Views; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FB14839F22CB898300449969 /* EhautX */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483C422CB898300449969 /* Build configuration list for PBXNativeTarget "EhautX" */; + buildPhases = ( + FB14839C22CB898300449969 /* Sources */, + FB14839D22CB898300449969 /* Frameworks */, + FB14839E22CB898300449969 /* Resources */, + FB1483D422CB8BA000449969 /* Run Script */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = EhautX; + productName = EhautX; + productReference = FB1483A022CB898300449969 /* EhautX.app */; + productType = "com.apple.product-type.application"; + }; + FB1483AF22CB898300449969 /* EhautXTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483C722CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXTests" */; + buildPhases = ( + FB1483AC22CB898300449969 /* Sources */, + FB1483AD22CB898300449969 /* Frameworks */, + FB1483AE22CB898300449969 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1483B222CB898300449969 /* PBXTargetDependency */, + ); + name = EhautXTests; + productName = EhautXTests; + productReference = FB1483B022CB898300449969 /* EhautXTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + FB1483BA22CB898300449969 /* EhautXUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = FB1483CA22CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXUITests" */; + buildPhases = ( + FB1483B722CB898300449969 /* Sources */, + FB1483B822CB898300449969 /* Frameworks */, + FB1483B922CB898300449969 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + FB1483BD22CB898300449969 /* PBXTargetDependency */, + ); + name = EhautXUITests; + productName = EhautXUITests; + productReference = FB1483BB22CB898300449969 /* EhautXUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FB14839822CB898300449969 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1020; + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "Ehaut Team"; + TargetAttributes = { + FB14839F22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + }; + FB1483AF22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + TestTargetID = FB14839F22CB898300449969; + }; + FB1483BA22CB898300449969 = { + CreatedOnToolsVersion = 10.2.1; + TestTargetID = FB14839F22CB898300449969; + }; + }; + }; + buildConfigurationList = FB14839B22CB898300449969 /* Build configuration list for PBXProject "EhautX" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FB14839722CB898300449969; + productRefGroup = FB1483A122CB898300449969 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FB14839F22CB898300449969 /* EhautX */, + FB1483AF22CB898300449969 /* EhautXTests */, + FB1483BA22CB898300449969 /* EhautXUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FB14839E22CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D922CBA20200449969 /* GeneralPrefsViewController.xib in Resources */, + FB1483E122CBA82200449969 /* AdvancedPrefsViewController.xib in Resources */, + FB1483A622CB898300449969 /* Assets.xcassets in Resources */, + FB1483A922CB898300449969 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AE22CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B922CB898300449969 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + FB1483D422CB8BA000449969 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "$(SRCROOT)/input.xcfilelist", + ); + inputPaths = ( + ); + name = "Run Script"; + outputFileListPaths = ( + "$(SRCROOT)/output.xcfilelist", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FB14839C22CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483D822CBA20200449969 /* GeneralPrefsViewController.swift in Sources */, + FB1483E022CBA82200449969 /* AdvancedPrefsViewController.swift in Sources */, + FB1483A422CB898300449969 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483AC22CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483B522CB898300449969 /* EhautXTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FB1483B722CB898300449969 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FB1483C022CB898300449969 /* EhautXUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + FB1483B222CB898300449969 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB14839F22CB898300449969 /* EhautX */; + targetProxy = FB1483B122CB898300449969 /* PBXContainerItemProxy */; + }; + FB1483BD22CB898300449969 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = FB14839F22CB898300449969 /* EhautX */; + targetProxy = FB1483BC22CB898300449969 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + FB1483A722CB898300449969 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + FB1483A822CB898300449969 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FB1483C222CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FB1483C322CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "Mac Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + FB1483C522CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = EhautX; + CODE_SIGN_ENTITLEMENTS = EhautX/EhautX.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + FB1483C622CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = EhautX; + CODE_SIGN_ENTITLEMENTS = EhautX/EhautX.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); + INFOPLIST_FILE = EhautX/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautX; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + FB1483C822CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/Contents/MacOS/EhautX"; + }; + name = Debug; + }; + FB1483C922CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EhautX.app/Contents/MacOS/EhautX"; + }; + name = Release; + }; + FB1483CB22CB898300449969 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = EhautX; + }; + name = Debug; + }; + FB1483CC22CB898300449969 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = GC96FM2SBJ; + INFOPLIST_FILE = EhautXUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = cn.ehaut.EhautXUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_TARGET_NAME = EhautX; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FB14839B22CB898300449969 /* Build configuration list for PBXProject "EhautX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C222CB898300449969 /* Debug */, + FB1483C322CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483C422CB898300449969 /* Build configuration list for PBXNativeTarget "EhautX" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C522CB898300449969 /* Debug */, + FB1483C622CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483C722CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483C822CB898300449969 /* Debug */, + FB1483C922CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FB1483CA22CB898300449969 /* Build configuration list for PBXNativeTarget "EhautXUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FB1483CB22CB898300449969 /* Debug */, + FB1483CC22CB898300449969 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FB14839822CB898300449969 /* Project object */; +} diff --git a/EhautX.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/EhautX.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..35f01f6 --- /dev/null +++ b/EhautX.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/EhautX/Entitlements.plist b/EhautX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 66% rename from EhautX/Entitlements.plist rename to EhautX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist index ee95ab7..18d9810 100644 --- a/EhautX/Entitlements.plist +++ b/EhautX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -2,9 +2,7 @@ - com.apple.security.app-sandbox - - com.apple.security.network.client + IDEDidComputeMac32BitWarning diff --git a/EhautX/AppDelegate.cs b/EhautX/AppDelegate.cs deleted file mode 100644 index 8a42727..0000000 --- a/EhautX/AppDelegate.cs +++ /dev/null @@ -1,26 +0,0 @@ -using AppKit; -using EhautX.Model; -using Foundation; - -namespace EhautX -{ - [Register("AppDelegate")] - public class AppDelegate : NSApplicationDelegate - { - public AppPreferences Preferences { get; set; } = new AppPreferences(); - - public AppDelegate() - { - } - - public override void DidFinishLaunching(NSNotification notification) - { - // Insert code here to initialize your application - } - - public override void WillTerminate(NSNotification notification) - { - // Insert code here to tear down your application - } - } -} diff --git a/EhautX/AppDelegate.swift b/EhautX/AppDelegate.swift new file mode 100644 index 0000000..3311af0 --- /dev/null +++ b/EhautX/AppDelegate.swift @@ -0,0 +1,70 @@ +// +// AppDelegate.swift +// EhautX +// +// Created by 曾祥嵩 on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +extension PreferencePane.Identifier { + static let general = Identifier("general") + static let advanced = Identifier("advanced") +} + +extension DefaultsKeys { + static let server = DefaultsKey("server", defaultValue: "http://172.16.154.130:69/cgi-bin/srun_portal") + static let username = DefaultsKey("username") + static let password = DefaultsKey("password") + static let passwordKey = DefaultsKey("passwordKey", defaultValue: "1234567890") +} + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet weak var window: NSWindow! + + let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength); + + let preferencesWindowController = PreferencesWindowController( + preferencePanes: [ + GeneralPrefsViewController(), + AdvancedPrefsViewController(), + ] + ) + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + + // Show the status icon + let button = statusItem.button + button?.image = NSImage(named: "NetworkDisconnect") + + // Build statusbar menu + let menu = NSMenu() + menu.addItem(NSMenuItem( + title: "About", + action: #selector(NSApplication.shared.orderFrontStandardAboutPanel(options:)), + keyEquivalent: "" + )) + menu.addItem(NSMenuItem.separator()) + menu.addItem(NSMenuItem( + title: "Preferences…", + action: #selector(self.preferencesMenuItemActionHandler(_:)), + keyEquivalent: "," + )) + + statusItem.menu = menu + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + @IBAction func preferencesMenuItemActionHandler(_ sender: NSMenuItem) { + preferencesWindowController.show() + } +} diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png deleted file mode 100644 index d0b5a80..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png deleted file mode 100644 index f4c8d29..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png deleted file mode 100644 index ebb5a0f..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png deleted file mode 100644 index 0986d31..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png deleted file mode 100644 index f4c8d29..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png deleted file mode 100644 index a142c83..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png deleted file mode 100644 index 0986d31..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png deleted file mode 100644 index 412d6ca..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png deleted file mode 100644 index a142c83..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png deleted file mode 100644 index e99022a..0000000 Binary files a/EhautX/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and /dev/null differ diff --git a/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json b/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 6b28545..0000000 --- a/EhautX/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images": [ - { - "filename": "AppIcon-16.png", - "size": "16x16", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-16@2x.png", - "size": "16x16", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-32.png", - "size": "32x32", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-32@2x.png", - "size": "32x32", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-128.png", - "size": "128x128", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-128@2x.png", - "size": "128x128", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-256.png", - "size": "256x256", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-256@2x.png", - "size": "256x256", - "scale": "2x", - "idiom": "mac" - }, - { - "filename": "AppIcon-512.png", - "size": "512x512", - "scale": "1x", - "idiom": "mac" - }, - { - "filename": "AppIcon-512@2x.png", - "size": "512x512", - "scale": "2x", - "idiom": "mac" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} \ No newline at end of file diff --git a/EhautX/Assets.xcassets/Contents.json b/EhautX/Assets.xcassets/Contents.json index 4caf392..da4a164 100644 --- a/EhautX/Assets.xcassets/Contents.json +++ b/EhautX/Assets.xcassets/Contents.json @@ -1,4 +1,4 @@ -{ +{ "info" : { "version" : 1, "author" : "xcode" diff --git a/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json b/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/EhautX/Assets.xcassets/EhautX.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json b/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json new file mode 100644 index 0000000..175894d --- /dev/null +++ b/EhautX/Assets.xcassets/NetworkConnect.imageset/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "1x", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ] + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@dark@2x.png", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkConnect@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png new file mode 100644 index 0000000..f2d4c54 Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@2x.png differ diff --git a/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png new file mode 100644 index 0000000..e4708d0 Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@3x.png differ diff --git a/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png new file mode 100644 index 0000000..474b93e Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkConnect.imageset/NetworkConnect@dark@2x.png differ diff --git a/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json new file mode 100644 index 0000000..2539480 --- /dev/null +++ b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/Contents.json @@ -0,0 +1,43 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "1x", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ] + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@dark@2x.png", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "NetworkDisconnect@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png new file mode 100644 index 0000000..c702f16 Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@2x.png differ diff --git a/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png new file mode 100644 index 0000000..552cb74 Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@3x.png differ diff --git a/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png new file mode 100644 index 0000000..84765fe Binary files /dev/null and b/EhautX/Assets.xcassets/NetworkDisconnect.imageset/NetworkDisconnect@dark@2x.png differ diff --git a/EhautX/Base.lproj/MainMenu.xib b/EhautX/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..b3545e0 --- /dev/null +++ b/EhautX/Base.lproj/MainMenu.xib @@ -0,0 +1,699 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX/EhautX.csproj b/EhautX/EhautX.csproj deleted file mode 100644 index 4b7a4a9..0000000 --- a/EhautX/EhautX.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - {75BF3CFF-AC12-49FA-88A7-AFD4889FA758} - {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - EhautX - EhautX - v2.0 - Xamarin.Mac - Resources - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - Mac Developer - false - false - false - true - true - - - pdbonly - true - bin\Release - prompt - 4 - false - true - false - true - true - true - SdkOnly - - - - - - - ..\packages\RestSharp.106.6.9\lib\netstandard2.0\RestSharp.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ViewController.cs - - - - - GeneralPrefsController.cs - - - - NetworkPrefsController.cs - - - - AdvancedPrefsController.cs - - - - - - - - \ No newline at end of file diff --git a/EhautX/EhautX.entitlements b/EhautX/EhautX.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/EhautX/EhautX.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/EhautX/Info.plist b/EhautX/Info.plist index 79b0531..86db7eb 100644 --- a/EhautX/Info.plist +++ b/EhautX/Info.plist @@ -2,33 +2,35 @@ - CFBundleName - EhautX - CFBundleIdentifier - com.zengxs.EhautX - CFBundleVersion - 1 - LSMinimumSystemVersion - 10.12 CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType APPL - CFBundleSignature - ???? - NSHumanReadableCopyright - ${AuthorCopyright:HtmlEncode} - NSPrincipalClass - NSApplication - NSMainStoryboardFile - Main - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset CFBundleShortVersionString - 0.2.1 + 1.0 + CFBundleVersion + 1 LSApplicationCategoryType public.app-category.utilities + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + LSUIElement + + NSHumanReadableCopyright + Copyright © 2019 Ehaut Team. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication diff --git a/EhautX/Main.cs b/EhautX/Main.cs deleted file mode 100644 index 244b781..0000000 --- a/EhautX/Main.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AppKit; - -namespace EhautX -{ - static class MainClass - { - static void Main(string[] args) - { - NSApplication.Init(); - NSApplication.Main(args); - } - } -} diff --git a/EhautX/Main.storyboard b/EhautX/Main.storyboard deleted file mode 100644 index b4cbb5c..0000000 --- a/EhautX/Main.storyboard +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSAllRomanInputSourcesLocaleIdentifier - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/EhautX/Model/AppPreferences.cs b/EhautX/Model/AppPreferences.cs deleted file mode 100644 index cf63b89..0000000 --- a/EhautX/Model/AppPreferences.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using Foundation; - -namespace EhautX.Model -{ - [Register("AppPreferences")] - public class AppPreferences : NSObject - { - #region Computed Properties - [Export("ServerURL")] - public string ServerURL - { - get => LoadUrl("ServerURL", "http://172.16.154.130:69/cgi-bin/srun_portal"); - set => SaveUrl("ServerURL", value, true); - } - - [Export("ACID")] - public string ACID - { - get => LoadString("ACID", "1"); - set => SaveString("ACID", value, true); - } - - [Export("Username")] - public string Username - { - get => LoadString("Username", ""); - set => SaveString("Username", value, true); - } - - [Export("Password")] - public string Password - { - get => LoadString("Password", ""); - set => SaveString("Password", value, true); - } - - [Export("PasswordKey")] - public string PasswordKey - { - get => LoadString("PasswordKey", "1234567890"); - set => SaveString("PasswordKey", value, true); - } - - [Export("Timeout")] - public int Timeout - { - get => LoadInt("Timeout", 3); - set => SaveInt("Timeout", value, true); - } - - [Export("Type")] - public string Type - { - get => LoadString("Type", "10"); - set => SaveString("Type", value, true); - } - - [Export("N")] - public string N - { - get => LoadString("N", "117"); - set => SaveString("N", value, true); - } - - [Export("Drop")] - public string Drop - { - get => LoadString("Drop", "0"); - set => SaveString("Drop", value, true); - } - - [Export("Pop")] - public string Pop - { - get => LoadString("Pop", "1"); - set => SaveString("Pop", value, true); - } - - [Export("MBytes")] - public string MBytes - { - get => LoadString("MBytes", "0"); - set => SaveString("MBytes", value, true); - } - - [Export("Minutes")] - public string Minutes - { - get => LoadString("Minutes", "0"); - set => SaveString("Minutes", value, true); - } - #endregion - - private bool ExistKey(string key) - { - var dict = NSUserDefaults.StandardUserDefaults.ToDictionary(); - return dict.ContainsKey(new NSString(key)); - } - - #region Load & Save preference - private int LoadInt(string key, int defaultValue) - { - if (!ExistKey(key)) return defaultValue; - return (int)NSUserDefaults.StandardUserDefaults.IntForKey(key); - } - - private void SaveInt(string key, int value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetInt(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private bool LoadBool(string key, bool defaultValue) - { - if (!ExistKey(key)) return defaultValue; - return NSUserDefaults.StandardUserDefaults.BoolForKey(key); - } - - private void SaveBool(string key, bool value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetBool(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private string LoadUrl(string key, string defaultUrl) - { - NSUrl url = NSUserDefaults.StandardUserDefaults.URLForKey(key); - if (!ExistKey(key) || url == null) return defaultUrl; - return url.ToString(); - } - - private void SaveUrl(string key, string urlString, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetURL(new NSUrl(urlString), key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - - private string LoadString(string key, string defaultString) - { - if (!ExistKey(key)) return defaultString; - return NSUserDefaults.StandardUserDefaults.StringForKey(key); - } - - private void SaveString(string key, string value, bool sync) - { - NSUserDefaults.StandardUserDefaults.SetString(value, key); - if (sync) NSUserDefaults.StandardUserDefaults.Synchronize(); - } - #endregion - } -} diff --git a/EhautX/Resources/.gitkeep b/EhautX/Resources/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/EhautX/Service/Crypto.cs b/EhautX/Service/Crypto.cs deleted file mode 100644 index b6c3318..0000000 --- a/EhautX/Service/Crypto.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text; - -namespace EhautX.Service -{ - public static class Crypto - { - public static string UsernameEncrypt(string username) - { - var sb = new StringBuilder(); - sb.Append("{SRUN3}\r\n"); - - for (int i = 0; i < username.Length; ++i) - sb.Append((char)(username[i] + 4)); - - return sb.ToString(); - } - - public static string PasswordEncrypt(string password, string passwordKey) - { - var sb = new StringBuilder(); - - for (int i = 0; i < password.Length; ++i) - { - char ki = (char)(password[i] ^ passwordKey[passwordKey.Length - i % passwordKey.Length - 1]); - char _l = (char)((ki & 0x0f) + 0x36); - char _h = (char)((ki >> 4 & 0x0f) + 0x63); - if (i % 2 == 0) - sb.Append($"{_l}{_h}"); - else - sb.Append($"{_h}{_l}"); - } - - return sb.ToString(); - } - } -} diff --git a/EhautX/Service/Notify.cs b/EhautX/Service/Notify.cs deleted file mode 100644 index dd03203..0000000 --- a/EhautX/Service/Notify.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Foundation; - -namespace EhautX.Service -{ - public static class Notify - { - public static void Send(string title, string content) - { - var notification = new NSUserNotification(); - notification.Title = title; - notification.InformativeText = content; - NSUserNotificationCenter.DefaultUserNotificationCenter.ShouldPresentNotification = (center, notify) => true; - NSUserNotificationCenter.DefaultUserNotificationCenter.ScheduleNotification(notification); - } - } -} diff --git a/EhautX/View/AdvancedPrefsController.cs b/EhautX/View/AdvancedPrefsController.cs deleted file mode 100644 index 53943a6..0000000 --- a/EhautX/View/AdvancedPrefsController.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; - -using Foundation; -using AppKit; -using EhautX.Model; - -namespace EhautX.View -{ - public partial class AdvancedPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public AdvancedPrefsController(IntPtr handle) : base(handle) - { - } - } -} diff --git a/EhautX/View/AdvancedPrefsController.designer.cs b/EhautX/View/AdvancedPrefsController.designer.cs deleted file mode 100644 index de14095..0000000 --- a/EhautX/View/AdvancedPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("AdvancedPrefsController")] - partial class AdvancedPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/GeneralPrefsController.cs b/EhautX/View/GeneralPrefsController.cs deleted file mode 100644 index a0d9ace..0000000 --- a/EhautX/View/GeneralPrefsController.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; - -using Foundation; -using AppKit; -using EhautX.Model; - -namespace EhautX.View -{ - public partial class GeneralPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public GeneralPrefsController(IntPtr handle) : base(handle) - { - } - } -} diff --git a/EhautX/View/GeneralPrefsController.designer.cs b/EhautX/View/GeneralPrefsController.designer.cs deleted file mode 100644 index 4aecd0e..0000000 --- a/EhautX/View/GeneralPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("GeneralPrefsController")] - partial class GeneralPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/NetworkPrefsController.cs b/EhautX/View/NetworkPrefsController.cs deleted file mode 100644 index a1d7510..0000000 --- a/EhautX/View/NetworkPrefsController.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been autogenerated from a class added in the UI designer. - -using System; -using AppKit; -using EhautX.Model; -using Foundation; - -namespace EhautX.View -{ - public partial class NetworkPrefsController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - public NetworkPrefsController (IntPtr handle) : base (handle) - { - } - } -} diff --git a/EhautX/View/NetworkPrefsController.designer.cs b/EhautX/View/NetworkPrefsController.designer.cs deleted file mode 100644 index dcc6e71..0000000 --- a/EhautX/View/NetworkPrefsController.designer.cs +++ /dev/null @@ -1,20 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("NetworkPrefsController")] - partial class NetworkPrefsController - { - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/View/ViewController.cs b/EhautX/View/ViewController.cs deleted file mode 100644 index 89f8c2c..0000000 --- a/EhautX/View/ViewController.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; - -using AppKit; -using CoreFoundation; -using EhautX.Model; -using EhautX.Service; -using Foundation; - -namespace EhautX.View -{ - public partial class ViewController : NSViewController - { - public static AppDelegate App => (AppDelegate)NSApplication.SharedApplication.Delegate; - - [Export("Preferences")] - public AppPreferences Preferences => App.Preferences; - - #region Consturctors - public ViewController(IntPtr handle) : base(handle) - { - } - #endregion - - #region Override Methods - public override void ViewDidLoad() - { - base.ViewDidLoad(); - - // Do any additional setup after loading the view. - } - - public override NSObject RepresentedObject - { - get - { - return base.RepresentedObject; - } - set - { - base.RepresentedObject = value; - // Update the view, if already loaded. - } - } - #endregion - - #region Button clicked action - partial void loginButton(NSObject sender) - { - DispatchQueue.MainQueue.DispatchAsync(() => - { - var username = Crypto.UsernameEncrypt(Preferences.Username); - var password = Crypto.PasswordEncrypt(Preferences.Password, Preferences.PasswordKey); - - var client = new RestSharp.RestClient(); - var request = new RestSharp.RestRequest(Preferences.ServerURL, RestSharp.Method.POST); - request.AddParameter("action", "login"); - request.AddParameter("username", username); - request.AddParameter("password", password); - request.AddParameter("drop", Preferences.Drop); - request.AddParameter("pop", Preferences.Pop); - request.AddParameter("type", Preferences.Type); - request.AddParameter("n", Preferences.N); - request.AddParameter("mbytes", Preferences.MBytes); - request.AddParameter("ac_id", Preferences.ACID); - request.AddParameter("mac", "02:00:00:00:00:00"); - request.Timeout = Preferences.Timeout * 1000; - - var response = client.Execute(request); - switch (response.ResponseStatus) - { - case RestSharp.ResponseStatus.TimedOut: - Notify.Send("连接错误", "连接超时"); - break; - case RestSharp.ResponseStatus.Error: - Notify.Send("连接错误", "连接错误"); - break; - default: - Notify.Send("登录状态", response.Content); - break; - } - }); - } - - partial void logoutButton(NSObject sender) - { - DispatchQueue.MainQueue.DispatchAsync(() => - { - var username = Crypto.UsernameEncrypt(Preferences.Username); - - var client = new RestSharp.RestClient(); - var request = new RestSharp.RestRequest(Preferences.ServerURL, RestSharp.Method.POST); - request.AddParameter("action", "logout"); - request.AddParameter("username", username); - request.AddParameter("type", Preferences.Type); - request.AddParameter("ac_id", Preferences.ACID); - request.AddParameter("mac", "02:00:00:00:00:00"); - request.Timeout = Preferences.Timeout * 1000; - - var response = client.Execute(request); - - switch (response.ResponseStatus) - { - case RestSharp.ResponseStatus.TimedOut: - Notify.Send("连接错误", "连接超时"); - break; - case RestSharp.ResponseStatus.Error: - Notify.Send("连接错误", "连接错误"); - break; - default: - Notify.Send("登出状态", response.Content); - break; - } - }); - } - #endregion - } -} diff --git a/EhautX/View/ViewController.designer.cs b/EhautX/View/ViewController.designer.cs deleted file mode 100644 index 3fd1daf..0000000 --- a/EhautX/View/ViewController.designer.cs +++ /dev/null @@ -1,25 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace EhautX.View -{ - [Register ("ViewController")] - partial class ViewController - { - [Action ("loginButton:")] - partial void loginButton (Foundation.NSObject sender); - - [Action ("logoutButton:")] - partial void logoutButton (Foundation.NSObject sender); - - void ReleaseDesignerOutlets () - { - } - } -} diff --git a/EhautX/Views/AdvancedPrefsViewController.swift b/EhautX/Views/AdvancedPrefsViewController.swift new file mode 100644 index 0000000..6a4a249 --- /dev/null +++ b/EhautX/Views/AdvancedPrefsViewController.swift @@ -0,0 +1,33 @@ +// +// AdvancedPrefsViewController.swift +// EhautX +// +// Created by 曾祥嵩 on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +class AdvancedPrefsViewController: NSViewController, PreferencePane { + let preferencePaneIdentifier = PreferencePane.Identifier.advanced + let preferencePaneTitle = "Advanced" + let toolbarItemIcon = NSImage(named: NSImage.advancedName)! + + @objc dynamic var server: String { + get { return Defaults[.server] } + set { Defaults[.server] = newValue } + } + + @objc dynamic var passwordKey: String { + get { return Defaults[.passwordKey] } + set { Defaults[.passwordKey] = newValue } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do view setup here. + } + +} diff --git a/EhautX/Views/AdvancedPrefsViewController.xib b/EhautX/Views/AdvancedPrefsViewController.xib new file mode 100644 index 0000000..e360abc --- /dev/null +++ b/EhautX/Views/AdvancedPrefsViewController.xib @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX/Views/GeneralPrefsViewController.swift b/EhautX/Views/GeneralPrefsViewController.swift new file mode 100644 index 0000000..c1b9966 --- /dev/null +++ b/EhautX/Views/GeneralPrefsViewController.swift @@ -0,0 +1,33 @@ +// +// GeneralPrefsViewController.swift +// EhautX +// +// Created by 曾祥嵩 on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import Cocoa +import Preferences +import SwiftyUserDefaults + +class GeneralPrefsViewController: NSViewController, PreferencePane { + let preferencePaneIdentifier = PreferencePane.Identifier.general + let preferencePaneTitle = "General" + let toolbarItemIcon = NSImage(named: NSImage.preferencesGeneralName)! + + @objc dynamic var username: String? { + get { return Defaults[.username] } + set { Defaults[.username] = newValue } + } + + @objc dynamic var password: String? { + get { return Defaults[.password] } + set { Defaults[.password] = newValue } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do view setup here. + } + +} diff --git a/EhautX/Views/GeneralPrefsViewController.xib b/EhautX/Views/GeneralPrefsViewController.xib new file mode 100644 index 0000000..c2ff386 --- /dev/null +++ b/EhautX/Views/GeneralPrefsViewController.xib @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EhautX/packages.config b/EhautX/packages.config deleted file mode 100644 index e61aa0f..0000000 --- a/EhautX/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/EhautXTests/EhautXTests.swift b/EhautXTests/EhautXTests.swift new file mode 100644 index 0000000..d074315 --- /dev/null +++ b/EhautXTests/EhautXTests.swift @@ -0,0 +1,34 @@ +// +// EhautXTests.swift +// EhautXTests +// +// Created by 曾祥嵩 on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import XCTest +@testable import EhautX + +class EhautXTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/EhautXTests/Info.plist b/EhautXTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautXTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/EhautXUITests/EhautXUITests.swift b/EhautXUITests/EhautXUITests.swift new file mode 100644 index 0000000..1562644 --- /dev/null +++ b/EhautXUITests/EhautXUITests.swift @@ -0,0 +1,34 @@ +// +// EhautXUITests.swift +// EhautXUITests +// +// Created by 曾祥嵩 on 2019/7/2. +// Copyright © 2019 Ehaut Team. All rights reserved. +// + +import XCTest + +class EhautXUITests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/EhautXUITests/Info.plist b/EhautXUITests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/EhautXUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/input.xcfilelist b/input.xcfilelist new file mode 100644 index 0000000..c8aac9f --- /dev/null +++ b/input.xcfilelist @@ -0,0 +1,3 @@ +$(SRCROOT)/Carthage/Build/Mac/Alamofire.framework +$(SRCROOT)/Carthage/Build/Mac/Preferences.framework +$(SRCROOT)/Carthage/Build/Mac/SwiftyUserDefaults.framework diff --git a/output.xcfilelist b/output.xcfilelist new file mode 100644 index 0000000..e24d020 --- /dev/null +++ b/output.xcfilelist @@ -0,0 +1,3 @@ +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Alamofire.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Preferences.framework +$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftyUserDefaults.framework