Opened 4 years ago

Closed 2 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:
Has a Patch: no 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 Changed 4 years ago by ttcoder

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 Changed 4 years ago by humdinger

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 Changed 4 years ago by diver

Or this: Time --update :P

comment:4 in reply to:  3 Changed 4 years ago by ttcoder

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 Changed 3 years ago by waddlesplash

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

comment:6 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:7 Changed 2 years ago by waddlesplash

Resolution: fixed
Status: assignedclosed

Added default case to switch in hrev51391.

Note: See TracTickets for help on using tickets.