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

Commit

Permalink
Minor UI tweaks. Fixing doubling internal battary sensor. Bringing Sp…
Browse files Browse the repository at this point in the history
…arkle finish_installation app window back while installing updates (bringing status window back then the action button is inactive)
  • Loading branch information
CozmoNate committed Sep 28, 2013
1 parent 84469a4 commit b3e98b2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 68 deletions.
8 changes: 0 additions & 8 deletions HWMonitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
7E0648F016DF3B7D00ACB851 /* LaunchAtLoginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E0648EE16DF3B7D00ACB851 /* LaunchAtLoginController.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
7E0648F116DF3B7D00ACB851 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 7E0648EF16DF3B7D00ACB851 /* README.md */; };
7E10343616EFAE490089DE7B /* GenericBatteryDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E10343516EFAE490089DE7B /* GenericBatteryDevice.m */; };
7E1458C817E2744000694A4A /* 27-circle-o.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C417E2744000694A4A /* 27-circle-o.png */; };
7E1458C917E2744000694A4A /* 27-circle-o@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C517E2744000694A4A /* 27-circle-o@2x.png */; };
7E1458CA17E2744000694A4A /* 37-circle-x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C617E2744000694A4A /* 37-circle-x.png */; };
7E1458CB17E2744000694A4A /* 37-circle-x@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1458C717E2744000694A4A /* 37-circle-x@2x.png */; };
7E16893616EA106D00BBF6FC /* ArrowlessScroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E16893516EA106D00BBF6FC /* ArrowlessScroller.m */; };
Expand Down Expand Up @@ -138,8 +136,6 @@
7E10343416EFAE490089DE7B /* GenericBatteryDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericBatteryDevice.h; sourceTree = "<group>"; };
7E10343516EFAE490089DE7B /* GenericBatteryDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GenericBatteryDevice.m; sourceTree = "<group>"; };
7E1261D316E0094A00622F92 /* FakeSMCDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FakeSMCDefinitions.h; path = Shared/FakeSMCDefinitions.h; sourceTree = "<group>"; };
7E1458C417E2744000694A4A /* 27-circle-o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "27-circle-o.png"; sourceTree = "<group>"; };
7E1458C517E2744000694A4A /* 27-circle-o@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "27-circle-o@2x.png"; sourceTree = "<group>"; };
7E1458C617E2744000694A4A /* 37-circle-x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "37-circle-x.png"; sourceTree = "<group>"; };
7E1458C717E2744000694A4A /* 37-circle-x@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "37-circle-x@2x.png"; sourceTree = "<group>"; };
7E16893416EA106D00BBF6FC /* ArrowlessScroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowlessScroller.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -470,8 +466,6 @@
7EED6D6C1734F8E700248870 /* 16-line-chart@2x.png */,
7EED6D7B1734F9CF00248870 /* 19-gear.png */,
7EED6D7C1734F9CF00248870 /* 19-gear@2x.png */,
7E1458C417E2744000694A4A /* 27-circle-o.png */,
7E1458C517E2744000694A4A /* 27-circle-o@2x.png */,
7E1458C617E2744000694A4A /* 37-circle-x.png */,
7E1458C717E2744000694A4A /* 37-circle-x@2x.png */,
7E683B0117E37916001A6EF6 /* github.png */,
Expand Down Expand Up @@ -770,8 +764,6 @@
7EED6D7D1734F9CF00248870 /* 19-gear.png in Resources */,
7EED6D7E1734F9CF00248870 /* 19-gear@2x.png in Resources */,
7EDEA333173E3B94003ADE86 /* hwsensors.icns in Resources */,
7E1458C817E2744000694A4A /* 27-circle-o.png in Resources */,
7E1458C917E2744000694A4A /* 27-circle-o@2x.png in Resources */,
7E1458CA17E2744000694A4A /* 37-circle-x.png in Resources */,
7E1458CB17E2744000694A4A /* 37-circle-x@2x.png in Resources */,
7E683AFC17E3761D001A6EF6 /* scale.png in Resources */,
Expand Down
Binary file removed HWMonitor/27-circle-o.png
Binary file not shown.
Binary file removed HWMonitor/27-circle-o@2x.png
Binary file not shown.
14 changes: 5 additions & 9 deletions HWMonitor/GenericBatteryDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,28 @@ + (NSArray*)discoverDevices
NSMutableArray *devices = [[NSMutableArray alloc] init];
BatteryDeviceType type;
int count = 0;

do {
CFDictionaryRef matching;

switch (count++) {
case 0:
// matching = IOServiceMatching("AppleSmartBattery");
matching = IOServiceMatching("IOPMPowerSource");
type = kInternalBatteryType;
break;

case 1:
matching = IOServiceMatching("AppleSmartBattery");
type = kInternalBatteryType;
break;

case 2:
matching = IOServiceMatching("BNBMouseDevice");
type = kBluetoothDeviceTypeMouse;
break;

case 3:
case 2:
matching = IOServiceMatching("AppleBluetoothHIDKeyboard");
type = kBluetoothDeviceTypeKeyboard;
break;

case 4:
case 3:
matching = IOServiceMatching("BNBTrackpadDevice");
type = kBluetoothDeviceTypeTrackpad;
break;
Expand Down
63 changes: 12 additions & 51 deletions HWMonitor/PopupController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
<action selector="detachFromMenuBar:" target="3" id="1445"/>
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="1727" id="2641">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
Expand Down Expand Up @@ -474,10 +474,10 @@
<connections>
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" id="2573">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
Expand All @@ -500,47 +500,14 @@
<action selector="orderOut:" target="3" id="1151"/>
<binding destination="-2" name="enabled" keyPath="self.window.attachedToMenuBar" id="2507">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2507" id="2551">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="1"/>
<integer key="NSNoSelectionPlaceholder" value="1"/>
<integer key="NSMultipleValuesPlaceholder" value="1"/>
<integer key="NSNullPlaceholder" value="1"/>
</dictionary>
</binding>
</connections>
</button>
<button toolTip="Attach to Menu Bar" translatesAutoresizingMaskIntoConstraints="NO" id="1812" userLabel="Attach Button" customClass="FadingButton">
<rect key="frame" x="29" y="9" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="2794"/>
</constraints>
<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">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent">g</string>
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</buttonCell>
<connections>
<action selector="attachToMenuBar:" target="3" id="1826"/>
<binding destination="-2" name="enabled" keyPath="self.window.attachedToMenuBar" id="2298">
<dictionary key="options">
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNoSelectionPlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
<integer key="NSMultipleValuesPlaceholder" value="0"/>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2298" id="2310">
<binding destination="-2" name="hidden" keyPath="self.window.attachedToMenuBar" previousBinding="2507" id="2551">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="1"/>
<integer key="NSNoSelectionPlaceholder" value="1"/>
Expand All @@ -553,9 +520,6 @@
<button toolTip="Preferences" translatesAutoresizingMaskIntoConstraints="NO" id="25" userLabel="Preferences Button" customClass="FadingButton">
<rect key="frame" x="200" y="9" width="15" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="2624"/>
</constraints>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="19-gear" imagePosition="only" alignment="left" alternateImage="19-gear" imageScaling="proportionallyUpOrDown" inset="2" id="45">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -589,32 +553,29 @@
</subviews>
<constraints>
<constraint firstItem="2559" firstAttribute="baseline" secondItem="27" secondAttribute="baseline" id="2568"/>
<constraint firstItem="25" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="2606"/>
<constraint firstItem="25" firstAttribute="top" secondItem="26" secondAttribute="top" id="2608"/>
<constraint firstAttribute="trailing" secondItem="25" secondAttribute="trailing" constant="10" id="2615"/>
<constraint firstAttribute="trailing" secondItem="26" secondAttribute="trailing" constant="30" id="2629"/>
<constraint firstItem="1138" firstAttribute="leading" secondItem="2559" secondAttribute="leading" id="2733"/>
<constraint firstItem="1138" firstAttribute="leading" secondItem="14" secondAttribute="leading" constant="10" id="2777"/>
<constraint firstItem="1138" firstAttribute="centerY" secondItem="14" secondAttribute="centerY" id="2806"/>
<constraint firstItem="1812" firstAttribute="top" secondItem="26" secondAttribute="top" id="2814"/>
<constraint firstItem="1812" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="2815"/>
<constraint firstItem="1812" firstAttribute="bottom" secondItem="1138" secondAttribute="bottom" id="2818"/>
<constraint firstItem="1812" firstAttribute="top" secondItem="1138" secondAttribute="top" id="2819"/>
<constraint firstItem="1812" firstAttribute="leading" secondItem="14" secondAttribute="leading" constant="29" id="2820"/>
<constraint firstItem="1138" firstAttribute="centerY" secondItem="2559" secondAttribute="centerY" id="2821"/>
<constraint firstItem="2648" firstAttribute="bottom" secondItem="14" secondAttribute="bottom" id="2822"/>
<constraint firstItem="2648" firstAttribute="leading" secondItem="14" secondAttribute="leading" id="2823"/>
<constraint firstItem="2648" firstAttribute="centerX" secondItem="27" secondAttribute="centerX" id="2824"/>
<constraint firstItem="2648" firstAttribute="top" secondItem="14" secondAttribute="top" id="2825"/>
<constraint firstItem="2648" firstAttribute="trailing" secondItem="14" secondAttribute="trailing" id="2826"/>
<constraint firstItem="25" firstAttribute="top" secondItem="26" secondAttribute="top" id="GPf-ZC-t36"/>
<constraint firstAttribute="trailing" secondItem="25" secondAttribute="trailing" constant="10" id="HFh-Mr-xwC"/>
<constraint firstItem="25" firstAttribute="bottom" secondItem="26" secondAttribute="bottom" id="HaP-KR-2Fl"/>
<constraint firstItem="25" firstAttribute="leading" secondItem="26" secondAttribute="trailing" constant="5" id="b2k-8w-08Q"/>
<constraint firstItem="25" firstAttribute="top" secondItem="1138" secondAttribute="top" id="i9k-Yl-qT9"/>
<constraint firstItem="25" firstAttribute="bottom" secondItem="1138" secondAttribute="bottom" id="w3x-qY-5Dn"/>
</constraints>
</customView>
<userDefaultsController representsSharedInstance="YES" id="1200"/>
</objects>
<resources>
<image name="16-line-chart" width="15" height="15"/>
<image name="19-gear" width="15" height="15"/>
<image name="27-circle-o" width="15" height="15"/>
<image name="37-circle-x" width="15" height="15"/>
<image name="NSActionTemplate" width="15" height="15"/>
</resources>
Expand Down
9 changes: 9 additions & 0 deletions Sparkle/SUStatusController.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ - (BOOL)progressBarShouldAnimate

- (void)setButtonEnabled:(BOOL)enabled
{

if (enabled) {
[self.window setLevel:NSFloatingWindowLevel];
}
else {
[self.window setLevel:NSNormalWindowLevel];
[self.window orderBack:self];
}

[actionButton setEnabled:enabled];
}

Expand Down

0 comments on commit b3e98b2

Please sign in to comment.