Unofficial GUI for Microsoft's Windows Package Manager (winget). Kinda like Synaptic, but for Windows. Not associated with either Microsoft or the Synaptic project, and Microsoft does not endorse this software.
Apache License 2.0
136
stars
3
forks
source link
Significantly-faster package list loading and nearly-instant search, both provided by a DataView and its RowFilter. #140
Thought this was going to be using VirtualMode and a Package class, but so far these changes are major improvements, so I might not do those unless necessary.
Current known bugs and issues:
[x] The database isn't being closed after updating the cache, so it says that it's in use when I try to update again. (This should be fixed now, I hope. Mainly what I did was to have it clear the pools just before returning the datatable so that hopefully it's not in memory now.)
[x] There aren't dropdowns/comboboxes in the Actions column right now, as I don't entirely know how to put them into DataTables. This is super important to ensure people can use it anyway they want. Edit: maybe I can just have it so that people can press spacebar when the Action column is the current column and open a makeshift menu for the Action items that's used instead of the previous dropdown. Edit 2: I just added the Ctrl+M keyboard shortcut so people can open the context menu in the top-left corner of the package list DataGridView, which is a lot less work and should be better than what it was before. People can still use Alt+S if they wish to open the Selected packages menu, which has the Ctrl+M button in it. Only potential issue is this'll cover up some of the packages, but for now, I don't have any other simple solutions that aren't more buggy than the previous dropdowns.
[x] Actions and Status columns aren't auto-sized correctly.
Not really an issue, but there may be a lot of useless code that was necessary previously that doesn't present any noticeable problems that'll have to be removed.
TODO: I need to have a column for Installed version once there's a way to allow users to choose a different version to install rather than the latest version. This'll just be something I'll add in the future, rather than in this PR.
Additions:
New setting: DebuggingShowManifestPathColumn, Boolean, defaults to False. You can use this to show the ManifestPath column, as expected.
Since there's a way to know how many rows are currently being shown vs how many are loaded in total, the statusbar now displays the number of listed packages alongside the total number of loaded packages. This is sorta like what Synaptic does, except the number of packages marked in various ways isn't shown yet. Once I can get that working, I'll add that feature.
Column widths are now saved across refreshing the cache, which is effectively the same thing that happened last time, except this is necessary as we're removing everything from the datagridview on cache updates.
Show context menu button in the Selected packages menu to display the context menu for the package list, as a replacement for the removed Action column dropdowns. See the item on this in the Removals section for more details.
Fixes:
Selecting all packages with Ctrl+A while searching will select every package, even the ones that aren't visible. (fixes #13)
Last package selected displays its details even if there are no search results. (fixes #17, though I did push a commit earlier with the "fixes" thing)
Database connection wasn't being closed once we were done loading the package list from it, which may or may not have caused issues.
Removals:
Forgot about the ManifestType column, but I didn't add support for it in the new code. Copied over the commented-out code so it can be used if necessary, though it'll require changes.
We're not using the PackageInfo class or whatever it's called sometimes anymore, so I removed it completely and it's not just commented out now.
The Action column no longer has the dropdowns like it used to. Replacing that is the ability to single-click on any cell in the Action column to open the context menu instead of requiring a double-click, or pressing Ctrl+M to open the context menu directly without having to use the context menu key on the keyboard, as it may be difficult or impossible to access. You can still use any other way of marking packages that was previously available, including but not limited to opening the Selected packages menu with Alt+S.
Other changes:
Descriptions and manifest paths are loaded at the same time as the rest of the details are loaded from the database to make using the DataTable easier/possible. I decided to make the code that adds the rows to the datatable use Await Task.Run to try to speed it up, and it may help a little, but I'm not sure how much.
Libraries were updated.
Just so I don't miss this when writing the changelog, searches are now near-instant, and loading the package list is usually way faster, even on my desktop which is a Ryzen 5800X. I think it also uses a lot less RAM now too, usually staying under 80 MB of RAM, whereas before it would easily go into 120 MB or more. At least, that was based on the highest number in the memory usage graph in Visual Studio, so it's not exact. Sometimes it can use a lot more, too, so I need to figure out how to keep the memory usage lower. Running without the debugger makes package list loading faster, though rarely it's still really slow for some reason.
Instead of having the progressbar go up by 1 for each package, it now goes up every 100 packages when there are 100 or more in the list, goes up by 10 if there are 10 or more but fewer than 99 packages, and up by 1 if there are fewer than 10 packages. This may help improve performance by not constantly updating the UI thread.
Checking to see how many manifests are available is now done by using If ManifestPaths.Count = 0... instead of If ManifestPaths(0) = String.Empty to make sure it doesn't break as easily.
Loading from the Sqlite database into a DataTable is now done Async to hopefully not make things lock up as much. In my testing, I have only noticed guinget's titlebar say "(Not Responding)" once or twice, though there were a lot of times Task Manager said it wasn't responding, but most people probably wouldn't have Task Manager open and looking at guinget's process in particular.
HiDPI Mode now hides the package list and shows it again after changing the height for each row. This should help improve performance, though it's still slow, so I still recommend toggling it before loading the package list.
Instead of using AllCells for the autosizemode for the Action and Status columns, they're now using DisplayedCells. Hopefully this speeds things up.
Thought this was going to be using VirtualMode and a Package class, but so far these changes are major improvements, so I might not do those unless necessary.
Current known bugs and issues:
Actions
column right now, as I don't entirely know how to put them into DataTables. This is super important to ensure people can use it anyway they want. Edit: maybe I can just have it so that people can pressspacebar
when theAction
column is the current column and open a makeshift menu for theAction
items that's used instead of the previous dropdown. Edit 2: I just added theCtrl+M
keyboard shortcut so people can open the context menu in the top-left corner of the package list DataGridView, which is a lot less work and should be better than what it was before. People can still useAlt+S
if they wish to open theSelected packages
menu, which has theCtrl+M
button in it. Only potential issue is this'll cover up some of the packages, but for now, I don't have any other simple solutions that aren't more buggy than the previous dropdowns.Actions
andStatus
columns aren't auto-sized correctly.Installed version
once there's a way to allow users to choose a different version to install rather than the latest version. This'll just be something I'll add in the future, rather than in this PR.Additions:
DebuggingShowManifestPathColumn
, Boolean, defaults toFalse
. You can use this to show the ManifestPath column, as expected.Show context menu
button in theSelected packages
menu to display the context menu for the package list, as a replacement for the removedAction
column dropdowns. See the item on this in theRemovals
section for more details.Fixes:
Removals:
PackageInfo
class or whatever it's called sometimes anymore, so I removed it completely and it's not just commented out now.Action
column no longer has the dropdowns like it used to. Replacing that is the ability to single-click on any cell in theAction
column to open the context menu instead of requiring a double-click, or pressingCtrl+M
to open the context menu directly without having to use the context menu key on the keyboard, as it may be difficult or impossible to access. You can still use any other way of marking packages that was previously available, including but not limited to opening theSelected packages
menu withAlt+S
.Other changes:
If ManifestPaths.Count = 0...
instead ofIf ManifestPaths(0) = String.Empty
to make sure it doesn't break as easily.AllCells
for the autosizemode for theAction
andStatus
columns, they're now usingDisplayedCells
. Hopefully this speeds things up.