Compare commits
5 commits
df1c09d9c4
...
28115f4a59
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28115f4a59 | ||
|
|
b7fb754e09 | ||
|
|
8a70403d59 | ||
|
|
f09aead8af | ||
|
|
7bc7a53442 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*.xcuserdatad/
|
||||||
349
BrewBar.xcodeproj/project.pbxproj
Normal file
349
BrewBar.xcodeproj/project.pbxproj
Normal file
|
|
@ -0,0 +1,349 @@
|
||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 77;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
87F2AA622FEE797F0014F9D6 /* BrewBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BrewBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
||||||
|
87F2AA712FEE7A680014F9D6 /* Exceptions for "BrewBar" folder in "BrewBar" target */ = {
|
||||||
|
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
|
||||||
|
membershipExceptions = (
|
||||||
|
Info.plist,
|
||||||
|
);
|
||||||
|
target = 87F2AA612FEE797F0014F9D6 /* BrewBar */;
|
||||||
|
};
|
||||||
|
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
||||||
|
|
||||||
|
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||||
|
87F2AA642FEE797F0014F9D6 /* BrewBar */ = {
|
||||||
|
isa = PBXFileSystemSynchronizedRootGroup;
|
||||||
|
exceptions = (
|
||||||
|
87F2AA712FEE7A680014F9D6 /* Exceptions for "BrewBar" folder in "BrewBar" target */,
|
||||||
|
);
|
||||||
|
path = BrewBar;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXFileSystemSynchronizedRootGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
87F2AA5F2FEE797F0014F9D6 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
87F2AA592FEE797F0014F9D6 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
87F2AA642FEE797F0014F9D6 /* BrewBar */,
|
||||||
|
87F2AA632FEE797F0014F9D6 /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
87F2AA632FEE797F0014F9D6 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
87F2AA622FEE797F0014F9D6 /* BrewBar.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
87F2AA612FEE797F0014F9D6 /* BrewBar */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 87F2AA6D2FEE79800014F9D6 /* Build configuration list for PBXNativeTarget "BrewBar" */;
|
||||||
|
buildPhases = (
|
||||||
|
87F2AA5E2FEE797F0014F9D6 /* Sources */,
|
||||||
|
87F2AA5F2FEE797F0014F9D6 /* Frameworks */,
|
||||||
|
87F2AA602FEE797F0014F9D6 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
fileSystemSynchronizedGroups = (
|
||||||
|
87F2AA642FEE797F0014F9D6 /* BrewBar */,
|
||||||
|
);
|
||||||
|
name = BrewBar;
|
||||||
|
packageProductDependencies = (
|
||||||
|
);
|
||||||
|
productName = BrewBar;
|
||||||
|
productReference = 87F2AA622FEE797F0014F9D6 /* BrewBar.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
87F2AA5A2FEE797F0014F9D6 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = 1;
|
||||||
|
LastSwiftUpdateCheck = 2630;
|
||||||
|
LastUpgradeCheck = 2630;
|
||||||
|
TargetAttributes = {
|
||||||
|
87F2AA612FEE797F0014F9D6 = {
|
||||||
|
CreatedOnToolsVersion = 26.3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 87F2AA5D2FEE797F0014F9D6 /* Build configuration list for PBXProject "BrewBar" */;
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 87F2AA592FEE797F0014F9D6;
|
||||||
|
minimizedProjectReferenceProxies = 1;
|
||||||
|
preferredProjectObjectVersion = 77;
|
||||||
|
productRefGroup = 87F2AA632FEE797F0014F9D6 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
87F2AA612FEE797F0014F9D6 /* BrewBar */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
87F2AA602FEE797F0014F9D6 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
87F2AA5E2FEE797F0014F9D6 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
87F2AA6B2FEE79800014F9D6 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||||
|
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
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;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||||
|
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;
|
||||||
|
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 15.6;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
87F2AA6C2FEE79800014F9D6 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||||
|
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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
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;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||||
|
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;
|
||||||
|
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 15.6;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
87F2AA6E2FEE79800014F9D6 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
ENABLE_APP_SANDBOX = NO;
|
||||||
|
ENABLE_PREVIEWS = YES;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = BrewBar/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = BrewBar;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
|
INFOPLIST_KEY_NSPrincipalClass = BrewBar.AppDelegate;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.MaxSoch.BrewBar;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
REGISTER_APP_GROUPS = YES;
|
||||||
|
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||||
|
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||||
|
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||||
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
87F2AA6F2FEE79800014F9D6 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
ENABLE_APP_SANDBOX = NO;
|
||||||
|
ENABLE_PREVIEWS = YES;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = BrewBar/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = BrewBar;
|
||||||
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
|
||||||
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
|
INFOPLIST_KEY_NSPrincipalClass = BrewBar.AppDelegate;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.MaxSoch.BrewBar;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
REGISTER_APP_GROUPS = YES;
|
||||||
|
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||||
|
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||||
|
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||||
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
87F2AA5D2FEE797F0014F9D6 /* Build configuration list for PBXProject "BrewBar" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
87F2AA6B2FEE79800014F9D6 /* Debug */,
|
||||||
|
87F2AA6C2FEE79800014F9D6 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
87F2AA6D2FEE79800014F9D6 /* Build configuration list for PBXNativeTarget "BrewBar" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
87F2AA6E2FEE79800014F9D6 /* Debug */,
|
||||||
|
87F2AA6F2FEE79800014F9D6 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 87F2AA5A2FEE797F0014F9D6 /* Project object */;
|
||||||
|
}
|
||||||
7
BrewBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
BrewBar.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>BrewBar.xcscheme_^#shared#^_</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
11
BrewBar/Assets.xcassets/AccentColor.colorset/Contents.json
Normal file
11
BrewBar/Assets.xcassets/AccentColor.colorset/Contents.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
59
BrewBar/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
59
BrewBar/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "16x16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "16x16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "32x32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "32x32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "128x128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "128x128"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "256x256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "256x256"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "1x",
|
||||||
|
"size" : "512x512"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "GPT_image-2026-06-30-16-40-01-removebg-preview.png",
|
||||||
|
"idiom" : "mac",
|
||||||
|
"scale" : "2x",
|
||||||
|
"size" : "512x512"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 654 KiB |
6
BrewBar/Assets.xcassets/Contents.json
Normal file
6
BrewBar/Assets.xcassets/Contents.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
21
BrewBar/Assets.xcassets/brewbar-outdated.imageset/Contents.json
vendored
Normal file
21
BrewBar/Assets.xcassets/brewbar-outdated.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "outdated-removebg-preview.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
BrewBar/Assets.xcassets/brewbar-outdated.imageset/outdated-removebg-preview.png
vendored
Normal file
BIN
BrewBar/Assets.xcassets/brewbar-outdated.imageset/outdated-removebg-preview.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
21
BrewBar/Assets.xcassets/brewbar-updating.imageset/Contents.json
vendored
Normal file
21
BrewBar/Assets.xcassets/brewbar-updating.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "updating-removebg-preview.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
BrewBar/Assets.xcassets/brewbar-updating.imageset/updating-removebg-preview.png
vendored
Normal file
BIN
BrewBar/Assets.xcassets/brewbar-updating.imageset/updating-removebg-preview.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
21
BrewBar/Assets.xcassets/brewbar-uptodate.imageset/Contents.json
vendored
Normal file
21
BrewBar/Assets.xcassets/brewbar-uptodate.imageset/Contents.json
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "test_-removebg-preview.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
BrewBar/Assets.xcassets/brewbar-uptodate.imageset/test_-removebg-preview.png
vendored
Normal file
BIN
BrewBar/Assets.xcassets/brewbar-uptodate.imageset/test_-removebg-preview.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
343
BrewBar/BrewBarApp.swift
Normal file
343
BrewBar/BrewBarApp.swift
Normal file
|
|
@ -0,0 +1,343 @@
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
@main
|
||||||
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
|
||||||
|
static func main() {
|
||||||
|
let app = NSApplication.shared
|
||||||
|
let delegate = AppDelegate()
|
||||||
|
app.delegate = delegate
|
||||||
|
app.setActivationPolicy(.accessory)
|
||||||
|
app.run()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Varaibles
|
||||||
|
|
||||||
|
var statusItem: NSStatusItem!
|
||||||
|
var statusMenuItem: NSMenuItem!
|
||||||
|
var outdatedSubmenu: NSMenu!
|
||||||
|
var versionItem: NSMenuItem!
|
||||||
|
|
||||||
|
var logWindow: LogWindowController?
|
||||||
|
var logBuffer: String = ""
|
||||||
|
|
||||||
|
var brewPath: String?
|
||||||
|
|
||||||
|
var refreshTimer: Timer?
|
||||||
|
//var refreshInterval: TimeInterval = 3600
|
||||||
|
var refreshInterval: TimeInterval {
|
||||||
|
get {
|
||||||
|
let saved = UserDefaults.standard.double(forKey: "refreshInterval")
|
||||||
|
return saved > 0 ? saved : 3600 // fallback 1h si jamais défini
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
UserDefaults.standard.set(newValue, forKey: "refreshInterval")
|
||||||
|
UserDefaults.standard.synchronize()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ cache to prevent duplicate outdated calls
|
||||||
|
var cachedOutdated: [String] = []
|
||||||
|
var lastOutdatedFetch: Date?
|
||||||
|
|
||||||
|
// MARK: - Menu
|
||||||
|
|
||||||
|
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||||
|
|
||||||
|
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||||
|
setMenuBarIcon("brewbar-uptodate")
|
||||||
|
|
||||||
|
let menu = NSMenu()
|
||||||
|
|
||||||
|
statusMenuItem = NSMenuItem(title: "Checking...", action: nil, keyEquivalent: "")
|
||||||
|
menu.addItem(statusMenuItem)
|
||||||
|
|
||||||
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
|
||||||
|
menu.addItem(NSMenuItem(title: "🔄 Refresh", action: #selector(refreshAction), keyEquivalent: "r"))
|
||||||
|
menu.addItem(NSMenuItem(title: "📦 Upgrade All", action: #selector(upgradeAll), keyEquivalent: "u"))
|
||||||
|
let outdatedItem = NSMenuItem(title: "📋 Outdated", action: nil, keyEquivalent: "")
|
||||||
|
outdatedSubmenu = NSMenu()
|
||||||
|
outdatedSubmenu.addItem(NSMenuItem(title: "Refresh List", action: #selector(forceRefreshOutdated), keyEquivalent: ""))
|
||||||
|
outdatedItem.submenu = outdatedSubmenu
|
||||||
|
menu.addItem(outdatedItem)
|
||||||
|
menu.addItem(NSMenuItem(title: "📜 Logs", action: #selector(showLogs), keyEquivalent: "l"))
|
||||||
|
|
||||||
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let intervalItem = NSMenuItem(title: "⏱ Refresh Interval", action: nil, keyEquivalent: "")
|
||||||
|
let intervalSubmenu = NSMenu()
|
||||||
|
|
||||||
|
let options: [(String, TimeInterval)] = [
|
||||||
|
("1 heure", 3600),
|
||||||
|
("6 heures", 21600),
|
||||||
|
]
|
||||||
|
|
||||||
|
for (label, interval) in options {
|
||||||
|
let item = NSMenuItem(title: label, action: #selector(setRefreshInterval(_:)), keyEquivalent: "")
|
||||||
|
item.representedObject = interval
|
||||||
|
intervalSubmenu.addItem(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
let customMenuItem = NSMenuItem()
|
||||||
|
let customView = NSView(frame: NSRect(x: 0, y: 0, width: 200, height: 30))
|
||||||
|
|
||||||
|
let textField = NSTextField(frame: NSRect(x: 10, y: 4, width: 120, height: 22))
|
||||||
|
textField.placeholderString = "Secondes..."
|
||||||
|
textField.stringValue = "\(Int(refreshInterval))"
|
||||||
|
|
||||||
|
let confirmButton = NSButton(frame: NSRect(x: 138, y: 4, width: 52, height: 22))
|
||||||
|
confirmButton.title = "✓ Set"
|
||||||
|
confirmButton.bezelStyle = .rounded
|
||||||
|
confirmButton.target = self
|
||||||
|
confirmButton.action = #selector(applyCustomInterval(_:))
|
||||||
|
|
||||||
|
customView.addSubview(textField)
|
||||||
|
customView.addSubview(confirmButton)
|
||||||
|
customMenuItem.view = customView
|
||||||
|
intervalSubmenu.addItem(customMenuItem)
|
||||||
|
|
||||||
|
intervalItem.submenu = intervalSubmenu
|
||||||
|
menu.addItem(intervalItem)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
versionItem = NSMenuItem(title: "🏷 Brew: ...", action: nil, keyEquivalent: "")
|
||||||
|
menu.addItem(versionItem)
|
||||||
|
|
||||||
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
|
||||||
|
menu.addItem(NSMenuItem(title: "Quit", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q"))
|
||||||
|
|
||||||
|
statusItem.menu = menu
|
||||||
|
|
||||||
|
refreshAll()
|
||||||
|
refreshBrewVersion()
|
||||||
|
|
||||||
|
refreshTimer = Timer.scheduledTimer(withTimeInterval: refreshInterval, repeats: true) { _ in
|
||||||
|
self.refreshAll()
|
||||||
|
} // pour arrêter : refreshTimer?.invalidate()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Env func
|
||||||
|
|
||||||
|
func setMenuBarIcon(_ name: String) {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
if let button = self.statusItem.button {
|
||||||
|
if let icon = NSImage(named: name) {
|
||||||
|
icon.size = NSSize(width: 22, height: 22)
|
||||||
|
icon.isTemplate = true
|
||||||
|
button.image = icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func restartTimer() {
|
||||||
|
refreshTimer?.invalidate() // stop running timer
|
||||||
|
refreshTimer = Timer.scheduledTimer(withTimeInterval: refreshInterval, repeats: true) { _ in
|
||||||
|
self.refreshAll()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func setRefreshInterval(_ sender: NSMenuItem) {
|
||||||
|
guard let interval = sender.representedObject as? TimeInterval else { return }
|
||||||
|
refreshInterval = interval // ← le set sauvegarde dans UserDefaults
|
||||||
|
restartTimer()
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func applyCustomInterval(_ sender: NSButton) {
|
||||||
|
guard let view = sender.superview,
|
||||||
|
let textField = view.subviews.first(where: { $0 is NSTextField }) as? NSTextField,
|
||||||
|
let seconds = Int(textField.stringValue), seconds > 0 else { return }
|
||||||
|
|
||||||
|
refreshInterval = TimeInterval(seconds)
|
||||||
|
restartTimer()
|
||||||
|
statusItem.menu?.cancelTracking()
|
||||||
|
}
|
||||||
|
|
||||||
|
func resolveBrewPath() -> String {
|
||||||
|
if let cached = brewPath {
|
||||||
|
return cached
|
||||||
|
}
|
||||||
|
|
||||||
|
let paths = [
|
||||||
|
"/opt/homebrew/bin/brew",
|
||||||
|
"/usr/local/bin/brew"
|
||||||
|
]
|
||||||
|
|
||||||
|
for path in paths {
|
||||||
|
if FileManager.default.isExecutableFile(atPath: path) {
|
||||||
|
brewPath = path
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//fallback
|
||||||
|
brewPath = "brew"
|
||||||
|
return "brew"
|
||||||
|
}
|
||||||
|
|
||||||
|
func runBrew(_ command: String, completion: @escaping (String) -> Void = { _ in }) {
|
||||||
|
|
||||||
|
DispatchQueue.global().async {
|
||||||
|
|
||||||
|
let brew = self.resolveBrewPath()
|
||||||
|
let cleaned = command.replacingOccurrences(of: "brew ", with: "")
|
||||||
|
let fullCommand = "\(brew) \(cleaned)"
|
||||||
|
|
||||||
|
self.log("→ \(fullCommand)\n")
|
||||||
|
|
||||||
|
let process = Process()
|
||||||
|
process.executableURL = URL(fileURLWithPath: "/bin/zsh")
|
||||||
|
process.arguments = ["-c", fullCommand]
|
||||||
|
|
||||||
|
let pipe = Pipe()
|
||||||
|
process.standardOutput = pipe
|
||||||
|
process.standardError = pipe
|
||||||
|
|
||||||
|
do {
|
||||||
|
try process.run()
|
||||||
|
} catch {
|
||||||
|
self.log("ERROR: \(error)\n")
|
||||||
|
completion("")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = pipe.fileHandleForReading.readDataToEndOfFile()
|
||||||
|
process.waitUntilExit()
|
||||||
|
|
||||||
|
let output = String(data: data, encoding: .utf8) ?? ""
|
||||||
|
|
||||||
|
self.log(output)
|
||||||
|
completion(output)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Actions
|
||||||
|
|
||||||
|
@objc func refreshAction() {
|
||||||
|
refreshAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func upgradeAll() {
|
||||||
|
statusMenuItem.title = "Upgrading..."
|
||||||
|
|
||||||
|
runBrew("update") { _ in
|
||||||
|
self.runBrew("upgrade") { _ in
|
||||||
|
self.fetchOutdated()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ SMART refresh (uses cache)
|
||||||
|
@objc func refreshOutdatedList() {
|
||||||
|
|
||||||
|
// if fetched in last 5s → uses cache
|
||||||
|
if let last = lastOutdatedFetch, Date().timeIntervalSince(last) < 5 {
|
||||||
|
updateOutdatedMenu(with: cachedOutdated)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchOutdated()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ FORCE refresh (menu button)
|
||||||
|
@objc func forceRefreshOutdated() {
|
||||||
|
fetchOutdated()
|
||||||
|
}
|
||||||
|
|
||||||
|
func fetchOutdated() {
|
||||||
|
setMenuBarIcon("brewbar-updating")
|
||||||
|
|
||||||
|
runBrew("outdated") { output in
|
||||||
|
|
||||||
|
let lines = output.split(separator: "\n").map { String($0) }
|
||||||
|
|
||||||
|
self.cachedOutdated = lines
|
||||||
|
self.lastOutdatedFetch = Date()
|
||||||
|
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.updateOutdatedMenu(with: lines)
|
||||||
|
self.updateStatus(count: lines.count)
|
||||||
|
if lines.isEmpty {
|
||||||
|
self.setMenuBarIcon("brewbar-uptodate")
|
||||||
|
} else {
|
||||||
|
self.setMenuBarIcon("brewbar-outdated")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateOutdatedMenu(with lines: [String]) {
|
||||||
|
|
||||||
|
outdatedSubmenu.removeAllItems()
|
||||||
|
outdatedSubmenu.addItem(NSMenuItem(title: "Refresh List", action: #selector(forceRefreshOutdated), keyEquivalent: ""))
|
||||||
|
|
||||||
|
if lines.isEmpty {
|
||||||
|
outdatedSubmenu.addItem(NSMenuItem(title: "✅ All up to date", action: nil, keyEquivalent: ""))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for formula in lines {
|
||||||
|
let item = NSMenuItem(title: formula, action: #selector(self.upgradeSingle(_:)), keyEquivalent: "")
|
||||||
|
item.representedObject = formula
|
||||||
|
outdatedSubmenu.addItem(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateStatus(count: Int) {
|
||||||
|
if count == 0 {
|
||||||
|
statusMenuItem.title = "✅ All up to date"
|
||||||
|
} else {
|
||||||
|
statusMenuItem.title = "⚠️ \(count) outdated"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func upgradeSingle(_ sender: NSMenuItem) {
|
||||||
|
guard let formula = sender.representedObject as? String else { return }
|
||||||
|
|
||||||
|
runBrew("upgrade \(formula)") { _ in
|
||||||
|
self.refreshAll()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func refreshAll() {
|
||||||
|
statusMenuItem.title = "Updating..."
|
||||||
|
|
||||||
|
runBrew("update") { _ in
|
||||||
|
self.fetchOutdated() // ✅ ONLY place calling outdated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ✅ Brew version (correct)
|
||||||
|
func refreshBrewVersion() {
|
||||||
|
runBrew("--version") { output in
|
||||||
|
let firstLine = output.split(separator: "\n").first.map(String.init) ?? "Unknown"
|
||||||
|
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.versionItem.title = "🏷 \(firstLine)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Logs
|
||||||
|
|
||||||
|
func log(_ text: String) {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.logBuffer += text
|
||||||
|
self.logWindow?.update(text: self.logBuffer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc func showLogs() {
|
||||||
|
if logWindow == nil {
|
||||||
|
logWindow = LogWindowController()
|
||||||
|
}
|
||||||
|
logWindow?.showWindow(nil)
|
||||||
|
logWindow?.update(text: logBuffer)
|
||||||
|
}
|
||||||
|
}
|
||||||
8
BrewBar/Info.plist
Normal file
8
BrewBar/Info.plist
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string></string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
36
BrewBar/LogWindowController.swift
Normal file
36
BrewBar/LogWindowController.swift
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class LogWindowController: NSWindowController {
|
||||||
|
|
||||||
|
var textView: NSTextView!
|
||||||
|
|
||||||
|
convenience init() {
|
||||||
|
|
||||||
|
let contentRect = NSRect(x: 0, y: 0, width: 600, height: 400)
|
||||||
|
let styleMask: NSWindow.StyleMask = [.titled, .closable, .resizable]
|
||||||
|
|
||||||
|
let window = NSWindow(contentRect: contentRect,
|
||||||
|
styleMask: styleMask,
|
||||||
|
backing: .buffered,
|
||||||
|
defer: false)
|
||||||
|
|
||||||
|
self.init(window: window)
|
||||||
|
|
||||||
|
window.title = "Logs"
|
||||||
|
|
||||||
|
let scrollView = NSScrollView(frame: window.contentView!.bounds)
|
||||||
|
scrollView.autoresizingMask = [.width, .height]
|
||||||
|
|
||||||
|
textView = NSTextView(frame: scrollView.bounds)
|
||||||
|
textView.isEditable = false
|
||||||
|
textView.autoresizingMask = [.width, .height]
|
||||||
|
|
||||||
|
scrollView.documentView = textView
|
||||||
|
window.contentView?.addSubview(scrollView)
|
||||||
|
}
|
||||||
|
|
||||||
|
func update(text: String) {
|
||||||
|
textView.string = text
|
||||||
|
textView.scrollToEndOfDocument(nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue