diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec49c31d5ad00b2368b2a80558e3965691d7c8e3..9aa20bcaa69e423a06c66eca05e6d0e6c85e0466 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,9 @@ image: debian:buster-backports +variables: + GIT_SUBMODULE_STRATEGY: recursive + before_script: - apt update && apt install --no-install-recommends -y gir1.2-gtk-3.0 python3-gi python3-pip python3-setuptools - apt install --no-install-recommends -y -t buster-backports libhandy-0.0-dev diff --git a/briar-gtk/briar_gtk/containers/main_window.py b/briar-gtk/briar_gtk/containers/main_window.py index f25336b7bae451b6f58cfaf0ea01552e4fd47e0c..b1111666b61064fa70c872e4bcc42972914cd9ef 100644 --- a/briar-gtk/briar_gtk/containers/main_window.py +++ b/briar-gtk/briar_gtk/containers/main_window.py @@ -162,6 +162,7 @@ class MainWindowContainer(Container): for signal in self._signals: APP().api.socket_listener.disconnect(signal) + # pylint: disable=no-member def _load_content(self): self._contacts = Contacts(APP().api) self._load_contacts() @@ -172,6 +173,9 @@ class MainWindowContainer(Container): signal_id = socket_listener.connect("ConversationMessageReceivedEvent", self._refresh_contacts_async) self._signals.append(signal_id) + callback = self._refresh_contact_state + signal_ids = self._contacts.watch_connections(callback) + self._signals.extend(signal_ids) def _load_contacts(self): self.contacts_list = self._contacts.get() @@ -190,6 +194,10 @@ class MainWindowContainer(Container): def _refresh_contacts_async(self, message): GLib.idle_add(self._refresh_contacts) + # pylint: disable=unused-argument + def _refresh_contact_state(self, contact_id, connected): + self._refresh_contacts_async(None) + def _refresh_contacts(self): self._save_selected_row() self._clear_contact_list() diff --git a/briar-gtk/briar_gtk/widgets/contact_row.py b/briar-gtk/briar_gtk/widgets/contact_row.py index 12de972cc23dfcd4e1297cefd3c59aec47c1d9c6..41b4784ae5382571bf8b8c1b9bd3db9bf46adba8 100644 --- a/briar-gtk/briar_gtk/widgets/contact_row.py +++ b/briar-gtk/briar_gtk/widgets/contact_row.py @@ -17,10 +17,13 @@ class ContactRowWidget(Gtk.ListBoxRow): def _setup_view(self, contact): name = ContactRowWidget._get_contact_name(contact) contact_label = ContactRowWidget._create_contact_label(name) + connected = contact["connected"] + contact_state = ContactRowWidget._create_contact_state(connected) contact_box = ContactRowWidget._create_contact_box() contact_event_box = Gtk.EventBox().new() contact_box.pack_start(contact_label, True, True, 0) + contact_box.pack_end(contact_state, False, False, 0) contact_event_box.add(contact_box) self.add(contact_event_box) @@ -42,6 +45,15 @@ class ContactRowWidget(Gtk.ListBoxRow): contact_label.set_ellipsize(Pango.EllipsizeMode.END) return contact_label + @staticmethod + def _create_contact_state(connected): + file_name = "contact_disconnected" + if connected is True: + file_name = "contact_connected" + contact_state = Gtk.Image.new_from_icon_name(file_name, + Gtk.IconSize.MENU) + return contact_state + @staticmethod def _create_contact_box(): contact_box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 5) diff --git a/briar-gtk/data/icons/hicolor/scalable/status/contact_connected.svg b/briar-gtk/data/icons/hicolor/scalable/status/contact_connected.svg new file mode 100644 index 0000000000000000000000000000000000000000..8df06184471a725f7d6e37d71f7a9d0481cc2ba8 --- /dev/null +++ b/briar-gtk/data/icons/hicolor/scalable/status/contact_connected.svg @@ -0,0 +1,64 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 24 24" + id="vector" + opacity="0.56"> + <path + id="path" + d="M 12 2 C 6.48 2 2 6.48 2 12 C 2 17.52 6.48 22 12 22 C 17.52 22 22 17.52 22 12 C 22 6.48 17.52 2 12 2 Z M 12 20 C 7.58 20 4 16.42 4 12 C 4 7.58 7.58 4 12 4 C 16.42 4 20 7.58 20 12 C 20 16.42 16.42 20 12 20 Z" + fill="#000000"/> + <path + id="path_1" + d="M 0 0 L 24 0 L 24 24 L 0 24 Z" + fill="none"/> + <path + id="path_2" + d="M 10.897 19.95 C 6.551 19.349 3.431 15.215 4.063 10.896 C 4.555 7.531 7.095 4.824 10.394 4.147 C 14.257 3.355 18.17 5.543 19.524 9.253 C 20.07 10.749 20.162 12.461 19.777 13.976 C 19.546 14.886 18.811 16.339 18.207 17.077 C 16.49 19.178 13.581 20.322 10.897 19.95 Z" + fill="#82c91e" + stroke-width="0.76779664" + stroke-linecap="round" + stroke-linejoin="round"/> + <path + id="path_3" + d="M 10.897 19.95 C 6.551 19.349 3.431 15.215 4.063 10.896 C 4.555 7.531 7.095 4.824 10.394 4.147 C 14.257 3.355 18.17 5.543 19.524 9.253 C 20.07 10.749 20.162 12.461 19.777 13.976 C 19.546 14.886 18.811 16.339 18.207 17.077 C 16.49 19.178 13.581 20.322 10.897 19.95 Z" + fill="#82c91e" + stroke="#ffffff" + stroke-width="1.5" + stroke-linecap="round" + stroke-linejoin="round"/> + <path + id="path_4" + d="M 10.897 19.95 C 6.551 19.349 3.431 15.215 4.063 10.896 C 4.555 7.531 7.095 4.824 10.394 4.147 C 14.257 3.355 18.17 5.543 19.524 9.253 C 20.07 10.749 20.162 12.461 19.777 13.976 C 19.546 14.886 18.811 16.339 18.207 17.077 C 16.49 19.178 13.581 20.322 10.897 19.95 Z" + fill="#2e3d4f" + stroke="#ffffff" + stroke-width="1" + stroke-linecap="round" + stroke-linejoin="round"/> + <path + id="path_5" + d="M 10.897 19.95 C 6.551 19.349 3.431 15.215 4.063 10.896 C 4.555 7.531 7.095 4.824 10.394 4.147 C 14.257 3.355 18.17 5.543 19.524 9.253 C 20.07 10.749 20.162 12.461 19.777 13.976 C 19.546 14.886 18.811 16.339 18.207 17.077 C 16.49 19.178 13.581 20.322 10.897 19.95 Z" + fill="#2e3d4f" + stroke="#ffffff" + stroke-width="1" + stroke-linecap="round" + stroke-linejoin="round"/> + <path + id="path_6" + d="M 12 2 C 6.48 2 2 6.48 2 12 C 2 17.52 6.48 22 12 22 C 17.52 22 22 17.52 22 12 C 22 6.48 17.52 2 12 2 Z M 12 20 C 7.58 20 4 16.42 4 12 C 4 7.58 7.58 4 12 4 C 16.42 4 20 7.58 20 12 C 20 16.42 16.42 20 12 20 Z" + fill="#000000"/> + <path + id="path_7" + d="M 12 2 C 6.48 2 2 6.48 2 12 C 2 17.52 6.48 22 12 22 C 17.52 22 22 17.52 22 12 C 22 6.48 17.52 2 12 2 Z M 12 20 C 7.58 20 4 16.42 4 12 C 4 7.58 7.58 4 12 4 C 16.42 4 20 7.58 20 12 C 20 16.42 16.42 20 12 20 Z" + fill="#000000"/> + <path + id="path_8" + d="M 0 0 L 24 0 L 24 24 L 0 24 Z" + fill="none"/> + <path + id="path_9" + d="M 10.897 19.95 C 6.551 19.349 3.431 15.215 4.063 10.896 C 4.555 7.531 7.095 4.824 10.394 4.147 C 14.257 3.355 18.17 5.543 19.524 9.253 C 20.07 10.749 20.162 12.461 19.777 13.976 C 19.546 14.886 18.811 16.339 18.207 17.077 C 16.49 19.178 13.581 20.322 10.897 19.95 Z" + fill="#82c91e" + stroke-width="0.76779664" + stroke-linecap="round" + stroke-linejoin="round"/> +</svg> diff --git a/briar-gtk/data/icons/hicolor/scalable/status/contact_disconnected.svg b/briar-gtk/data/icons/hicolor/scalable/status/contact_disconnected.svg new file mode 100644 index 0000000000000000000000000000000000000000..ee1f857ab5a318f411a59e444b277525b93a94b8 --- /dev/null +++ b/briar-gtk/data/icons/hicolor/scalable/status/contact_disconnected.svg @@ -0,0 +1,10 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 24 24" + id="vector" + opacity="0.56"> + <path + id="path" + d="M 12 2 C 6.48 2 2 6.48 2 12 C 2 17.52 6.48 22 12 22 C 17.52 22 22 17.52 22 12 C 22 6.48 17.52 2 12 2 Z M 12 20 C 7.58 20 4 16.42 4 12 C 4 7.58 7.58 4 12 4 C 16.42 4 20 7.58 20 12 C 20 16.42 16.42 20 12 20 Z" + fill="#000000"/> +</svg> diff --git a/briar-wrapper b/briar-wrapper index d737307b0a61638aedd778ba6d27ce275fcf3aaa..8969b057730f5ac9d6f061cc68fcbf69ecc2ceb1 160000 --- a/briar-wrapper +++ b/briar-wrapper @@ -1 +1 @@ -Subproject commit d737307b0a61638aedd778ba6d27ce275fcf3aaa +Subproject commit 8969b057730f5ac9d6f061cc68fcbf69ecc2ceb1