Skip to content

Commit

Permalink
refactor(mac): Replace deprecated NS{On,Off}State to NSControlStateVa…
Browse files Browse the repository at this point in the history
…lue{On,Off} (#902)

Signed-off-by: Natsuki Ikeguchi <[email protected]>

PiperOrigin-RevId: 618525464
  • Loading branch information
siketyan authored Mar 24, 2024
1 parent 387cbe5 commit f783cda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/mac/ActivatePane/ActivatePane.mm
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,14 @@ - (void)willExitPane:(InstallerSectionDirection)dir {
if (!_alreadyActivated && dir == InstallerDirectionForward) {
// Make the package visible from i18n system preference
RegisterGoogleJapaneseInput();
if ([_activateCell state] == NSOnState && [_doNotActivateCell state] == NSOffState) {
if ([_activateCell state] == NSControlStateValueOn &&
[_doNotActivateCell state] == NSControlStateValueOff) {
// means clicks "next page" when "activate" menu is on
ActivateGoogleJapaneseInput();
_alreadyActivated = YES;
}
#ifdef GOOGLE_JAPANESE_INPUT_BUILD
if (!_hasUsageStatsDB && [_putUsageStatsDB state] == NSOnState) {
if (!_hasUsageStatsDB && [_putUsageStatsDB state] == NSControlStateValueOn) {
StoreDefaultConfigWithSendingUsageStats();
}
#endif // GOOGLE_JAPANESE_INPUT_BUILD
Expand Down
8 changes: 4 additions & 4 deletions src/mac/DevConfirmPane/DevConfirmPane.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ - (void)awakeFromNib {
}

- (IBAction)checkBoxClicked:(id)sender {
_understandFlag = ([_understandCheckBox state] == NSOnState);
_agreeFlag = ([_agreeCheckBox state] == NSOnState);
_understandFlag = ([_understandCheckBox state] == NSControlStateValueOn);
_agreeFlag = ([_agreeCheckBox state] == NSControlStateValueOn);
if (_understandFlag && _agreeFlag) {
[self setNextEnabled:YES];
} else {
Expand Down Expand Up @@ -85,10 +85,10 @@ - (void)willEnterPane:(InstallerSectionDirection)dir {
}

if (_understandFlag) {
[_understandCheckBox setState:NSOnState];
[_understandCheckBox setState:NSControlStateValueOn];
}
if (_agreeFlag) {
[_agreeCheckBox setState:NSOnState];
[_agreeCheckBox setState:NSControlStateValueOn];
}

if (_understandFlag && _agreeFlag) {
Expand Down

0 comments on commit f783cda

Please sign in to comment.