[gnome-clocks] Stopwatch: fix initial state
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Stopwatch: fix initial state
- Date: Fri, 22 Feb 2013 13:47:25 +0000 (UTC)
commit ba4702e9c91cec2187547c294b9a6e0724c44e54
Author: Stefano Facchini <stefano facchini gmail com>
Date: Fri Feb 22 14:42:33 2013 +0100
Stopwatch: fix initial state
Make the "reset" button insensitive initially, and properly reset
last_lap_time.
src/stopwatch.vala | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/stopwatch.vala b/src/stopwatch.vala
index 6abe129..e74c694 100644
--- a/src/stopwatch.vala
+++ b/src/stopwatch.vala
@@ -49,11 +49,8 @@ public class MainPanel : Gtk.Box, Clocks.Clock {
public MainPanel (Toolbar toolbar) {
Object (label: _("Stopwatch"), toolbar: toolbar);
- state = State.RESET;
timer = new GLib.Timer ();
timeout_id = 0;
- current_lap = 0;
- last_lap_time = 0;
var builder = Utils.load_ui ("stopwatch.ui");
@@ -64,8 +61,6 @@ public class MainPanel : Gtk.Box, Clocks.Clock {
laps_model = builder.get_object ("laps_model") as Gtk.ListStore;
laps_view = builder.get_object ("laps_view") as Gtk.TreeView;
- update_time_label ();
-
left_button.clicked.connect (on_left_button_clicked);
right_button.clicked.connect (on_right_button_clicked);
@@ -82,6 +77,8 @@ public class MainPanel : Gtk.Box, Clocks.Clock {
}
});
+ reset ();
+
add (stopwatch_panel);
show_all ();
}
@@ -147,6 +144,7 @@ public class MainPanel : Gtk.Box, Clocks.Clock {
left_button.get_style_context ().add_class ("clocks-go");
right_button.set_sensitive (false);
current_lap = 0;
+ last_lap_time = 0;
laps_model.clear ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]