Opened 8 years ago

Closed 7 years ago

#12652 closed bug (fixed)

Third tab (net time) breaks scripting

Reported by: ttcoder Owned by: nobody
Priority: normal Milestone: R1
Component: Preferences/Time & Date Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

In the Time preflet, one cannot script the "Network time" tab and its contents:

~/Desktop> hey application/x-vnd.Haiku-Time get Label of View 0 of View 2 of View 0 of View 0 of View 0 of Window 0 
Reply BMessage(B_REPLY):

~/Desktop> 

Presumably because its message processing hook does not have the standard/required "default: inherited::MessageReceived(..)" block.

I'm kinda running out of options to get NTP automated in 49856/prod here

Change History (7)

comment:1 by ttcoder, 8 years ago

Addendum: I might have found a way to automate time syncing, after all:

hey application/x-vnd.Haiku-Time set Selection of View 0 of View 0 of Window 0 to 2  # select the third tab
hey application/x-vnd.Haiku-Time let View 0 of View 2 of View 0 of View 0 of View 0 of Window 0 do 'sync'  # we can't reach any children of the tab-view, but we can script the tab-view itself, make it execute kMsgSynchronize

Will confirm over the next few days

comment:2 by humdinger, 8 years ago

This works too:

hey application/x-vnd.Haiku-Time 'sync' View 2 of View 0 of View 0 of View 0 of Window 0

comment:3 by diver, 8 years ago

Or this: Time --update :P

in reply to:  3 comment:4 by ttcoder, 8 years ago

Thanks to you guys both, and..

Replying to diver:

Or this: Time --update :P

.. holy cow, that's a winner :-) I think I'll file a new ticket titled "please implement -h or --help cli switch" :-)

~/Desktop> Time
~/Desktop> Time --help
~/Desktop> Time --update
Synchronization successful

Anyhow, off to take advantage of that I go

comment:5 by waddlesplash, 7 years ago

I can add that default: block to the MessageReceived switch. Should it be added?

comment:6 by axeld, 7 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:7 by waddlesplash, 7 years ago

Resolution: fixed
Status: assignedclosed

Added default case to switch in hrev51391.

Note: See TracTickets for help on using tickets.