-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add import/export of settings.ini file for QML
- Loading branch information
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/gui-qml/src/components/settings/pages/AdvancedSettingsPage.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import QtQuick 2.12 | ||
import QtQuick.Layouts 1.12 | ||
import QtQuick.Dialogs 1.3 | ||
import Qt.labs.platform 1.1 as Labs | ||
|
||
import "../items" | ||
|
||
ColumnLayout { | ||
spacing: 0 | ||
|
||
SettingTitle { | ||
Layout.fillWidth: true | ||
text: qsTr("Backup") | ||
} | ||
SettingItem { | ||
name: qsTr("Export settings") | ||
subtitle: qsTr("Backup the app settings.ini file on your device.") | ||
Layout.fillWidth: true | ||
|
||
onClicked: exportDialog.open() | ||
|
||
FileDialog { | ||
id: exportDialog | ||
|
||
title: qsTr("Please choose a directory") | ||
folder: Labs.StandardPaths.standardLocations(Labs.StandardPaths.DownloadLocation)[0] | ||
selectFolder: true | ||
|
||
onAccepted: backend.exportSettings(backend.toLocalFile(exportDialog.fileUrl.toString() + "/settings.ini")) | ||
} | ||
} | ||
SettingItem { | ||
name: qsTr("Import settings") | ||
subtitle: qsTr("Import the app settings.ini from an existing file.") | ||
Layout.fillWidth: true | ||
|
||
onClicked: importDialog.open() | ||
|
||
FileDialog { | ||
id: importDialog | ||
|
||
title: qsTr("Please choose a file") | ||
folder: Labs.StandardPaths.standardLocations(Labs.StandardPaths.DownloadLocation)[0] | ||
|
||
onAccepted: backend.importSettings(backend.toLocalFile(importDialog.fileUrl.toString())) | ||
} | ||
} | ||
|
||
Item { | ||
Layout.fillHeight: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters