Add header change tracking to tab modification detection

Previously, changes to HTTP headers (adding, editing, or removing headers)
were not being tracked, causing tabs to not show the modified indicator (•)
when only header values changed.

Changes:
- Add 'changed' signal to HeaderRow widget that emits when key or value entries change
- Connect HeaderRow 'changed' signal to window's _on_request_changed handler
- Real-time tab modification tracking now includes all header edits

This completes the comprehensive change tracking system for tabs:
- URL changes ✓
- Method changes ✓
- Body changes ✓
- Syntax changes ✓
- Header changes ✓ (now fixed)
This commit is contained in:
vesp 2025-12-22 00:49:54 +01:00
parent f52b0fa431
commit 0d5bb837f5
2 changed files with 12 additions and 2 deletions

View File

@ -30,14 +30,23 @@ class HeaderRow(Gtk.Box):
value_entry = Gtk.Template.Child()
remove_button = Gtk.Template.Child()
# Signal emitted when remove button clicked
# Signals
__gsignals__ = {
'remove-requested': (GObject.SIGNAL_RUN_FIRST, None, ())
'remove-requested': (GObject.SIGNAL_RUN_FIRST, None, ()),
'changed': (GObject.SIGNAL_RUN_FIRST, None, ())
}
def __init__(self):
super().__init__()
# Connect to entry changes to emit our own changed signal
self.key_entry.connect('changed', self._on_entry_changed)
self.value_entry.connect('changed', self._on_entry_changed)
def _on_entry_changed(self, entry):
"""Handle changes to key or value entries."""
self.emit('changed')
@Gtk.Template.Callback()
def on_remove_clicked(self, button):
"""Handle remove button click."""

View File

@ -837,6 +837,7 @@ class RosterWindow(Adw.ApplicationWindow):
row = HeaderRow()
row.set_header(key, value)
row.connect('remove-requested', self._on_header_remove)
row.connect('changed', self._on_request_changed)
self.headers_listbox.append(row)
# Mark as changed if we're adding a non-empty header