Skip to content

Add missing infobar for backends#1241

Open
diegogangl wants to merge 1 commit intogetting-things-gnome:masterfrom
diegogangl:fix_missing_infobar
Open

Add missing infobar for backends#1241
diegogangl wants to merge 1 commit intogetting-things-gnome:masterfrom
diegogangl:fix_missing_infobar

Conversation

@diegogangl
Copy link
Copy Markdown
Contributor

fixes #998

⚠️ This needs help testing!

@azmeuk
Copy link
Copy Markdown

azmeuk commented Nov 18, 2025

The infobar exception is fixed, now I have:

Context: Global generic exception

Traceback (most recent call last):
  File "/home/eloi/dev/gtg/.local_build/install/lib/python3.13/site-packages/GTG/gtk/browser/main_window.py", line 1709, in remove_backend_infobar
    self.vbox_toolbars.foreach(self.__remove_backend_infobar, backend_id)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Box' object has no attribute 'foreach'

@pentux-GitHub
Copy link
Copy Markdown

I tested this PR and can confirm it fixes the original set_interaction_request
exception from #998. However, @azmeuk's report is correct — a secondary error
occurs immediately after:

AttributeError: 'Box' object has no attribute 'foreach'

This is because foreach() is a GTK3 method that no longer exists on GtkBox
in GTK4. It appears in two places in main_window.py, and vbox_toolbars.add()
has the same issue (GTK3 → GTK4).

Here is the fix for all three occurrences:

remove_backend_infobar() (line ~1708):

# Before
self.vbox_toolbars.foreach(self.__remove_backend_infobar, backend_id)

# After
child = self.vbox_toolbars.get_first_child()
while child:
    next_child = child.get_next_sibling()
    self.__remove_backend_infobar(child, backend_id)
    child = next_child

_new_infobar() (line ~1720 and ~1724):

# Before
self.vbox_toolbars.foreach(self.__remove_backend_infobar, backend_id)
...
self.vbox_toolbars.add(infobar)

# After
child = self.vbox_toolbars.get_first_child()
while child:
    next_child = child.get_next_sibling()
    self.__remove_backend_infobar(child, backend_id)
    child = next_child
...
self.vbox_toolbars.append(infobar)

Tested on the current master with a live CalDAV backend — the foreach
exception is gone after applying these changes.

Happy to open a follow-up PR if that's helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception when adding a CalDAV provider: no attribute 'set_interaction_request'

3 participants