From 21ae42762d8a57da5cb1ec40b46e7510fc3121ad Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 20 Jun 2024 12:05:20 +0200 Subject: Redesign and rewrite accounts and settings dialog into a combined one --- main/CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'main/CMakeLists.txt') diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index ea4de99b..d5fc66be 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -59,6 +59,7 @@ set(RESOURCE_LIST add_conversation/list_row.ui add_conversation/select_jid_fragment.ui + account_picker_row.ui call_widget.ui chat_input.ui conversation_details.ui @@ -86,9 +87,11 @@ set(RESOURCE_LIST message_item_widget_edit_mode.ui occupant_list.ui occupant_list_item.ui + preferences_window.ui + preferences_window_account.ui + preferences_window_general.ui quote.ui search_autocomplete.ui - settings_dialog.ui unified_main_content.ui unified_window_placeholder.ui @@ -155,7 +158,6 @@ SOURCES src/ui/global_search.vala src/ui/notifier_freedesktop.vala src/ui/notifier_gnotifications.vala - src/ui/settings_dialog.vala src/ui/main_window.vala src/ui/main_window_controller.vala @@ -236,10 +238,19 @@ SOURCES src/ui/widgets/fixed_ratio_picture.vala src/ui/widgets/natural_size_increase.vala + src/view_model/account_details.vala src/view_model/conversation_details.vala src/view_model/preferences_row.vala + src/view_model/preferences_window.vala src/windows/conversation_details.vala + + src/windows/preferences_window/account_preferences_subpage.vala + src/windows/preferences_window/accounts_preferences_page.vala + src/windows/preferences_window/encryption_preferences_page.vala + src/windows/preferences_window/general_preferences_page.vala + src/windows/preferences_window/preferences_window.vala + CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/exports/xmpp-vala.vapi ${CMAKE_BINARY_DIR}/exports/qlite.vapi -- cgit v1.2.3-70-g09d2 From 00188bdf9bd91de34060eed195c9fd7a04c8871f Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Fri, 8 Dec 2023 02:02:29 +0100 Subject: Show contact status in "Start chat" window should close #139 - adds svg dino-status-offline.svg --- main/CMakeLists.txt | 1 + main/data/add_conversation/list_row.ui | 9 ++++++++ main/data/gresource.xml | 1 + .../icons/scalable/status/dino-status-offline.svg | 6 +++++ main/src/ui/add_conversation/conference_list.vala | 1 + main/src/ui/add_conversation/list_row.vala | 27 ++++++++++++++++++++++ 6 files changed, 45 insertions(+) create mode 100644 main/data/icons/scalable/status/dino-status-offline.svg (limited to 'main/CMakeLists.txt') diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index d5fc66be..2c533907 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -49,6 +49,7 @@ set(RESOURCE_LIST icons/scalable/status/dino-status-chat.svg icons/scalable/status/dino-status-dnd.svg icons/scalable/status/dino-status-online.svg + icons/scalable/status/dino-status-offline.svg icons/scalable/status/dino-tick-symbolic.svg icons/scalable/status/dino-video-off-symbolic.svg icons/scalable/status/dino-video-symbolic.svg diff --git a/main/data/add_conversation/list_row.ui b/main/data/add_conversation/list_row.ui index b8a97174..d829dc3a 100644 --- a/main/data/add_conversation/list_row.ui +++ b/main/data/add_conversation/list_row.ui @@ -14,6 +14,15 @@ center + + + 10 + + 1 + 0 + + + center diff --git a/main/data/gresource.xml b/main/data/gresource.xml index ddf7ccf9..8717fa85 100644 --- a/main/data/gresource.xml +++ b/main/data/gresource.xml @@ -51,6 +51,7 @@ icons/scalable/status/dino-status-chat.svg icons/scalable/status/dino-status-dnd.svg icons/scalable/status/dino-status-online.svg + icons/scalable/status/dino-status-offline.svg icons/scalable/status/dino-tick-symbolic.svg icons/scalable/status/dino-video-off-symbolic.svg icons/scalable/status/dino-video-symbolic.svg diff --git a/main/data/icons/scalable/status/dino-status-offline.svg b/main/data/icons/scalable/status/dino-status-offline.svg new file mode 100644 index 00000000..58f75de2 --- /dev/null +++ b/main/data/icons/scalable/status/dino-status-offline.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main/src/ui/add_conversation/conference_list.vala b/main/src/ui/add_conversation/conference_list.vala index 0b630ae4..bf6191fa 100644 --- a/main/src/ui/add_conversation/conference_list.vala +++ b/main/src/ui/add_conversation/conference_list.vala @@ -103,6 +103,7 @@ internal class ConferenceListRow : ListRow { this.account = account; this.bookmark = bookmark; + status_dot.visible = false; name_label.label = bookmark.name != null && bookmark.name != "" ? bookmark.name : bookmark.jid.to_string(); if (stream_interactor.get_accounts().size > 1) { via_label.label = "via " + account.bare_jid.to_string(); diff --git a/main/src/ui/add_conversation/list_row.vala b/main/src/ui/add_conversation/list_row.vala index c5e344d0..8e4cbb9b 100644 --- a/main/src/ui/add_conversation/list_row.vala +++ b/main/src/ui/add_conversation/list_row.vala @@ -11,6 +11,7 @@ public class ListRow : Widget { public Grid outer_grid; public AvatarPicture picture; public Label name_label; + public Image status_dot; public Label via_label; public Jid? jid; @@ -21,14 +22,39 @@ public class ListRow : Widget { outer_grid = (Grid) builder.get_object("outer_grid"); picture = (AvatarPicture) builder.get_object("picture"); name_label = (Label) builder.get_object("name_label"); + status_dot = (Image) builder.get_object("status_dot"); via_label = (Label) builder.get_object("via_label"); + this.layout_manager = new BinLayout(); outer_grid.set_parent(this); } public ListRow() {} + private void set_status_dot(StreamInteractor stream_interactor, Jid jid, Account account){ + Gee.List? full_jids = stream_interactor.get_module(PresenceManager.IDENTITY).get_full_jids(jid, account); + string presence_str = null; + if (full_jids != null){ + int devices = 0; + string newline_if_more_devices; + for (int i = 0; i < full_jids.size; i++) { + Jid full_jid = full_jids[i]; + presence_str = stream_interactor.get_module(PresenceManager.IDENTITY).get_last_show(full_jid, account); + if(presence_str != null) devices += 1; + newline_if_more_devices = devices > 1 ? "\r\n" : ""; + switch(presence_str){ + case "dnd": this.status_dot.set_from_icon_name("dino-status-dnd"); i = full_jids.size; break; // dnd detected = marked as dnd for all devices + case "online": this.status_dot.set_from_icon_name("dino-status-online"); i = full_jids.size; break; + case "away": this.status_dot.set_from_icon_name("dino-status-away"); break; + case "xa": this.status_dot.set_from_icon_name("dino-status-away"); break; + case "chat": this.status_dot.set_from_icon_name("dino-status-chat"); break; + } + } + } + else status_dot.set_from_icon_name("dino-status-offline"); + } + public ListRow.from_jid(StreamInteractor stream_interactor, Jid jid, Account account, bool show_account) { this.jid = jid; this.account = account; @@ -46,6 +72,7 @@ public class ListRow : Widget { } name_label.label = display_name; picture.model = new ViewModel.CompatAvatarPictureModel(stream_interactor).set_conversation(conv); + set_status_dot(stream_interactor, jid, account); } public override void dispose() { -- cgit v1.2.3-70-g09d2