Update network monitor to swift 2.3

This commit is contained in:
qinyuhang
2016-09-14 12:20:32 +08:00
parent 5ec413b282
commit 8f23900bc6
3 changed files with 7 additions and 7 deletions
+4 -2
View File
@@ -452,7 +452,7 @@
TargetAttributes = {
9B0BFFE41D0460A70040E62B = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 2E8Q4BTFR2;
ProvisioningStyle = Manual;
};
9B0BFFF31D0460A70040E62B = {
CreatedOnToolsVersion = 7.3.1;
@@ -861,8 +861,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/libcork/include/",
"$(SRCROOT)/libipset/include/",
@@ -892,6 +893,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/libcork/include/",
"$(SRCROOT)/libipset/include/",
+2 -4
View File
@@ -33,9 +33,7 @@ public class NetWorkMonitor: NSObject {
alertView.informativeText = "因为 macOS 10.12 Sierra ABI 不稳定,因此暂时移除网速功能"
alertView.addButtonWithTitle("取消网速显示")
alertView.runModal()
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setBool(false, forKey: "enable_showSpeed")
stop()
// NSRunLoop.currentRunLoop().run()
// CFRunLoopRun()
@@ -129,4 +127,4 @@ public class NetWorkMonitor: NSObject {
catch {}
}
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ public class StatusItemView: NSControl {
let downRateRect = downRateString.boundingRectWithSize(NSSize(width: 100, height: 100), options: .UsesLineFragmentOrigin)
downRateString.drawAtPoint(NSMakePoint(bounds.width - downRateRect.width - 5, 0))
}
image?.drawAtPoint(NSPoint(x: 0, y: 0), fromRect: NSRect(x: 0, y: 0, width: bounds.height, height: bounds.height), operation: .CompositeSourceOver, fraction: 1.0)
image?.drawAtPoint(NSPoint(x: 0, y: 0), fromRect: NSRect(x: 0, y: 0, width: bounds.height, height: bounds.height), operation: NSCompositeSourceOver, fraction: 1.0)
}
public func setRateData(up up:Float, down: Float) {