Feature #297

Add configuration option for setting initial time, including DST

Added by Hammel over 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:14 Mar 2014
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:04 - Root File System
Target version:0.10.0
Severity:04 - Low

Description

I need to understand better how to set this. An initial version would be brute force: set the time and enable/disable DST.

ntpd does set the time on the board if its left running for a while with a network connection. But it should be possible to initialize that time stamp and set the DST.

I need to know how to tell ntp to use DST.

Associated revisions

Revision e47cf99d
Added by Hammel almost 3 years ago

RM #297: Initial import of PiClock.

Revision e47cf99d
Added by Hammel almost 3 years ago

RM #297: Initial import of PiClock.

Revision 9596fc3c
Added by Hammel almost 3 years ago

RM #297: Added a real custom widget that draws the analog clock. This is a merger of the ZetCode custom widget example and the clockwidget example I found on github (appropriate credit provided).

Revision 9596fc3c
Added by Hammel almost 3 years ago

RM #297: Added a real custom widget that draws the analog clock. This is a merger of the ZetCode custom widget example and the clockwidget example I found on github (appropriate credit provided).

Revision 0d9644ae
Added by Hammel almost 3 years ago

RM #297: Moved labels after spinners to match checkbox behaviour. Updated comments.

Revision 0d9644ae
Added by Hammel almost 3 years ago

RM #297: Moved labels after spinners to match checkbox behaviour. Updated comments.

Revision 26f46b95
Added by Hammel almost 3 years ago

RM #297: Add keyboard navigation to calendar widget. Add callbacks for spinners to set clock. Add apply and home buttons.

Revision 26f46b95
Added by Hammel almost 3 years ago

RM #297: Add keyboard navigation to calendar widget. Add callbacks for spinners to set clock. Add apply and home buttons.

Revision dc9aec3c
Added by Hammel almost 3 years ago

RM #297: Removed unused code brought from videofe template. Merged callbacks when changing hour/minute/pm. Fixed hour hand bug in gtk_piclock_set_time().

Revision dc9aec3c
Added by Hammel almost 3 years ago

RM #297: Removed unused code brought from videofe template. Merged callbacks when changing hour/minute/pm. Fixed hour hand bug in gtk_piclock_set_time().

Revision 9f174121
Added by Hammel almost 3 years ago

RM #297: Fix keyboard navigation to use Ctrl-<arrow keys> for month and year. That's more consistant with the arrow key usage of moving around the days of the month.

Revision 9f174121
Added by Hammel almost 3 years ago

RM #297: Fix keyboard navigation to use Ctrl-<arrow keys> for month and year. That's more consistant with the arrow key usage of moving around the days of the month.

Revision 15dfd76e
Added by Hammel almost 3 years ago

RM #297: Fix typos in opkg'ing Makefile.

Revision 15dfd76e
Added by Hammel almost 3 years ago

RM #297: Fix typos in opkg'ing Makefile.

Revision 30fc9655
Added by Hammel almost 3 years ago

RM #297: Fix initalization of hour spinner. Update system time with every user update.

Revision 30fc9655
Added by Hammel almost 3 years ago

RM #297: Fix initalization of hour spinner. Update system time with every user update.

Revision 210e4de7
Added by Hammel almost 3 years ago

RM #297: Add icon and splash image. Updated template.

Revision 210e4de7
Added by Hammel almost 3 years ago

RM #297: Add icon and splash image. Updated template.

Revision 8df9e9c9
Added by Hammel almost 3 years ago

RM #297: Adjusted layout of settings column UI components. Added sample gtkrc to be able to test appearance similar to what the default PiBox Media Server UI looks like.

Revision 8df9e9c9
Added by Hammel almost 3 years ago

RM #297: Adjusted layout of settings column UI components. Added sample gtkrc to be able to test appearance similar to what the default PiBox Media Server UI looks like.

Revision 5a67cda9
Added by Hammel almost 3 years ago

RM #297: Switched to settimeofday() to see if that works better than stime().

Revision 5a67cda9
Added by Hammel almost 3 years ago

RM #297: Switched to settimeofday() to see if that works better than stime().

Revision e4b9c6b6
Added by Hammel almost 3 years ago

RM #297: Potential fix for setting time. A struct is updated by a callback but the actual time change is haned in a g_timer to avoid problems with setting the time inside the gtk callback.

Revision e4b9c6b6
Added by Hammel almost 3 years ago

RM #297: Potential fix for setting time. A struct is updated by a callback but the actual time change is haned in a g_timer to avoid problems with setting the time inside the gtk callback.

Revision b1645547
Added by Hammel almost 3 years ago

RM #297: Switch top level layout to a table to help in centering time setting UI components on the right.

Revision b1645547
Added by Hammel almost 3 years ago

RM #297: Switch top level layout to a table to help in centering time setting UI components on the right.

Revision 2313235b
Added by Hammel almost 3 years ago

RM #297: Renamed remaining "clock" functions to "piclock" for consistency.

Revision 2313235b
Added by Hammel almost 3 years ago

RM #297: Renamed remaining "clock" functions to "piclock" for consistency.

Revision 7e97f5f7
Added by Hammel almost 3 years ago

RM #297: Moved system clock setting to right before exit, to remove time changes from UI code. Fixed bug where changing the day of the month was not updating the system clock.

Revision 7e97f5f7
Added by Hammel almost 3 years ago

RM #297: Moved system clock setting to right before exit, to remove time changes from UI code. Fixed bug where changing the day of the month was not updating the system clock.

Revision cca833be
Added by Hammel almost 3 years ago

RM #297: Fixed problem with piclock exits causing a restart immediately by having the ENTER key queued and passed to the launcher. The way around this was to use a different key to activate the Home button in piclock - in this case the space bar - so that the queued key doesn't active the launcher on piclock's exit.

Revision cca833be
Added by Hammel almost 3 years ago

RM #297: Fixed problem with piclock exits causing a restart immediately by having the ENTER key queued and passed to the launcher. The way around this was to use a different key to activate the Home button in piclock - in this case the space bar - so that the queued key doesn't active the launcher on piclock's exit.

History

#1 Updated by Hammel over 3 years ago

  • Priority changed from Normal to Urgent
  • Severity changed from 03 - Medium to 04 - Low

#2 Updated by Hammel over 3 years ago

  • Priority changed from Urgent to Normal
  • Target version changed from 0.9.0 to 0.10.0

Moving configuration tools to 0.10.0.

#3 Updated by Hammel almost 3 years ago

  • Priority changed from Normal to Immediate

#4 Updated by Hammel almost 3 years ago

This is just another app. I can use videofe as a template. This app needs the following components:
  • Spinners
    • Year
    • Month
    • Day
    • Hour
    • Minute
  • AM/PM Slider (left or right enables respective values)
  • DST Slider (on or off)

Year/month/day may also be set using a GtkCalendar.

I see this as having configuration in a left panel and an analog clock in the right.

I might create special widgets for these. ZetCode has an example using Cairo for creating a custom widget. There is a gtk clock widget available on github that is integrated with cairo as well as a real cairo-based clock (overly complex glade+svg design, but source is 1 file). And there is a cairo clock tutorial on developer.gnome.org but its for gtkmm.

#5 Updated by Hammel almost 3 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

Most of this is now implemented in the piclock app. This merges a proper GTK+ widget structure (as described in ZetCode) with the Cairo-based clock (found on github) and adds configuration options to it.

The app is very primitive. It does handle navigation using arrow keys just fine.

Additional work to be done:
  1. Add month, day, year under the clock in larger font.
  2. The analog clock works fine but could use a theme (background image over which the hands are drawn).
  3. The clock hands are blocky - could be cleaned up with some cairo magic - and should color coordinate with any background image (just use a config option for colors).
  4. There is no DST option yet (but do we really need it?).
  5. Apply button doesn't change the time on the system yet.

#6 Updated by Hammel almost 3 years ago

  • % Done changed from 50 to 80

Didn't do much of those last things but I did add the icon and splash images and fixed packaging, along with various other minor nits and bugs.

I installed the opkg tonight and tested it for the first time as an app. It works perfectly except the time, which is being set with stime(), doesn't change. I may need to switch to settimeofday().

#7 Updated by Hammel almost 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

It took some experimenting but I finally got piclock to behave properly. I have to use the space bar to activate the home button but that's a minor price to pay. Overall, the settings app works well now.

Closing issue.

Also available in: Atom PDF