Skip to content

Instantly share code, notes, and snippets.

@naaando
Created December 17, 2018 15:40
Show Gist options
  • Save naaando/24dff4e4f53756d0a3075196a2d5ddaa to your computer and use it in GitHub Desktop.
Save naaando/24dff4e4f53756d0a3075196a2d5ddaa to your computer and use it in GitHub Desktop.
public virtual signal void start (State state = State.WORKING) {
running = true;
if (current_pomodoro != null) {
current_pomodoro.end ();
}
current_pomodoro = new Pomodoro (state);
seq.push_state (state);
if (timer != null) {
timer.cancel ();
}
timer = create_timer (state);
timer.finished.connect (() => stop ());
timer.start ();
}
public signal void started (State state);
public void start (State state = State.WORKING) {
started ();
running = true;
if (current_pomodoro != null) {
current_pomodoro.end ();
}
current_pomodoro = new Pomodoro (state);
seq.push_state (state);
if (timer != null) {
timer.cancel ();
}
timer = create_timer (state);
timer.finished.connect (() => stop ());
timer.start ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment