Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added Vault QML component usage template
Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
- Loading branch information
Denis Zalevskiy
committed
Oct 26, 2015
1 parent
a27e19b
commit 12ca8e2
Showing
1 changed file
with
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import QtQuick 2.0 | ||
import NemoMobile.Vault 1.1 | ||
|
||
QtObject { | ||
property Vault vault: Vault { | ||
onDone: vaultOperationDone(operation, data) | ||
onProgress: vaultOperationProgress(operation, data) | ||
onError: vaultOperationError(operation, error) | ||
onData: vaultData(id, context) | ||
} | ||
|
||
// event handlers | ||
|
||
function vaultOperationDone(operation, data) { | ||
console.log("vault operation", operation, "done") | ||
var action | ||
switch (operation) { | ||
case Vault.Connect: | ||
break | ||
case Vault.Maintenance: | ||
break | ||
case Vault.Backup: | ||
break | ||
case Vault.Restore: | ||
break | ||
case Vault.RemoveSnapshot: | ||
break | ||
case Vault.ExportSnapshot: | ||
console.log("snapshot exporting is done" | ||
, data.rc, data.snapshot, data.dst | ||
, data.stdout, data.stderr) | ||
break | ||
case Vault.ExportImportPrepare: | ||
break | ||
case Vault.ExportImportExecute: | ||
break | ||
default: | ||
break | ||
} | ||
} | ||
|
||
function vaultData(operation, context) { | ||
switch (operation) { | ||
case Vault.SnapshotUnits: | ||
break | ||
case Vault.Snapshots: | ||
break | ||
case Vault.Units: | ||
break | ||
default: | ||
break | ||
} | ||
} | ||
|
||
function vaultOperationProgress(operation, data) { | ||
switch (operation) { | ||
case Vault.Backup: | ||
break | ||
case Vault.Restore: | ||
break | ||
case Vault.ExportImportExecute: | ||
break | ||
default: | ||
break | ||
} | ||
} | ||
|
||
function vaultOperationError(operation, error) { | ||
console.log("vault operation", operation, "error") | ||
switch (operation) { | ||
case Vault.Connect: | ||
break | ||
case Vault.Backup: | ||
break | ||
case Vault.Restore: | ||
break | ||
case Vault.RemoveSnapshot: | ||
break | ||
case Vault.ExportImportPrepare: | ||
break | ||
case Vault.ExportImportExecute: | ||
break | ||
case Vault.ExportSnapshot: | ||
console.log("error exporting snapshot" | ||
, error.rc, error.snapshot, error.dst | ||
, error.stdout, error.stderr) | ||
default: | ||
break | ||
} | ||
} | ||
|
||
} |