_ = UpdateCustomization(backupCust);
}
+ return true;
+ }
+ catch (Exception e)
+ {
+ Logger.Error($"{e}");
+ return false;
+ }
+ }
+
+ public void SaveCustomizationToFiles()
+ {
+ try
+ {
// save current customization to both files (current and backup)
var menuCustItems = installedGadgets.Select(x => new MenuCustomizationItem(x.Path, x.Order));
FileStorage.WriteToFiles(menuCustItems);
FileStorage.Instance.Changed += CustFileChanged;
FileStorage.Instance.Lost += CustFileLost;
FileStorage.Instance.StartMonitoring();
-
- return true;
}
catch (Exception e)
{
Logger.Error($"{e}");
- return false;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
using Tizen.Applications;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
{
private static SettingViewBorder appCustomBorder;
private ContentPage mMainPage;
+ private static Task rowsCreated;
public Program(Size2D windowSize, Position2D windowPosition, ThemeOptions themeOptions, IBorderInterface borderInterface)
: base(windowSize, windowPosition, themeOptions, borderInterface)
bool initilized = GadgetManager.Instance.Init();
mMainPage.Content = initilized ? CreateContent() : GetTextNotice("Failed to initialize GadgetManager.\nPlease check error logs for more information.", Color.Red);
+ _ = SaveCustomization();
var navigator = new SettingNavigation();
navigator.WidthResizePolicy = ResizePolicyType.FillToParent;
LogScalableInfo();
}
+ private async Task SaveCustomization()
+ {
+ await rowsCreated;
+ await Task.Run(() =>
+ {
+ GadgetManager.Instance.SaveCustomizationToFiles();
+ return true;
+ });
+ }
+
private ContentPage CreateMainPage()
{
var mainPage = new BaseContentPage()
},
};
- CreateContentRows(visibleMenus, content);
+ rowsCreated = CreateContentRows(visibleMenus, content);
return content;
}