重构项目文件结构并重命名根目录
✨ 新功能: - 重新组织项目文件结构,采用模块化架构 - 重命名根目录: test1 → Bitcoin-Monitoring - 更新Bundle标识符: com.mark.test1 → com.mark.bitcoin-monitoring 🔧 技术改进: - Core/: 核心应用逻辑 (BitcoinMonitoringApp, MenuBarManager) - Managers/: 业务逻辑管理器 (AppSettings, PriceManager, PriceService) - Models/: 数据模型 (CryptoSymbol, RefreshInterval, BTCPriceResponse) - Views/: SwiftUI视图组件 (PreferencesWindowView, AboutWindowView) - Windows/: 窗口管理 (PreferencesWindowManager) - Resources/: 资源文件 (Assets, entitlements) 📝 文档更新: - 更新CLAUDE.md中的项目架构说明 - 修正文件结构描述以反映新的组织方式 ✅ 验证: - 项目编译成功 - 所有路径引用正确更新 - Bundle标识符已更新
@@ -254,12 +254,12 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = test1/test1.entitlements;
|
||||
CODE_SIGN_ENTITLEMENTS = Bitcoin-Monitoring/Resources/BitcoinMonitoring.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"test1/Preview Content\"";
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Bitcoin-Monitoring/Preview Content\"";
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -274,7 +274,7 @@
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.5;
|
||||
MARKETING_VERSION = 1.1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mark.test1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mark.bitcoin-monitoring;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -287,12 +287,12 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = test1/test1.entitlements;
|
||||
CODE_SIGN_ENTITLEMENTS = Bitcoin-Monitoring/Resources/BitcoinMonitoring.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"test1/Preview Content\"";
|
||||
DEVELOPMENT_ASSET_PATHS = "\"Bitcoin-Monitoring/Preview Content\"";
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
@@ -307,7 +307,7 @@
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 13.5;
|
||||
MARKETING_VERSION = 1.1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mark.test1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mark.bitcoin-monitoring;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// test1App.swift
|
||||
// BitcoinMonitoringApp.swift
|
||||
// Bitcoin Monitoring
|
||||
//
|
||||
// Created by Mark on 2025/10/28.
|
||||
@@ -9,7 +9,7 @@ import SwiftUI
|
||||
import AppKit
|
||||
|
||||
@main
|
||||
struct test1App: App {
|
||||
struct BitcoinMonitoringApp: App {
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
|
||||
var body: some Scene {
|
||||
@@ -20,7 +20,7 @@ struct test1App: App {
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
var menuBarApp: BTCMenuBarApp?
|
||||
var menuBarApp: MenuBarManager?
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
// 设置应用为后台应用(不显示在Dock中)
|
||||
@@ -32,7 +32,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
|
||||
// 创建菜单栏应用
|
||||
menuBarApp = BTCMenuBarApp()
|
||||
menuBarApp = MenuBarManager()
|
||||
}
|
||||
|
||||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// BTCMenuBarApp.swift
|
||||
// MenuBarManager.swift
|
||||
// Bitcoin Monitoring
|
||||
//
|
||||
// Created by Mark on 2025/10/28.
|
||||
@@ -11,7 +11,7 @@ import Combine
|
||||
|
||||
// macOS菜单栏应用主类
|
||||
@MainActor
|
||||
class BTCMenuBarApp: NSObject, ObservableObject {
|
||||
class MenuBarManager: NSObject, ObservableObject {
|
||||
private var statusItem: NSStatusItem?
|
||||
private var popover: NSPopover?
|
||||
private let appSettings: AppSettings
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |