← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-alarm-label-fix into lp:ubuntu-clock-app

 

Bartosz Kosiorek has proposed merging lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-alarm-label-fix into lp:ubuntu-clock-app.

Commit message:
 * Fix rat condition of wrong alarm caption (LP: #1530000) 

Requested reviews:
  Jenkins Bot (ubuntu-core-apps-jenkins-bot): continuous-integration
  Ubuntu Clock Developers (ubuntu-clock-dev)

For more details, see:
https://code.launchpad.net/~gang65/ubuntu-clock-app/ubuntu-clock-app-alarm-label-fix/+merge/281414

 * Fix rat condition of wrong alarm caption (LP: #1530000) 
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~gang65/ubuntu-clock-app/ubuntu-clock-app-alarm-label-fix into lp:ubuntu-clock-app.
=== modified file 'app/alarm/AlarmDelegate.qml'
--- app/alarm/AlarmDelegate.qml	2015-12-11 02:13:16 +0000
+++ app/alarm/AlarmDelegate.qml	2015-12-30 01:08:50 +0000
@@ -85,11 +85,10 @@
 
                 fontSize: "small"
                 Layout.fillWidth: true
-                visible: !(type === Alarm.OneTime && !model.enabled)
+                visible: model.enabled && (model.status === Alarm.Ready)
                 elide: Text.ElideRight
                 text: type === Alarm.Repeating ? alarmUtils.format_day_string(daysOfWeek, type)
-                                               : model.enabled ? alarmUtils.get_time_to_alarm(model.date, localTime)
-                                                               : "Alarm Disabled"
+                                               : alarmUtils.get_time_to_alarm(model.date, localTime)
 
                 function animateTextChange() {
                     textChangeAnimation.start()
@@ -124,6 +123,7 @@
     Switch {
         id: alarmStatus
         objectName: "listAlarmStatus" + index
+        checked: model.enabled && (model.status === Alarm.Ready)
 
         anchors {
             right: parent.right
@@ -153,28 +153,5 @@
                 alarmData.save()
             }
         }
-
-        Connections {
-            target: model
-            onStatusChanged: {
-                /*
-                 Update switch value only when the alarm save() operation
-                 is complete to avoid switching it back.
-                */
-                if (model.status === Alarm.Ready) {
-                    alarmStatus.checked = model.enabled;
-
-                    if (!alarmStatus.checked && type === Alarm.Repeating) {
-                        alarmSubtitle.text = alarmUtils.format_day_string(daysOfWeek, type)
-                    }
-                }
-            }
-        }
-
-        /*
-         Assign switch value only once at startup. After this, the switch will
-         be updated after the alarm save() operations only.
-        */
-        Component.onCompleted: alarmStatus.checked = model.enabled
     }
 }

=== modified file 'debian/changelog'
--- debian/changelog	2015-12-16 21:46:11 +0000
+++ debian/changelog	2015-12-30 01:08:50 +0000
@@ -1,11 +1,12 @@
-ubuntu-clock-app (3.7) UNRELEASED; urgency=medium
+ubuntu-clock-app (3.7ubuntu1) UNRELEASED; urgency=medium
 
   [ Bartosz Kosiorek ]
   * Fix alarm difference time description, during DST change (LP: #1510694)
   * Move to use the new SDK components v1.3 (LP: #1508363)
   * Fix continously move the alarm volume slider to the desired value (LP: #1492584)  
+  * Fix rat condition of wrong alarm caption (LP: #1530000) 
 
- -- Bartosz Kosiorek <gang65@xxxxxxxxxxxxxx>  Wed, 16 Dec 2015 22:44:49 +0100
+ -- Bartosz Kosiorek <gang65@xxxxxxxxxxxxxx>  Wed, 30 Dec 2015 01:43:24 +0100
 
 ubuntu-clock-app (3.6)  vivid; urgency=medium