stack.arrange(*get_item(widgets, "placeholder"));
add(*(new ClockWidget(clock)));
- clock.signal_minute.connect(sigc::mem_fun(this, &ClockDialog::minute_changed));
+ clock.signal_minute.connect(sigc::mem_fun(this, &ClockDialog::update_time));
+ clock.signal_discontinuity.connect(sigc::mem_fun(this, &ClockDialog::update_time));
+ update_time();
}
-void ClockDialog::minute_changed()
+void ClockDialog::update_time()
{
Time::TimeDelta time = clock.get_current_time();
unsigned hour = time/Time::hour;
driver.signal_power.connect(sigc::mem_fun(this, &MainWindow::power_event));
driver.signal_halt.connect(sigc::mem_fun(this, &MainWindow::halt_event));
- engineer.get_layout().get_clock().signal_minute.connect(sigc::mem_fun(this, &MainWindow::clock_minute));
+ engineer.get_layout().get_clock().signal_minute.connect(sigc::mem_fun(this, &MainWindow::update_clock));
+ engineer.get_layout().get_clock().signal_discontinuity.connect(sigc::mem_fun(this, &MainWindow::update_clock));
}
void MainWindow::set_status_text(const string &txt)
ind_halt->set_active(h);
}
-void MainWindow::clock_minute()
+void MainWindow::update_clock()
{
const Time::TimeDelta &time = engineer.get_layout().get_clock().get_current_time();
unsigned minute = time/Time::min;