Port To Gtk4#24
Draft
Dakshsharma1108 wants to merge 2 commits intosugarlabs:masterfrom
Draft
Conversation
Replace deprecated GTK3 tree widgets and models with modern GTK4
equivalents. This migration modernizes the log file tree interface
while maintaining the same functionality.
REMOVED (GTK3 only, not available in GTK4):
- Gtk.TreeStore → replaced by Gio.ListStore (self._root_store)
- Gtk.TreeView → replaced by Gtk.ListView (self._listview)
- Gtk.TreeModelSort → replaced by manual _sort_node_list() helper
- Gtk.TreeViewColumn → replaced by Gtk.SignalListItemFactory
- _format_col() → replaced by _setup_tree_row_cb / _bind_tree_row_cb
- _cursor_changed_cb() → replaced by _selection_changed_cb()
ADDED (new GTK4 / GIO APIs):
- Gtk.TreeListModel → wraps the nested Gio.ListStore tree
- Gtk.TreeExpander → renders expand/collapse arrows per row
- Gtk.SingleSelection → selection model wired to Gtk.ListView
- LogTreeNode (GObject) → new data-model node that holds children
- _log_index dict → metadata cache (top_key, group_name, …)
- Gio.FileMonitor → replaces deprecated gnomevfs / Sugar file
watchers; stored in self._gio_monitors
Author
|
Have a look at this pr @MostlyKIGuess @chimosky |
- Replace deprecated GTK3 APIs with GTK4 equivalents (Gtk.SearchEntry, Box, etc.) - Use modern Python initialization patterns (super() instead of explicit __init__) - Replace toolbar.insert() with toolbar.append() for better API consistency - Replace VBox/HBox with modern Box and orientation API - Update clipboard API from Gtk.Clipboard to Gdk.Display.get_default().get_clipboard() - Add LogTreeNode class for structured log tree representation - Remove deprecated screen configuration callbacks and responsive layout logic - Improve error handling for profile logs directory creation - Simplify UI construction with modern GTK patterns
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WIP: Migrate log activity to GTK4
Incrementally modernize the log activity by replacing deprecated GTK3
APIs with GTK4 equivalents. This is a work-in-progress refactoring being
applied in stages.
with node_id, display_name, logfile, and children (Gio.ListStore)
REMOVED (GTK3 only, not available in GTK4):
ADDED (new GTK4 / GIO APIs):
watchers; stored in self._gio_monitors
Improved error handling:
Visual Changes:
After porting testing without sugar:
