Skip to content
Snippets Groups Projects
Commit ff4e91e4 authored by Nico's avatar Nico
Browse files

Set urgent window flag on incoming messages and added contacts

parent 8d707131
No related branches found
No related tags found
1 merge request!50Set urgent window flag on incoming messages and added contacts
Pipeline #4732 passed
......@@ -191,14 +191,16 @@ class MainWindowContainer(Container):
self.contacts_list_box.select_row(contact_row)
# pylint: disable=unused-argument
def _refresh_contacts_async(self, message):
GLib.idle_add(self._refresh_contacts)
def _refresh_contacts_async(self, message, urgent=True):
GLib.idle_add(self._refresh_contacts, urgent)
# pylint: disable=unused-argument
def _refresh_contact_state(self, contact_id, connected):
self._refresh_contacts_async(None)
self._refresh_contacts_async(None, False)
def _refresh_contacts(self):
def _refresh_contacts(self, urgent):
if urgent:
APP().window.set_urgency_hint(True)
self._save_selected_row()
self._clear_contact_list()
self._load_contacts()
......
......@@ -19,6 +19,7 @@ class Window(Gtk.ApplicationWindow):
self._initialize_gtk_application_window()
WindowActions(self)
self._setup_content()
self._setup_focus_listener()
def show_main_container(self):
self.current_container.destroy()
......@@ -37,6 +38,14 @@ class Window(Gtk.ApplicationWindow):
self._resize_window(self.DEFAULT_WINDOW_SIZE)
self._setup_startup_container()
def _setup_focus_listener(self):
self.connect("focus-in-event", self._on_focus_change)
self.connect("focus-out-event", self._on_focus_change)
# pylint: disable=unused-argument
def _on_focus_change(self, widget, event):
self.set_urgency_hint(False)
def _resize_window(self, size):
if not Window._size_is_valid(size):
raise Exception("Couldn't resize window; invalid size parameter")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment