[gnome-clocks/bilelmoussaoui/timer/i18n: 49/49] Timer: remove the default name
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/bilelmoussaoui/timer/i18n: 49/49] Timer: remove the default name
- Date: Wed, 26 Feb 2020 17:56:42 +0000 (UTC)
commit 8490fc25333942579525035ab20ee0c3527b5dcb
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Sat Feb 22 20:17:24 2020 +0100
Timer: remove the default name
Fixes #68 #63
src/timer.vala | 29 ++++-------------------------
1 file changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/src/timer.vala b/src/timer.vala
index 2ea8342..aa41a07 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013 Paolo Borelli <pborelli gnome org>
* Copyright (C) 2020 Bilal Elmoussaoui <bilal elmoussaoui gnome org>
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -258,6 +258,8 @@ public class Row : Gtk.ListBoxRow {
title.text = _item.name;
title.bind_property ("text", _item, "name");
+ timer_name.label = _item.name;
+ title.bind_property ("text", timer_name, "label");
_item.notify["name"].connect (() => edited ());
}
@@ -299,6 +301,7 @@ public class Row : Gtk.ListBoxRow {
item.reset.connect (() => this.reset ());
delete_button.clicked.connect (() => deleted ());
+
reset ();
}
@@ -327,7 +330,6 @@ public class Row : Gtk.ListBoxRow {
start_stack.visible_child_name = "start";
name_stack.visible_child_name = "edit";
- update_name_label ();
update_countdown (item.hours, item.minutes, item.seconds);
}
@@ -341,8 +343,6 @@ public class Row : Gtk.ListBoxRow {
start_stack.visible_child_name = "pause";
name_stack.visible_child_name = "display";
-
- update_name_label ();
}
private void ring () {
@@ -366,27 +366,6 @@ public class Row : Gtk.ListBoxRow {
countdown_label.set_text ("%02i ∶ %02i ∶ %02i".printf (h, m, s));
}
- private void update_name_label () {
- if (item.name != null && item.name != "") {
- timer_name.label = item.name;
- } else {
- if (item.seconds != 0 && item.minutes == 0 && item.hours == 0) {
- timer_name.label = _("%i second timer".printf (item.seconds));
- } else if (item.seconds == 0 && item.minutes != 0 && item.hours == 0) {
- timer_name.label = _("%i minute timer".printf (item.minutes));
- } else if (item.seconds == 0 && item.minutes == 0 && item.hours != 0) {
- timer_name.label = _("%i hour timer".printf (item.hours));
- } else if (item.seconds != 0 && item.minutes != 0 && item.hours == 0) {
- timer_name.label = _("%i minute %i second timer".printf (item.minutes, item.seconds));
- } else if (item.seconds == 0 && item.minutes != 0 && item.hours != 0) {
- timer_name.label = _("%i hour %i minute timer".printf (item.hours, item.minutes));
- } else if (item.seconds != 0 && item.minutes == 0 && item.hours != 0) {
- timer_name.label = _("%i hour %i second timer".printf (item.hours, item.seconds));
- } else if (item.seconds != 0 && item.minutes != 0 && item.hours != 0) {
- timer_name.label = _("%i hour %i minute %i second timer".printf (item.hours, item.minutes,
item.seconds));
- }
- }
- }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]