Skip to content

Commit

Permalink
load settings when it changes
Browse files Browse the repository at this point in the history
  • Loading branch information
macherel committed Sep 13, 2020
1 parent 3507273 commit 50676af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 16 additions & 1 deletion source/QRCodeViewerApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ class QRCodeViewerApp extends App.AppBase {

function handleSettings() {
System.println("Handle settings...");
Settings.load();
System.println(
"Settings = {"
+ "barcodeHeight: " + Settings.barcodeHeight
+ ", cacheEnabled: " + Settings.cacheEnabled
+ ", currentId: " + Settings.currentId
+ ", displayLabel: " + Settings.displayLabel
+ ", offsetY: " + Settings.offsetY
+ ", retainMenuIndex: " + Settings.retainMenuIndex
+ ", size: " + Settings.size
+ ", token: " + Settings.token
+ ", customizeQRCodeGeneratingURL: " + Settings.customizeQRCodeGeneratingURL
+ ", codeGeneratingURL: " + Settings.codeGeneratingURL
+ "}"
);

var app = App.getApp();
initQRCodes();
if(Settings.canUseExternalDataWithPosition()) {
Expand Down Expand Up @@ -200,7 +216,6 @@ class QRCodeViewerApp extends App.AppBase {
function initialize() {
System.println("App initialization...");
AppBase.initialize();
Settings.load();
handleSettings();
System.println("App initialized.");
}
Expand Down
1 change: 0 additions & 1 deletion source/Settings.mc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module Settings {
app.setProperty("liVersion", 0);
app.setProperty("cacheEnabled", true);
}


barcodeHeight = app.getProperty("barcodeHeight");
cacheEnabled = app.getProperty("cacheEnabled");
Expand Down

0 comments on commit 50676af

Please sign in to comment.