Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status menu code quality improvements #35

Merged
merged 15 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion HeliPort.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
BCFA32ED2424D2BF00E23603 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BCFA32EC2424D2BF00E23603 /* Assets.xcassets */; };
BCFA32F02424D2BF00E23603 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCFA32EE2424D2BF00E23603 /* MainMenu.xib */; };
D47DD664F9B2939B57C54DF4 /* Pods_HeliPort.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEE10AB0115816EC5C117043 /* Pods_HeliPort.framework */; };
F34B2B8D24AA4C1E009AB1BB /* NSMenuItem+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F34B2B8C24AA4C1E009AB1BB /* NSMenuItem+Extensions.swift */; };
F379276F24A0A4A50087FF2B /* CredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F379276E24A0A4A50087FF2B /* CredentialsManager.swift */; };
F379277124A0A52E0087FF2B /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = F379277024A0A52E0087FF2B /* Log.swift */; };
F379277424A0DADD0087FF2B /* WifiPopupWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = F379277324A0DADD0087FF2B /* WifiPopupWindow.swift */; };
F3915F0724AB1A1B00E6614D /* itl_80211_state+Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3915F0624AB1A1B00E6614D /* itl_80211_state+Status.swift */; };
F84E327924457FAE00D07895 /* ItlNetworkUserClient.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F84E327724457FAE00D07895 /* ItlNetworkUserClient.hpp */; };
F86A8960243CD13300CBABC2 /* TestService.hpp in Headers */ = {isa = PBXBuildFile; fileRef = F86A895F243CD13300CBABC2 /* TestService.hpp */; };
F86A8962243CD13400CBABC2 /* TestService.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F86A8961243CD13400CBABC2 /* TestService.cpp */; };
Expand Down Expand Up @@ -81,9 +83,11 @@
BCFA32F12424D2BF00E23603 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BCFA32F22424D2BF00E23603 /* HeliPort.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HeliPort.entitlements; sourceTree = "<group>"; };
DEE10AB0115816EC5C117043 /* Pods_HeliPort.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeliPort.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F34B2B8C24AA4C1E009AB1BB /* NSMenuItem+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSMenuItem+Extensions.swift"; sourceTree = "<group>"; };
F379276E24A0A4A50087FF2B /* CredentialsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialsManager.swift; sourceTree = "<group>"; };
F379277024A0A52E0087FF2B /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
F379277324A0DADD0087FF2B /* WifiPopupWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WifiPopupWindow.swift; sourceTree = "<group>"; };
F3915F0624AB1A1B00E6614D /* itl_80211_state+Status.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "itl_80211_state+Status.swift"; sourceTree = "<group>"; };
F84E327624457FAE00D07895 /* ItlNetworkUserClient.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ItlNetworkUserClient.cpp; sourceTree = "<group>"; };
F84E327724457FAE00D07895 /* ItlNetworkUserClient.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ItlNetworkUserClient.hpp; sourceTree = "<group>"; };
F86A895D243CD13000CBABC2 /* TestService.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestService.kext; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -196,11 +200,21 @@
BCFA32F22424D2BF00E23603 /* HeliPort.entitlements */,
7557CDF324935260000F0F71 /* Credits.rtf */,
F379276E24A0A4A50087FF2B /* CredentialsManager.swift */,
F379277024A0A52E0087FF2B /* Log.swift */,
F34B2B8B24AA4C08009AB1BB /* Supporting files */,
);
path = HeliPort;
sourceTree = "<group>";
};
F34B2B8B24AA4C08009AB1BB /* Supporting files */ = {
isa = PBXGroup;
children = (
F3915F0624AB1A1B00E6614D /* itl_80211_state+Status.swift */,
F379277024A0A52E0087FF2B /* Log.swift */,
F34B2B8C24AA4C1E009AB1BB /* NSMenuItem+Extensions.swift */,
);
path = "Supporting files";
sourceTree = "<group>";
};
F86A895E243CD13100CBABC2 /* TestService */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -454,12 +468,14 @@
501FA512249B8F77002B5B54 /* WifiPlistManager.swift in Sources */,
BCA4DFAB2438CF25002A862A /* WiFiPopoverView.swift in Sources */,
BCF712F9243C8BE800BE3C05 /* StatusBarIconManager.swift in Sources */,
F3915F0724AB1A1B00E6614D /* itl_80211_state+Status.swift in Sources */,
BCFA32EB2424D2BE00E23603 /* AppDelegate.swift in Sources */,
BCCB2AA4243708090005BB82 /* WiFiMenuItemView.swift in Sources */,
BCA4DFAD243A307B002A862A /* StatusMenu.swift in Sources */,
75FDF38B2481D22000B2A601 /* NetworkInfo.swift in Sources */,
BCAF807F243DBA8C0034C8C7 /* JoinPopWindow.swift in Sources */,
F379277424A0DADD0087FF2B /* WifiPopupWindow.swift in Sources */,
F34B2B8D24AA4C1E009AB1BB /* NSMenuItem+Extensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion HeliPort/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
let statusBar = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
statusBar.button?.image = NSImage.init(named: "WiFiStateDisconnected")
statusBar.button?.image?.isTemplate = true
statusBar.menu = StatusMenu.init(title: "")
statusBar.menu = StatusMenu()

StatusBarIcon.statusBar = statusBar
}
Expand Down
17 changes: 17 additions & 0 deletions HeliPort/Appearance/JoinPopWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ final class JoinPopWindow: NSWindow, NSTextFieldDelegate {
private let joinButton: NSButton
private let cancelButton: NSButton

convenience init() {
self.init(
contentRect: NSRect(
x: 0,
y: 0,
width: 450,
height: 247
),
styleMask: .titled,
backing: .buffered,
defer: false)
}

override init(
contentRect: NSRect,
styleMask style: NSWindow.StyleMask,
Expand Down Expand Up @@ -547,4 +560,8 @@ final class JoinPopWindow: NSWindow, NSTextFieldDelegate {

controlJoinButton()
}

func show() {
makeKeyAndOrderFront(self)
}
}
Loading