Skip to content
This repository was archived by the owner on Oct 12, 2018. It is now read-only.

Commit b3e98b2

Browse files
committed
Minor UI tweaks. Fixing doubling internal battary sensor. Bringing Sparkle finish_installation app window back while installing updates (bringing status window back then the action button is inactive)
1 parent 84469a4 commit b3e98b2

File tree

6 files changed

+26
-68
lines changed

6 files changed

+26
-68
lines changed

HWMonitor.xcodeproj/project.pbxproj

-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
7E0648F016DF3B7D00ACB851 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E0648EE16DF3B7D00ACB851 /* LaunchAtLoginController.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
1111
7E0648F116DF3B7D00ACB851 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 7E0648EF16DF3B7D00ACB851 /* README.md */; };
1212
7E10343616EFAE490089DE7B /* GenericBatteryDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E10343516EFAE490089DE7B /* GenericBatteryDevice.m */; };
13-
7E1458C817E2744000694A4A /* 27-circle-o.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C417E2744000694A4A /* 27-circle-o.png */; };
14-
7E1458C917E2744000694A4A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C517E2744000694A4A /* [email protected] */; };
1513
7E1458CA17E2744000694A4A /* 37-circle-x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C617E2744000694A4A /* 37-circle-x.png */; };
1614
7E1458CB17E2744000694A4A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C717E2744000694A4A /* [email protected] */; };
1715
7E16893616EA106D00BBF6FC /* ArrowlessScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E16893516EA106D00BBF6FC /* ArrowlessScroller.m */; };
@@ -138,8 +136,6 @@
138136
7E10343416EFAE490089DE7B /* GenericBatteryDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericBatteryDevice.h; sourceTree = "<group>"; };
139137
7E10343516EFAE490089DE7B /* GenericBatteryDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GenericBatteryDevice.m; sourceTree = "<group>"; };
140138
7E1261D316E0094A00622F92 /* FakeSMCDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FakeSMCDefinitions.h; path = Shared/FakeSMCDefinitions.h; sourceTree = "<group>"; };
141-
7E1458C417E2744000694A4A /* 27-circle-o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "27-circle-o.png"; sourceTree = "<group>"; };
142-
7E1458C517E2744000694A4A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
143139
7E1458C617E2744000694A4A /* 37-circle-x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "37-circle-x.png"; sourceTree = "<group>"; };
144140
7E1458C717E2744000694A4A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
145141
7E16893416EA106D00BBF6FC /* ArrowlessScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowlessScroller.h; sourceTree = "<group>"; };
@@ -470,8 +466,6 @@
470466
7EED6D6C1734F8E700248870 /* [email protected] */,
471467
7EED6D7B1734F9CF00248870 /* 19-gear.png */,
472468
7EED6D7C1734F9CF00248870 /* [email protected] */,
473-
7E1458C417E2744000694A4A /* 27-circle-o.png */,
474-
7E1458C517E2744000694A4A /* [email protected] */,
475469
7E1458C617E2744000694A4A /* 37-circle-x.png */,
476470
7E1458C717E2744000694A4A /* [email protected] */,
477471
7E683B0117E37916001A6EF6 /* github.png */,
@@ -770,8 +764,6 @@
770764
7EED6D7D1734F9CF00248870 /* 19-gear.png in Resources */,
771765
7EED6D7E1734F9CF00248870 /* [email protected] in Resources */,
772766
7EDEA333173E3B94003ADE86 /* hwsensors.icns in Resources */,
773-
7E1458C817E2744000694A4A /* 27-circle-o.png in Resources */,
774-
7E1458C917E2744000694A4A /* [email protected] in Resources */,
775767
7E1458CA17E2744000694A4A /* 37-circle-x.png in Resources */,
776768
7E1458CB17E2744000694A4A /* [email protected] in Resources */,
777769
7E683AFC17E3761D001A6EF6 /* scale.png in Resources */,

HWMonitor/27-circle-o.png

-2.04 KB
Binary file not shown.

HWMonitor/[email protected]

-2.5 KB
Binary file not shown.

HWMonitor/GenericBatteryDevice.m

+5-9
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,28 @@ + (NSArray*)discoverDevices
1515
NSMutableArray *devices = [[NSMutableArray alloc] init];
1616
BatteryDeviceType type;
1717
int count = 0;
18-
18+
1919
do {
2020
CFDictionaryRef matching;
2121

2222
switch (count++) {
2323
case 0:
24+
// matching = IOServiceMatching("AppleSmartBattery");
2425
matching = IOServiceMatching("IOPMPowerSource");
2526
type = kInternalBatteryType;
2627
break;
27-
28+
2829
case 1:
29-
matching = IOServiceMatching("AppleSmartBattery");
30-
type = kInternalBatteryType;
31-
break;
32-
33-
case 2:
3430
matching = IOServiceMatching("BNBMouseDevice");
3531
type = kBluetoothDeviceTypeMouse;
3632
break;
3733

38-
case 3:
34+
case 2:
3935
matching = IOServiceMatching("AppleBluetoothHIDKeyboard");
4036
type = kBluetoothDeviceTypeKeyboard;
4137
break;
4238

43-
case 4:
39+
case 3:
4440
matching = IOServiceMatching("BNBTrackpadDevice");
4541
type = kBluetoothDeviceTypeTrackpad;
4642
break;

HWMonitor/PopupController.xib

+12-51
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
<action selector="detachFromMenuBar:" target="3" id="1445"/>
5151
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="1727" id="2641">
5252
<dictionary key="options">
53-
<integer key="NSMultipleValuesPlaceholder" value="0"/>
53+
<integer key="NSNullPlaceholder" value="0"/>
5454
<integer key="NSNotApplicablePlaceholder" value="0"/>
5555
<integer key="NSNoSelectionPlaceholder" value="0"/>
56-
<integer key="NSNullPlaceholder" value="0"/>
56+
<integer key="NSMultipleValuesPlaceholder" value="0"/>
5757
<string key="NSValueTransformerName">NSNegateBoolean</string>
5858
</dictionary>
5959
</binding>
@@ -474,10 +474,10 @@
474474
<connections>
475475
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" id="2573">
476476
<dictionary key="options">
477-
<integer key="NSMultipleValuesPlaceholder" value="0"/>
477+
<integer key="NSNullPlaceholder" value="0"/>
478478
<integer key="NSNotApplicablePlaceholder" value="0"/>
479479
<integer key="NSNoSelectionPlaceholder" value="0"/>
480-
<integer key="NSNullPlaceholder" value="0"/>
480+
<integer key="NSMultipleValuesPlaceholder" value="0"/>
481481
<string key="NSValueTransformerName">NSNegateBoolean</string>
482482
</dictionary>
483483
</binding>
@@ -500,47 +500,14 @@
500500
<action selector="orderOut:" target="3" id="1151"/>
501501
<binding destination="-2" name="enabled" keyPath="self.window.attachedToMenuBar" id="2507">
502502
<dictionary key="options">
503-
<integer key="NSMultipleValuesPlaceholder" value="0"/>
504-
<integer key="NSNotApplicablePlaceholder" value="0"/>
505-
<integer key="NSNoSelectionPlaceholder" value="0"/>
506503
<integer key="NSNullPlaceholder" value="0"/>
507-
<string key="NSValueTransformerName">NSNegateBoolean</string>
508-
</dictionary>
509-
</binding>
510-
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2507" id="2551">
511-
<dictionary key="options">
512-
<integer key="NSNotApplicablePlaceholder" value="1"/>
513-
<integer key="NSNoSelectionPlaceholder" value="1"/>
514-
<integer key="NSMultipleValuesPlaceholder" value="1"/>
515-
<integer key="NSNullPlaceholder" value="1"/>
516-
</dictionary>
517-
</binding>
518-
</connections>
519-
</button>
520-
<button toolTip="Attach to Menu Bar" translatesAutoresizingMaskIntoConstraints="NO" id="1812" userLabel="Attach Button" customClass="FadingButton">
521-
<rect key="frame" x="29" y="9" width="15" height="15"/>
522-
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
523-
<constraints>
524-
<constraint firstAttribute="width" constant="15" id="2794"/>
525-
</constraints>
526-
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="27-circle-o" imagePosition="only" alignment="left" alternateImage="27-circle-o" imageScaling="proportionallyUpOrDown" inset="2" id="1815">
527-
<behavior key="behavior" lightByContents="YES"/>
528-
<font key="font" metaFont="system"/>
529-
<string key="keyEquivalent">g</string>
530-
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
531-
</buttonCell>
532-
<connections>
533-
<action selector="attachToMenuBar:" target="3" id="1826"/>
534-
<binding destination="-2" name="enabled" keyPath="self.window.attachedToMenuBar" id="2298">
535-
<dictionary key="options">
536-
<integer key="NSMultipleValuesPlaceholder" value="0"/>
537504
<integer key="NSNotApplicablePlaceholder" value="0"/>
538505
<integer key="NSNoSelectionPlaceholder" value="0"/>
539-
<integer key="NSNullPlaceholder" value="0"/>
506+
<integer key="NSMultipleValuesPlaceholder" value="0"/>
540507
<string key="NSValueTransformerName">NSNegateBoolean</string>
541508
</dictionary>
542509
</binding>
543-
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2298" id="2310">
510+
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2507" id="2551">
544511
<dictionary key="options">
545512
<integer key="NSNotApplicablePlaceholder" value="1"/>
546513
<integer key="NSNoSelectionPlaceholder" value="1"/>
@@ -553,9 +520,6 @@
553520
<button toolTip="Preferences" translatesAutoresizingMaskIntoConstraints="NO" id="25" userLabel="Preferences Button" customClass="FadingButton">
554521
<rect key="frame" x="200" y="9" width="15" height="15"/>
555522
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
556-
<constraints>
557-
<constraint firstAttribute="width" constant="15" id="2624"/>
558-
</constraints>
559523
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="19-gear" imagePosition="only" alignment="left" alternateImage="19-gear" imageScaling="proportionallyUpOrDown" inset="2" id="45">
560524
<behavior key="behavior" lightByContents="YES"/>
561525
<font key="font" metaFont="system"/>
@@ -589,32 +553,29 @@
589553
</subviews>
590554
<constraints>
591555
<constraint firstItem="2559" firstAttribute="baseline" secondItem="27" secondAttribute="baseline" id="2568"/>
592-
<constraint firstItem="25" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="2606"/>
593-
<constraint firstItem="25" firstAttribute="top" secondItem="26" secondAttribute="top" id="2608"/>
594-
<constraint firstAttribute="trailing" secondItem="25" secondAttribute="trailing" constant="10" id="2615"/>
595556
<constraint firstAttribute="trailing" secondItem="26" secondAttribute="trailing" constant="30" id="2629"/>
596557
<constraint firstItem="1138" firstAttribute="leading" secondItem="2559" secondAttribute="leading" id="2733"/>
597558
<constraint firstItem="1138" firstAttribute="leading" secondItem="14" secondAttribute="leading" constant="10" id="2777"/>
598559
<constraint firstItem="1138" firstAttribute="centerY" secondItem="14" secondAttribute="centerY" id="2806"/>
599-
<constraint firstItem="1812" firstAttribute="top" secondItem="26" secondAttribute="top" id="2814"/>
600-
<constraint firstItem="1812" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="2815"/>
601-
<constraint firstItem="1812" firstAttribute="bottom" secondItem="1138" secondAttribute="bottom" id="2818"/>
602-
<constraint firstItem="1812" firstAttribute="top" secondItem="1138" secondAttribute="top" id="2819"/>
603-
<constraint firstItem="1812" firstAttribute="leading" secondItem="14" secondAttribute="leading" constant="29" id="2820"/>
604560
<constraint firstItem="1138" firstAttribute="centerY" secondItem="2559" secondAttribute="centerY" id="2821"/>
605561
<constraint firstItem="2648" firstAttribute="bottom" secondItem="14" secondAttribute="bottom" id="2822"/>
606562
<constraint firstItem="2648" firstAttribute="leading" secondItem="14" secondAttribute="leading" id="2823"/>
607563
<constraint firstItem="2648" firstAttribute="centerX" secondItem="27" secondAttribute="centerX" id="2824"/>
608564
<constraint firstItem="2648" firstAttribute="top" secondItem="14" secondAttribute="top" id="2825"/>
609565
<constraint firstItem="2648" firstAttribute="trailing" secondItem="14" secondAttribute="trailing" id="2826"/>
566+
<constraint firstItem="25" firstAttribute="top" secondItem="26" secondAttribute="top" id="GPf-ZC-t36"/>
567+
<constraint firstAttribute="trailing" secondItem="25" secondAttribute="trailing" constant="10" id="HFh-Mr-xwC"/>
568+
<constraint firstItem="25" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="HaP-KR-2Fl"/>
569+
<constraint firstItem="25" firstAttribute="leading" secondItem="26" secondAttribute="trailing" constant="5" id="b2k-8w-08Q"/>
570+
<constraint firstItem="25" firstAttribute="top" secondItem="1138" secondAttribute="top" id="i9k-Yl-qT9"/>
571+
<constraint firstItem="25" firstAttribute="bottom" secondItem="1138" secondAttribute="bottom" id="w3x-qY-5Dn"/>
610572
</constraints>
611573
</customView>
612574
<userDefaultsController representsSharedInstance="YES" id="1200"/>
613575
</objects>
614576
<resources>
615577
<image name="16-line-chart" width="15" height="15"/>
616578
<image name="19-gear" width="15" height="15"/>
617-
<image name="27-circle-o" width="15" height="15"/>
618579
<image name="37-circle-x" width="15" height="15"/>
619580
<image name="NSActionTemplate" width="15" height="15"/>
620581
</resources>

Sparkle/SUStatusController.m

+9
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ - (BOOL)progressBarShouldAnimate
104104

105105
- (void)setButtonEnabled:(BOOL)enabled
106106
{
107+
108+
if (enabled) {
109+
[self.window setLevel:NSFloatingWindowLevel];
110+
}
111+
else {
112+
[self.window setLevel:NSNormalWindowLevel];
113+
[self.window orderBack:self];
114+
}
115+
107116
[actionButton setEnabled:enabled];
108117
}
109118

0 commit comments

Comments
 (0)