mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
config refacotr: separate settings.json, session.json, appusage.json
This commit is contained in:
@@ -39,9 +39,9 @@ DankModal {
|
||||
function getLastPath() {
|
||||
var lastPath = "";
|
||||
if (browserType === "wallpaper") {
|
||||
lastPath = Prefs.wallpaperLastPath;
|
||||
lastPath = SessionData.wallpaperLastPath;
|
||||
} else if (browserType === "profile") {
|
||||
lastPath = Prefs.profileLastPath;
|
||||
lastPath = SessionData.profileLastPath;
|
||||
}
|
||||
|
||||
if (lastPath && lastPath !== "") {
|
||||
@@ -52,11 +52,10 @@ DankModal {
|
||||
|
||||
function saveLastPath(path) {
|
||||
if (browserType === "wallpaper") {
|
||||
Prefs.wallpaperLastPath = path;
|
||||
SessionData.setWallpaperLastPath(path);
|
||||
} else if (browserType === "profile") {
|
||||
Prefs.profileLastPath = path;
|
||||
SessionData.setProfileLastPath(path);
|
||||
}
|
||||
Prefs.saveSettings();
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
@@ -59,11 +59,11 @@ DankModal {
|
||||
AppLauncher {
|
||||
id: appLauncher
|
||||
|
||||
viewMode: Prefs.spotlightModalViewMode
|
||||
viewMode: SettingsData.spotlightModalViewMode
|
||||
gridColumns: 4
|
||||
onAppLaunched: hide()
|
||||
onViewModeSelected: function(mode) {
|
||||
Prefs.setSpotlightModalViewMode(mode);
|
||||
SettingsData.setSpotlightModalViewMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ DankModal {
|
||||
name: {
|
||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry) return "push_pin"
|
||||
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
||||
return Prefs.isPinnedApp(appId) ? "keep_off" : "push_pin"
|
||||
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
|
||||
}
|
||||
size: Theme.iconSize - 2
|
||||
color: Theme.surfaceText
|
||||
@@ -438,7 +438,7 @@ DankModal {
|
||||
text: {
|
||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry) return "Pin to Dock"
|
||||
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
||||
return Prefs.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock"
|
||||
return SessionData.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock"
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
@@ -455,10 +455,10 @@ DankModal {
|
||||
onClicked: {
|
||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry) return
|
||||
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
||||
if (Prefs.isPinnedApp(appId)) {
|
||||
Prefs.removePinnedApp(appId)
|
||||
if (SessionData.isPinnedApp(appId)) {
|
||||
SessionData.removePinnedApp(appId)
|
||||
} else {
|
||||
Prefs.addPinnedApp(appId)
|
||||
SessionData.addPinnedApp(appId)
|
||||
}
|
||||
contextMenu.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user