Commit ebb625ab authored by Nicolas Fella's avatar Nicolas Fella

Show backend selection on first run

parent 2f062a84
......@@ -30,6 +30,7 @@ if (ANDROID)
go-up-symbolic
view-refresh
search
dialog-ok
)
else()
target_link_libraries(ktrip PRIVATE Qt5::Widgets)
......
......@@ -4,6 +4,12 @@
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="ktriprc" />
<group name="General">
<entry name="firstRun" type="bool">
<label>First run</label>
<default>true</default>
</entry>
</group>
<group name="Backends">
<entry name="EnabledBackends" type="StringList">
<label>Enabled backends</label>
......
......@@ -84,6 +84,8 @@ int main(int argc, char *argv[])
settings.save();
});
engine.rootContext()->setContextProperty(QStringLiteral("_settings"), &settings);
Formatter formatter;
engine.rootContext()->setContextProperty(QStringLiteral("_formatter"), &formatter);
......
......@@ -30,6 +30,12 @@ Kirigami.ScrollablePage {
visible: true
}
actions.main: Kirigami.Action {
text: i18n("Save")
iconName: "dialog-ok"
onTriggered: pageStack.pop()
}
KPublicTransport.BackendModel {
id: backendModel
manager: _manager
......
......@@ -30,6 +30,14 @@ Kirigami.ApplicationWindow
pageStack.initialPage: Qt.resolvedUrl("JourneyQueryPage.qml")
Component.onCompleted: {
if (_settings.firstRun) {
window.pageStack.push(Qt.resolvedUrl("BackendPage.qml"))
_settings.firstRun = false
_settings.save()
}
}
globalDrawer: Kirigami.GlobalDrawer {
isMenu: true
actions: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment