-
-
Notifications
You must be signed in to change notification settings - Fork 49
Port ProcessTreeView to GTK4 #525
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
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
83bf4bf
[wip] gtk4-treeview
stsdc 35e7641
[wip] add signal list factory
stsdc 236bc00
ProcessTreeView: Show process name and add sorting
stsdc 21f5432
ProcessTreeView: Reintroduce cpu and memory columns
stsdc 98b801f
ProcessTreeView: Reintroduce PID column
stsdc 780a157
ProcessTreeView: reintroduce process_selected signal
stsdc 1bd04dd
ProcessTreeView: use selected-item property to watch
stsdc a05b0bd
ProcessTreeView: update selection model connection and expand Proces …
stsdc ade573e
TreeViewModel: update values in the store
stsdc ee8b5e1
ProcessTreeView: introduce initial filtering by name
stsdc 8e6d601
ProcessTreeView: process filtering works
stsdc 9907a24
ProcessTreeView: reverse sorting for numeric values; fix process reor…
stsdc b6c2933
ProcessTreeView: show process icons
stsdc d37b1e1
TreeViewModel: refactor
stsdc ead83cd
TreeViewModel: refactor
stsdc a0927f2
CPUProcessTreeView: adios!
stsdc 6b66db3
ProcessView: remove obsolete commented out filtering function
stsdc 952481b
cleanup
stsdc d5b2492
Remove unused functions
stsdc 336bde8
Remove unneeded GTK namespaces
stsdc af1686b
Use correct casting syntax
stsdc 63e94ba
Remove old treeview functionality
stsdc 6424b20
Fix code style
stsdc 92d3a60
Use format_size; Move some setup factories to a separate reusable method
stsdc 0c921f1
Convert lambdas to methods
stsdc 932954a
Remove a leftover comment
stsdc 131fe82
Fix memory size
stsdc 74615a0
Localize column_view object
stsdc d3265cd
Merge branch 'main' into stsdc/gtk4-treeview
stsdc c42c3bb
TreeVIewModel: Move classes to separate files
stsdc 3922627
TreeViewFilter: make chain filters private
stsdc 9833f56
Fix lint
stsdc ab9bee1
Merge branch 'main' into stsdc/gtk4-treeview
stsdc c8b3014
Merge branch 'main' into stsdc/gtk4-treeview
stsdc c07348f
ProcessTreeView: Use bindings to fix list jumps
stsdc 111f4db
Use correct casting approach
stsdc df026ba
Cleanup and formatting
stsdc 6b80f21
TreeViewModel: make it singleton
stsdc cf3aeef
Add license header to ProcessRowData
stsdc f06383b
Update POTFILES to include ProcessTreeView
stsdc 3f8b934
Prevent initializing a new object and substituting it to child prope…
stsdc 2cce9e9
Limit scope for some properties; prevent null errors on process select
stsdc c8eb319
Use binding needle to search property of filters
stsdc 3cda387
Convert filters to local variables in constructor
stsdc 95a54c4
Remove unnecessary OR in pid search
stsdc c08d704
Rename: name_item_factory_setup → name_item_setup_factory
stsdc 38647df
Remove whitespace
stsdc 5bb6099
Introduce ProcessTreeViewNameCell to improve readability
stsdc 76f5401
Apply suggestions from code review
stsdc 8f0359f
Remove unnecessary newlines
stsdc 946de36
Undo: TreeViewModel: make it singleton
stsdc f70dd45
Use ProcessTreeViewNameCell in the unbind callback
stsdc 222a225
Do not init and assign to other's object property
stsdc cc25a41
Unbind also icon in the factory unbind callback
stsdc 1716039
Remove extra newlines; move scrolled window creation at the end of th…
stsdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) | ||
| */ | ||
|
|
||
| /* This class holds data from Process class to use in the ColumnView */ | ||
| public class Monitor.ProcessRowData : GLib.Object { | ||
| public Icon icon { get; set; } | ||
| public string name { get; set; } | ||
| public int cpu { get; set; } | ||
| public uint64 memory { get; set; } | ||
| public int pid { get; set; } | ||
| public string cmd { get; set; } | ||
| public Gee.HashMap<string, Binding> bindings = new Gee.HashMap<string, Binding> (); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| * SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) | ||
| */ | ||
|
|
||
| public class Monitor.TreeViewFilter : GLib.Object { | ||
|
stsdc marked this conversation as resolved.
|
||
| public string needle { get; set; } | ||
| public Gtk.FilterListModel model_out; | ||
|
stsdc marked this conversation as resolved.
|
||
|
|
||
| public TreeViewFilter (GLib.ListModel? model) { | ||
| var name_filter = build_str_filter ("name"); | ||
| var cmd_filter = build_str_filter ("cmd"); | ||
|
|
||
| // since the pid property is an int, we need to use a custom filter to convert it to a string | ||
| var pid_filter = new Gtk.CustomFilter ((obj) => { | ||
| var item = (ProcessRowData) obj; | ||
| bool pid_found = item.pid.to_string ().contains (needle.casefold ()); | ||
| return pid_found; | ||
| }); | ||
|
|
||
| var any_filter = new Gtk.AnyFilter (); | ||
| any_filter.append (name_filter); | ||
| any_filter.append (cmd_filter); | ||
| any_filter.append (pid_filter); | ||
|
|
||
| model_out = new Gtk.FilterListModel (model, any_filter); | ||
|
|
||
|
stsdc marked this conversation as resolved.
|
||
| bind_property ("needle", name_filter, "search", SYNC_CREATE); | ||
| bind_property ("needle", cmd_filter, "search", SYNC_CREATE); | ||
| } | ||
|
|
||
| private Gtk.StringFilter build_str_filter (string column_name) { | ||
| var expression = new Gtk.PropertyExpression (typeof (ProcessRowData), null, column_name); | ||
| return new Gtk.StringFilter (expression) { | ||
| ignore_case = true, | ||
| match_mode = SUBSTRING, | ||
| search = needle | ||
| }; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.