-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
favoriteApps: initial implementation #1
base: cutie
Are you sure you want to change the base?
Conversation
add submenu to add and remove favorite apps include cutie store for persistence add timer to differentiate short and long presses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, where is the favourites bar? Is that an upcoming PR here? or in cutie-home? or somewhere else?
Edit: Apparently, I cannot read.
|
||
function saveFavoriteItem(name, iconPath, execCommand) { | ||
let data = favoriteStore.data; | ||
data["favoriteApp-" + name] = { "icon": iconPath, "command": execCommand }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is really no need to prefix it like this. Also, it would make sense the save the full js object (model).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it .. I saw that the add data function only uses these 3 variables to create the deligate item, that's why I did the same.. should I be saving the whole object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the best way to do this imo would be to save the filename of the desktop file.
So, for example, when adding Firefox from /usr/share/applications/firefox-esr.desktop
, the code should add "firefox-esr"
to a JavaScript array.
With this, I would rename the store to settings
and use data["favoriteApps"]
as the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intension behind this is to have an extra page in the settings app to manage apps?
Also if we only save the file name then won't we need a lot more code to read the desktop file to get the icon and app name??
(Sorry if I miss understand your idea)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is just redundant to store all information twice.
With this, it would be easier to remove uninstalled applications from favorites automatically.
In this case, it would be sane to move the desktop file parsing logic to a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the .desktop file is phrased and sent to libcutiestore then both all apps and favourite apps are loaded from this store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the desktop entries would be parsed on the fly. Of favorites, only the file name of the entry is saved. Then, cutie-home would parse the desktop file of this name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oke, I think I understand now. will come back to this once I am done with cutie-home
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @erikinkinen how hard would it be to move desktop file parsing logic to a library.
replace onReleased with onPressAndHold remove timer move remove fav app menu to cutie-home
@@ -80,6 +101,19 @@ CutieWindow { | |||
elide: Text.ElideRight | |||
horizontalAlignment: Text.AlignHCenter | |||
} | |||
|
|||
CutieStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not initialize this inside the delegate. That would cause it to initialize identical objects for each button which causes a heavy performance impact.
width: launchAppGrid.cellWidth | ||
height: launchAppGrid.cellHeight | ||
|
||
property bool longPress: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used anymore as far as I can see.
height: launchAppGrid.cellHeight | ||
|
||
property bool longPress: false | ||
property alias menu: menu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be necessary. The identifier menu
should be available inside the delegate through the id
property.
add submenu to add and remove favorite apps
include cutie store for persistence
add timer to differentiate short and long presses
Part 2 will be to implement a new panel in cutie home which requires a little bit more work