Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0a97788
Move code from core to winAPI
seanbudd Aug 19, 2022
4dda07e
fix ckeckPot
seanbudd Aug 19, 2022
a271d6f
fix announcing charge status
seanbudd Aug 19, 2022
9a9888a
Merge branch 'master' into moveCodeToWinAPI
seanbudd Aug 22, 2022
233e19f
fixup reporting unknown status
seanbudd Aug 22, 2022
3e589b7
initialize batterystate as unknown
seanbudd Aug 22, 2022
59f1543
Merge branch 'master' into moveCodeToWinAPI
seanbudd Aug 24, 2022
54ae3d6
used named constants for seconds
seanbudd Aug 25, 2022
73d0d07
add notes to move to winAPI module
seanbudd Aug 25, 2022
927680b
Create HWNDVal Type
seanbudd Aug 25, 2022
7e7bd3e
simplify window message handling
seanbudd Aug 25, 2022
0cac074
Make display tracking modular and unit testable
seanbudd Aug 25, 2022
5158be2
Make power tracking modular and unit testable
seanbudd Aug 25, 2022
191652a
add unit testing
seanbudd Aug 25, 2022
44fab0c
fixup lint
seanbudd Aug 25, 2022
c4e5940
re-add lost translator comments
seanbudd Aug 25, 2022
5259640
fix up import order
seanbudd Aug 25, 2022
ceb5ae7
Merge branch 'master' into moveCodeToWinAPI
seanbudd Aug 26, 2022
9ef285e
separate handleWindowMessage
seanbudd Aug 26, 2022
e26cafe
don't announce empty battery status speech
seanbudd Aug 26, 2022
a2a80d5
change to _getNewOrientationState
seanbudd Aug 26, 2022
077020f
simplify _getNewOrientationState
seanbudd Aug 27, 2022
ef1da19
finalize unit tests
seanbudd Aug 27, 2022
91c7b96
rename to _getNewOrientationStyle
seanbudd Aug 30, 2022
822440a
change to assertEqual
seanbudd Aug 30, 2022
d543615
initialize orientation state'
seanbudd Aug 30, 2022
1122dcf
remove usagees of deprecated code
seanbudd Aug 30, 2022
ec77e83
Merge branch 'master' into moveCodeToWinAPI
seanbudd Aug 30, 2022
2381c14
address review feedback:
seanbudd Aug 30, 2022
43f72fe
Merge branch 'master' into moveCodeToWinAPI
seanbudd Aug 30, 2022
6fcad2f
rename modules, mark as private
seanbudd Aug 30, 2022
f731680
move SystemMetrics enum
seanbudd Aug 30, 2022
07b56ef
revert changes to winAPI.constants
seanbudd Aug 30, 2022
2048b83
improve deprecation message
seanbudd Aug 30, 2022
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
Prev Previous commit
Next Next commit
fixup reporting unknown status
  • Loading branch information
seanbudd committed Aug 22, 2022
commit 233e19fd9e92373468a3cb481983fbf34666ae1c
4 changes: 2 additions & 2 deletions source/winAPI/powerTracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SystemPowerStatus(ctypes.Structure):
def initialize():
global _batteryState
sps = SystemPowerStatus()
if not winKernel.GetSystemPowerStatus(sps) or sps.BatteryFlag & BatteryFlag.UNKNOWN:
if not winKernel.GetSystemPowerStatus(sps) or sps.BatteryFlag == BatteryFlag.UNKNOWN:
log.error("Error retrieving system power status")
return

Expand All @@ -122,7 +122,7 @@ def reportCurrentBatteryStatus(onlyReportIfStatusChanged: bool = False) -> None:
if not systemPowerStatusUpdateResult:
log.error(f"Error retrieving power status: {ctypes.GetLastError()}")

if not systemPowerStatusUpdateResult or sps.BatteryFlag & BatteryFlag.UNKNOWN:
if not systemPowerStatusUpdateResult or sps.BatteryFlag == BatteryFlag.UNKNOWN:
# Translators: This is presented when there is an error retrieving the battery status.
ui.message(_("Unknown power status"))
return
Expand Down