Merge lp:~stolowski/unity-api/value-slider-iface into lp:unity-api

Proposed by Paweł Stołowski on 2015-11-24
Status: Merged
Approved by: Albert Astals Cid on 2016-02-25
Approved revision: 214
Merged at revision: 216
Proposed branch: lp:~stolowski/unity-api/value-slider-iface
Merge into: lp:unity-api
Prerequisite: lp:~stolowski/unity-api/range-input-filter-iface
Diff against target: 158 lines (+137/-1)
3 files modified
include/unity/shell/scopes/FiltersInterface.h (+2/-1)
include/unity/shell/scopes/ValueSliderFilterInterface.h (+73/-0)
include/unity/shell/scopes/ValueSliderValuesInterface.h (+62/-0)
To merge this branch: bzr merge lp:~stolowski/unity-api/value-slider-iface
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve on 2016-02-25
Albert Astals Cid (community) 2015-11-24 Approve on 2016-02-25
Review via email: mp+278428@code.launchpad.net

Commit Message

ValueSliderFilter interface.

Description of the Change

ValueSliderFilter interface.

To post a comment you must log in.
Albert Astals Cid (aacid) wrote :

Looks good

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:214
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-1-ci/26/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/652
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/675
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/693
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/693
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/689/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/689
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/689/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-1-ci/26/rebuild

review: Approve (continuous-integration)
215. By Paweł Stołowski on 2016-03-10

Merge range-input-filter-iface

216. By Paweł Stołowski on 2016-03-11

Merged range-input-filter-iface

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/shell/scopes/FiltersInterface.h'
2--- include/unity/shell/scopes/FiltersInterface.h 2016-03-11 12:03:13 +0000
3+++ include/unity/shell/scopes/FiltersInterface.h 2016-03-11 12:03:13 +0000
4@@ -45,7 +45,8 @@
5 enum FilterType {
6 Invalid,
7 OptionSelectorFilter,
8- RangeInputFilter
9+ RangeInputFilter,
10+ ValueSliderFilter
11 // TODO add remaining filters
12 };
13
14
15=== added file 'include/unity/shell/scopes/ValueSliderFilterInterface.h'
16--- include/unity/shell/scopes/ValueSliderFilterInterface.h 1970-01-01 00:00:00 +0000
17+++ include/unity/shell/scopes/ValueSliderFilterInterface.h 2016-03-11 12:03:13 +0000
18@@ -0,0 +1,73 @@
19+/*
20+ * Copyright (C) 2015 Canonical, Ltd.
21+ *
22+ * This program is free software; you can redistribute it and/or modify
23+ * it under the terms of the GNU General Public License as published by
24+ * the Free Software Foundation; version 3.
25+ *
26+ * This program is distributed in the hope that it will be useful,
27+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
28+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29+ * GNU General Public License for more details.
30+ *
31+ * You should have received a copy of the GNU General Public License
32+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
33+ */
34+
35+#ifndef UNITY_SHELL_SCOPES_VALUESLIDERFILTERINTERFACE_H
36+#define UNITY_SHELL_SCOPES_VALUESLIDERFILTERINTERFACE_H
37+
38+#include <unity/SymbolExport.h>
39+
40+#include "FilterBaseInterface.h"
41+#include "ValueSliderValuesInterface.h"
42+
43+namespace unity
44+{
45+namespace shell
46+{
47+namespace scopes
48+{
49+
50+class UNITY_API ValueSliderFilterInterface : public FilterBaseInterface
51+{
52+ Q_OBJECT
53+
54+public:
55+ Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged)
56+ Q_PROPERTY(unity::shell::scopes::ValueSliderValuesInterface* values READ values NOTIFY valuesChanged)
57+ Q_PROPERTY(double minValue READ minValue NOTIFY minValueChanged)
58+ Q_PROPERTY(double maxValue READ maxValue NOTIFY maxValueChanged)
59+
60+public:
61+ FiltersInterface::FilterType filterType() const override
62+ {
63+ return FiltersInterface::ValueSliderFilter;
64+ }
65+
66+ virtual double value() const = 0;
67+ virtual void setValue(double) = 0;
68+ virtual double minValue() const = 0;
69+ virtual double maxValue() const = 0;
70+ virtual ValueSliderValuesInterface* values() const = 0;
71+
72+Q_SIGNALS:
73+ void valueChanged();
74+ void valuesChanged();
75+ void minValueChanged();
76+ void maxValueChanged();
77+
78+protected:
79+ /// @cond
80+ explicit ValueSliderFilterInterface(QObject* parent = 0) : FilterBaseInterface(parent) {}
81+ /// @endcond
82+};
83+
84+}
85+
86+}
87+}
88+
89+Q_DECLARE_METATYPE(unity::shell::scopes::ValueSliderFilterInterface*)
90+
91+#endif
92
93=== added file 'include/unity/shell/scopes/ValueSliderValuesInterface.h'
94--- include/unity/shell/scopes/ValueSliderValuesInterface.h 1970-01-01 00:00:00 +0000
95+++ include/unity/shell/scopes/ValueSliderValuesInterface.h 2016-03-11 12:03:13 +0000
96@@ -0,0 +1,62 @@
97+/*
98+ * Copyright (C) 2015 Canonical, Ltd.
99+ *
100+ * This program is free software; you can redistribute it and/or modify
101+ * it under the terms of the GNU General Public License as published by
102+ * the Free Software Foundation; version 3.
103+ *
104+ * This program is distributed in the hope that it will be useful,
105+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
106+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107+ * GNU General Public License for more details.
108+ *
109+ * You should have received a copy of the GNU General Public License
110+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
111+ */
112+
113+#ifndef UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H
114+#define UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H
115+
116+#include <unity/SymbolExport.h>
117+#include <QAbstractListModel>
118+
119+namespace unity
120+{
121+namespace shell
122+{
123+namespace scopes
124+{
125+
126+class UNITY_API ValueSliderValuesInterface : public QAbstractListModel
127+{
128+ Q_OBJECT
129+
130+ Q_ENUMS(SliderValueRoles)
131+
132+public:
133+ enum Roles {
134+ RoleValue = Qt::UserRole + 1,
135+ RoleLabel
136+ };
137+
138+ QHash<int, QByteArray> roleNames() const override
139+ {
140+ QHash<int, QByteArray> roles;
141+ roles[RoleValue] = "value";
142+ roles[RoleLabel] = "label";
143+ return roles;
144+ }
145+
146+protected:
147+ /// @cond
148+ explicit ValueSliderValuesInterface(QObject* parent = 0) : QAbstractListModel(parent) {}
149+ /// @endcond
150+};
151+
152+}
153+}
154+}
155+
156+Q_DECLARE_METATYPE(unity::shell::scopes::ValueSliderValuesInterface*)
157+
158+#endif

Subscribers

People subscribed via source and target branches

to all changes: