[Merge] lp:~phablet-team/ubuntu-ui-toolkit/ubuntu-ui-toolkit-progressbar-label into lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Zsombor Egri zsombor.egri at canonical.com
Fri Jun 27 05:55:24 UTC 2014


Review: Needs Fixing

See inline comments.

Diff comments:

> === modified file 'components.api'
> --- components.api	2014-06-24 08:42:47 +0000
> +++ components.api	2014-06-26 14:05:15 +0000
> @@ -384,6 +384,9 @@
>      property real minimumValue
>      property real maximumValue
>      property real value
> +ProgressBar 1.1
> +ProgressBar
> +    property bool showProgressPercentage
>  Scrollbar 0.1 1.0
>  StyledItem
>      property Flickable flickableItem
> 
> === modified file 'examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml'
> --- examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml	2014-04-23 09:39:11 +0000
> +++ examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml	2014-06-26 14:05:15 +0000
> @@ -15,7 +15,7 @@
>   */
>  
>  import QtQuick 2.0
> -import Ubuntu.Components 0.1
> +import Ubuntu.Components 1.1
>  
>  Template {
>      objectName: "progressBarsTemplate"
> @@ -53,6 +53,27 @@
>                  indeterminate: true
>              }
>          }
> +
> +        TemplateRow {
> +            title: i18n.tr("No label")
> +
> +            ProgressBar {
> +                id: progressNoLabel
> +                objectName: "progressbar_nolabel"
> +                width: parent.width
> +                showProgressPercentage: false
> +
> +                SequentialAnimation on value {
> +                    loops: Animation.Infinite
> +                    NumberAnimation {
> +                        from: progress.minimumValue
> +                        to: progress.maximumValue
> +                        duration: 2000
> +                    }
> +                    PauseAnimation {duration: 1000}
> +                }
> +            }
> +        }
>      }
>  
>      TemplateSection {
> 
> === renamed file 'modules/Ubuntu/Components/ProgressBar.qml' => 'modules/Ubuntu/Components/ProgressBar10.qml'
> === added file 'modules/Ubuntu/Components/ProgressBar11.qdoc'
> --- modules/Ubuntu/Components/ProgressBar11.qdoc	1970-01-01 00:00:00 +0000
> +++ modules/Ubuntu/Components/ProgressBar11.qdoc	2014-06-26 14:05:15 +0000
> @@ -0,0 +1,6 @@
> +/*!
> +\qmlproperty bool ProgressBar::showProgressPercentage
> +\since Ubuntu.Components 1.1
> +
> +Specifies if the value of the progress is visible
> +*/
> 
> === added file 'modules/Ubuntu/Components/ProgressBar11.qml'
> --- modules/Ubuntu/Components/ProgressBar11.qml	1970-01-01 00:00:00 +0000
> +++ modules/Ubuntu/Components/ProgressBar11.qml	2014-06-26 14:05:15 +0000
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright 2014 Canonical Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published by
> + * the Free Software Foundation; version 3.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +import QtQuick 2.0
> +
> +ProgressBar {
> +    property bool showProgressPercentage: true
> +}
> 
> === modified file 'modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml'
> --- modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml	2014-04-23 08:50:20 +0000
> +++ modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml	2014-06-26 14:05:15 +0000
> @@ -56,6 +56,7 @@
>          color: Theme.palette.normal.baseText
>          text: progressBar.indeterminate ? i18n.tr("In Progress")
>                : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0))
> +        visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
>  
>          SequentialAnimation on opacity {
>              loops: Animation.Infinite
> @@ -76,5 +77,6 @@
>          rightColor: Theme.palette.normal.baseText
>          progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width
>          mirror: Qt.application.layoutDirection == Qt.RightToLeft
> +        visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
>      }
>  }
> 
> === modified file 'modules/Ubuntu/Components/qmldir'
> --- modules/Ubuntu/Components/qmldir	2014-05-28 18:08:33 +0000
> +++ modules/Ubuntu/Components/qmldir	2014-06-26 14:05:15 +0000
> @@ -15,7 +15,7 @@
>  Label 0.1 Label.qml
>  AbstractButton 0.1 AbstractButton.qml
>  ActivityIndicator 0.1 ActivityIndicator.qml
> -ProgressBar 0.1 ProgressBar.qml
> +ProgressBar 0.1 ProgressBar10.qml
>  TextField 0.1 TextField.qml
>  TextArea 0.1 TextArea.qml
>  Switch 0.1 Switch.qml
> @@ -64,7 +64,7 @@
>  Label 1.0 Label.qml
>  AbstractButton 1.0 AbstractButton.qml
>  ActivityIndicator 1.0 ActivityIndicator.qml
> -ProgressBar 1.0 ProgressBar.qml
> +ProgressBar 1.0 ProgressBar10.qml
>  TextField 1.0 TextField.qml
>  TextArea 1.0 TextArea.qml
>  Switch 1.0 Switch.qml
> @@ -92,3 +92,4 @@
>  
>  #version 1.1
>  ComboButton 1.1 ComboButton.qml
> +ProgressBar 1.1 ProgressBar11.qml
> 
> === modified file 'tests/unit/tst_components/tst_progressbar.qml'
> --- tests/unit/tst_components/tst_progressbar.qml	2014-04-23 08:50:20 +0000
> +++ tests/unit/tst_components/tst_progressbar.qml	2014-06-26 14:05:15 +0000
> @@ -28,6 +28,17 @@
>           compare(progressBar.indeterminate,newIndeterminated,"can set/get")
>       }
>  
> +     function test_showProgressPercentageExists() {

I think we should have these tests in separate test suites: one for 0.1/1.0 and one for 1.1.

> +         verify(progressBar.hasOwnProperty("showProgressPercentage"), "Property missing")
> +     }
> +
> +     function test_noLabel() {
> +         compare(progressBar.showProgressPercentage,true,"is set by default")
> +         var newShowProgressPercentage = false
> +         progressBar.showProgressPercentage = newShowProgressPercentage
> +         compare(progressBar.showProgressPercentage, newShowProgressPercentage,"can set/get")
> +     }
> +
>       function test_maximumValue() {
>           compare(progressBar.maximumValue,1.0,"is set to 1.0 by default")
>           var newMaximumValue = 20.0
> 


-- 
https://code.launchpad.net/~phablet-team/ubuntu-ui-toolkit/ubuntu-ui-toolkit-progressbar-label/+merge/224427
Your team Ubuntu Phablet Team is subscribed to branch lp:~phablet-team/ubuntu-ui-toolkit/ubuntu-ui-toolkit-progressbar-label.



More information about the Ubuntu-reviews mailing list