Created
December 17, 2018 15:47
-
-
Save naaando/1058efde2cdc4f4469a1a61892c9c0ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void on_pomodoro_service_started (Pomodoro.State state) { | |
state_label.set_pomodoro_state (state); | |
cancellable = new Cancellable (); | |
Timeout.add (500, () => { | |
timer_label.set_time_in_seconds (pomodoro_service.timer.get_remaining_time ()); | |
return !cancellable.is_cancelled (); | |
}); | |
print (@"Pomodoro started\n"); | |
start_n_stop_stack.visible_child_name = "stop-button"; | |
} | |
void on_pomodoro_service_stopped () { | |
cancellable.cancel (); | |
start_n_stop_stack.visible_child_name = "start-button"; | |
} | |
void on_start_button_clicked () { | |
return_if_fail (pomodoro_service != null); | |
pomodoro_service.start_next (); | |
} | |
void on_stop_button_clicked () { | |
return_if_fail (pomodoro_service != null); | |
pomodoro_service.stop (); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment