on xenial help sign in
move the app store uri to a gsetting
cfcde21Michael Zanetti
data/com.canonical.Unity8.gschema.xml+5
@@ -53,6 +53,11 @@
53 <summary>Enable or disable the indicator pull down menus</summary>
53 <summary>Enable or disable the indicator pull down menus</summary>
54 <description>Toggle the availability of the indicator pull down menus</description>
54 <description>Toggle the availability of the indicator pull down menus</description>
55 </key>
55 </key>
56+ <key type="s" name="appstore-uri">
57+ <default>'scope://com.canonical.scopes.clickstore'</default>
58+ <summary>The uri to the app store</summary>
59+ <description>This will be used whenever the user triggers an action to open the app store.</description>
60+ </key>
56 </schema>
61 </schema>
57
62
58 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
63 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
qml/Launcher/MoreAppsHeader.qml+7−2
@@ -1,12 +1,17 @@
1import QtQuick 2.4
1import QtQuick 2.4
2import Ubuntu.Components 1.3
2import Ubuntu.Components 1.3
3+import GSettings 1.0
3
4
4AbstractButton {
5AbstractButton {
5 id: root
6 id: root
6
7
8+ GSettings {
9+ id: settings
10+ schema.id: "com.canonical.Unity8"
11+ }
12+
7 onClicked: {
13 onClicked: {
8− // TODO: Make this point to the snappy store as soon as we stop landing to vivid
9− Qt.openUrlExternally("scope://com.canonical.scopes.clickstore")
14+ Qt.openUrlExternally(settings.appstoreUri)
10 }
15 }
11
16
12 UbuntuShape {
17 UbuntuShape {
tests/mocks/GSettings.1.0/fake_gsettings.cpp+14
@@ -29,6 +29,7 @@ GSettingsControllerQml::GSettingsControllerQml()
29 , m_edgeDragWidth(2)
29 , m_edgeDragWidth(2)
30 , m_enableLauncher(true)
30 , m_enableLauncher(true)
31 , m_enableIndicatorMenu(true)
31 , m_enableIndicatorMenu(true)
32+ , m_appstoreUri("http://uappexplorer.com")
32{
33{
33}
34}
34
35
@@ -173,6 +174,11 @@ void GSettingsControllerQml::setEnableIndicatorMenu(bool enableIndicatorMenu)
173 }
174 }
174}
175}
175
176
177+QString GSettingsControllerQml::appstoreUri() const
178+{
179+ return m_appstoreUri;
180+}
181+
176GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
182GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
177}
183}
178
184
@@ -376,6 +382,14 @@ QVariant GSettingsQml::enableIndicatorMenu() const
376 }
382 }
377}
383}
378
384
385+QVariant GSettingsQml::appstoreUri() const
386+{
387+ if (m_valid && m_schema->id() == "com.canonical.Unity8") {
388+ return GSettingsControllerQml::instance()->appstoreUri();
389+ }
390+ return QVariant();
391+}
392+
379void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds)
393void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds)
380{
394{
381 if (m_valid && m_schema->id() == "com.canonical.qtmir") {
395 if (m_valid && m_schema->id() == "com.canonical.qtmir") {
tests/mocks/GSettings.1.0/fake_gsettings.h+7
@@ -59,6 +59,7 @@ class GSettingsQml: public QObject, public QQmlParserStatus
59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
60 Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged)
60 Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged)
61 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
61 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
62+ Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged)
62
63
63public:
64public:
64 GSettingsQml(QObject *parent = nullptr);
65 GSettingsQml(QObject *parent = nullptr);
@@ -77,6 +78,7 @@ public:
77 QVariant edgeDragWidth() const;
78 QVariant edgeDragWidth() const;
78 QVariant enableLauncher() const;
79 QVariant enableLauncher() const;
79 QVariant enableIndicatorMenu() const;
80 QVariant enableIndicatorMenu() const;
81+ QVariant appstoreUri() const;
80
82
81 void setDisableHeight(const QVariant &val);
83 void setDisableHeight(const QVariant &val);
82 void setPictureUri(const QVariant &str);
84 void setPictureUri(const QVariant &str);
@@ -101,6 +103,7 @@ Q_SIGNALS:
101 void edgeDragWidthChanged();
103 void edgeDragWidthChanged();
102 void enableLauncherChanged();
104 void enableLauncherChanged();
103 void enableIndicatorMenuChanged();
105 void enableIndicatorMenuChanged();
106+ void appstoreUriChanged();
104
107
105private:
108private:
106 GSettingsSchemaQml* m_schema;
109 GSettingsSchemaQml* m_schema;
@@ -147,6 +150,8 @@ public:
147 bool enableIndicatorMenu() const;
150 bool enableIndicatorMenu() const;
148 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
151 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
149
152
153+ QString appstoreUri() const;
154+
150Q_SIGNALS:
155Q_SIGNALS:
151 void disableHeightChanged();
156 void disableHeightChanged();
152 void pictureUriChanged(const QString&);
157 void pictureUriChanged(const QString&);
@@ -158,6 +163,7 @@ Q_SIGNALS:
158 void edgeDragWidthChanged(uint edgeDragWidth);
163 void edgeDragWidthChanged(uint edgeDragWidth);
159 void enableLauncherChanged(bool enableLauncher);
164 void enableLauncherChanged(bool enableLauncher);
160 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
165 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
166+ void appstoreUriChanged(const QString &appstoreUri);
161
167
162private:
168private:
163 GSettingsControllerQml();
169 GSettingsControllerQml();
@@ -172,6 +178,7 @@ private:
172 uint m_edgeDragWidth;
178 uint m_edgeDragWidth;
173 bool m_enableLauncher;
179 bool m_enableLauncher;
174 bool m_enableIndicatorMenu;
180 bool m_enableIndicatorMenu;
181+ QString m_appstoreUri;
175
182
176 static GSettingsControllerQml* s_controllerInstance;
183 static GSettingsControllerQml* s_controllerInstance;
177 QList<GSettingsQml *> m_registeredGSettings;
184 QList<GSettingsQml *> m_registeredGSettings;