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:
parent
c3430058b9
commit
47225cf254
@ -30,14 +30,23 @@ class HeaderRow(Gtk.Box):
|
|||||||
value_entry = Gtk.Template.Child()
|
value_entry = Gtk.Template.Child()
|
||||||
remove_button = Gtk.Template.Child()
|
remove_button = Gtk.Template.Child()
|
||||||
|
|
||||||
# Signal emitted when remove button clicked
|
# Signals
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'remove-requested': (GObject.SIGNAL_RUN_FIRST, None, ())
|
'remove-requested': (GObject.SIGNAL_RUN_FIRST, None, ()),
|
||||||
|
'changed': (GObject.SIGNAL_RUN_FIRST, None, ())
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
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()
|
@Gtk.Template.Callback()
|
||||||
def on_remove_clicked(self, button):
|
def on_remove_clicked(self, button):
|
||||||
"""Handle remove button click."""
|
"""Handle remove button click."""
|
||||||
|
|||||||
@ -837,6 +837,7 @@ class RosterWindow(Adw.ApplicationWindow):
|
|||||||
row = HeaderRow()
|
row = HeaderRow()
|
||||||
row.set_header(key, value)
|
row.set_header(key, value)
|
||||||
row.connect('remove-requested', self._on_header_remove)
|
row.connect('remove-requested', self._on_header_remove)
|
||||||
|
row.connect('changed', self._on_request_changed)
|
||||||
self.headers_listbox.append(row)
|
self.headers_listbox.append(row)
|
||||||
|
|
||||||
# Mark as changed if we're adding a non-empty header
|
# Mark as changed if we're adding a non-empty header
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user