Skip to content

Replace deprecated NSOnState/NSOffState with NSControlStateValue constants - #536

Merged
hannesa2 merged 2 commits into
masterfrom
copilot/remove-deprecated-nsstate-references
Mar 20, 2026
Merged

Replace deprecated NSOnState/NSOffState with NSControlStateValue constants#536
hannesa2 merged 2 commits into
masterfrom
copilot/remove-deprecated-nsstate-references

Conversation

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Eliminates macOS 10.14+ deprecation warnings by migrating from NSOnState/NSOffState to NSControlStateValueOn/NSControlStateValueOff.

Changes

  • Menu item states: Updated state assignments in history controller (detail/tree view), commit controller (amend toggle), and search controller (search mode selection)
  • Checkbox/button state checks: Updated state comparisons in sheets and panels for hidden file toggles and alert suppression buttons

Example

// Before
[menuItem setState:(condition) ? NSOnState : NSOffState];
if ([sender state] == NSOnState) { ... }

// After  
[menuItem setState:(condition) ? NSControlStateValueOn : NSControlStateValueOff];
if ([sender state] == NSControlStateValueOn) { ... }

Affects 8 occurrences across 7 files: PBGitHistoryController.m, PBGitCommitController.m, PBHistorySearchController.m, PBPrefsWindowController.m, PBGitWindowController.m, PBAddRemoteSheet.m, PBCloneRepositoryPanel.m.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…tants

Co-authored-by: hannesa2 <3314607+hannesa2@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove deprecated NSOnState and NSOffState references Replace deprecated NSOnState/NSOffState with NSControlStateValue constants Mar 20, 2026
Copilot AI requested a review from hannesa2 March 20, 2026 07:14
@hannesa2

Copy link
Copy Markdown
Contributor

Screenshot differs: emulatorApi=arm64 with 2 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

00-commit-context-menu.pngscreenshot

01-history-view.pngscreenshot

@hannesa2
hannesa2 marked this pull request as ready for review March 20, 2026 07:24
@hannesa2
hannesa2 merged commit 95f36f8 into master Mar 20, 2026
1 of 3 checks passed
@hannesa2
hannesa2 deleted the copilot/remove-deprecated-nsstate-references branch March 20, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants