diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60d587e9..cf600d3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,12 @@ name: Build on: [pull_request, push] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - run: sudo apt-get update - - run: sudo apt-get install -y build-essential gettext cmake valac libgee-0.8-dev libsqlite3-dev libgtk-3-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev libgspell-1-dev libnice-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsrtp2-dev libwebrtc-audio-processing-dev + - run: sudo apt-get remove libunwind-14-dev + - run: sudo apt-get install -y build-essential gettext cmake valac libgee-0.8-dev libsqlite3-dev libgtk-4-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev libgspell-1-dev libnice-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsrtp2-dev libwebrtc-audio-processing-dev - run: ./configure --with-tests --with-libsignal-in-tree - run: make - run: build/xmpp-vala-test diff --git a/CMakeLists.txt b/CMakeLists.txt index 518555bc..2b24e424 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,6 @@ endif(WIN32) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -set(GTK3_GLOBAL_VERSION 3.22) set(GLib_GLOBAL_VERSION 2.38) set(ICU_GLOBAL_VERSION 57) diff --git a/cmake/FindGDK4.cmake b/cmake/FindGDK4.cmake new file mode 100644 index 00000000..74ef583e --- /dev/null +++ b/cmake/FindGDK4.cmake @@ -0,0 +1,38 @@ +include(PkgConfigWithFallback) +find_pkg_config_with_fallback(GDK4 + PKG_CONFIG_NAME gdk-4.0 + LIB_NAMES gdk-4 + INCLUDE_NAMES gdk/gdk.h + INCLUDE_DIR_SUFFIXES gtk-4.0 gtk-4.0/include gtk+-4.0 gtk+-4.0/include + DEPENDS Pango Cairo GDKPixbuf2 +) + +if(GDK4_FOUND AND NOT GDK4_VERSION) + find_file(GDK4_VERSION_HEADER "gdk/gdkversionmacros.h" HINTS ${GDK4_INCLUDE_DIRS}) + mark_as_advanced(GDK4_VERSION_HEADER) + + if(GDK4_VERSION_HEADER) + file(STRINGS "${GDK4_VERSION_HEADER}" GDK4_MAJOR_VERSION REGEX "^#define GDK_MAJOR_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GDK_MAJOR_VERSION \\(?([0-9]+)\\)?$" "\\1" GDK4_MAJOR_VERSION "${GDK4_MAJOR_VERSION}") + file(STRINGS "${GDK4_VERSION_HEADER}" GDK4_MINOR_VERSION REGEX "^#define GDK_MINOR_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GDK_MINOR_VERSION \\(?([0-9]+)\\)?$" "\\1" GDK4_MINOR_VERSION "${GDK4_MINOR_VERSION}") + file(STRINGS "${GDK4_VERSION_HEADER}" GDK4_MICRO_VERSION REGEX "^#define GDK_MICRO_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GDK_MICRO_VERSION \\(?([0-9]+)\\)?$" "\\1" GDK4_MICRO_VERSION "${GDK4_MICRO_VERSION}") + set(GDK4_VERSION "${GDK4_MAJOR_VERSION}.${GDK4_MINOR_VERSION}.${GDK4_MICRO_VERSION}") + unset(GDK4_MAJOR_VERSION) + unset(GDK4_MINOR_VERSION) + unset(GDK4_MICRO_VERSION) + endif() +endif() + +if (GDK4_FOUND) + find_file(GDK4_WITH_X11 "gdk/gdkx.h" HINTS ${GDK4_INCLUDE_DIRS}) + if (GDK4_WITH_X11) + set(GDK4_WITH_X11 yes CACHE INTERNAL "Does GDK4 support X11") + endif (GDK4_WITH_X11) +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GDK4 + REQUIRED_VARS GDK4_LIBRARY + VERSION_VAR GDK4_VERSION) \ No newline at end of file diff --git a/cmake/FindGTK4.cmake b/cmake/FindGTK4.cmake new file mode 100644 index 00000000..23819bca --- /dev/null +++ b/cmake/FindGTK4.cmake @@ -0,0 +1,30 @@ +include(PkgConfigWithFallback) +find_pkg_config_with_fallback(GTK4 + PKG_CONFIG_NAME gtk4 + LIB_NAMES gtk-4 + INCLUDE_NAMES gtk/gtk.h + INCLUDE_DIR_SUFFIXES gtk-4.0 gtk-4.0/include gtk+-4.0 gtk+-4.0/include gtk4 gtk4/include +) + +if(GTK4_FOUND AND NOT GTK4_VERSION) + find_file(GTK4_VERSION_HEADER "gtk/gtkversion.h" HINTS ${GTK4_INCLUDE_DIRS}) + mark_as_advanced(GTK4_VERSION_HEADER) + + if(GTK4_VERSION_HEADER) + file(STRINGS "${GTK4_VERSION_HEADER}" GTK4_MAJOR_VERSION REGEX "^#define GTK_MAJOR_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GTK_MAJOR_VERSION \\(?([0-9]+)\\)?$" "\\1" GTK4_MAJOR_VERSION "${GTK4_MAJOR_VERSION}") + file(STRINGS "${GTK4_VERSION_HEADER}" GTK4_MINOR_VERSION REGEX "^#define GTK_MINOR_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GTK_MINOR_VERSION \\(?([0-9]+)\\)?$" "\\1" GTK4_MINOR_VERSION "${GTK4_MINOR_VERSION}") + file(STRINGS "${GTK4_VERSION_HEADER}" GTK4_MICRO_VERSION REGEX "^#define GTK_MICRO_VERSION +\\(?([0-9]+)\\)?$") + string(REGEX REPLACE "^#define GTK_MICRO_VERSION \\(?([0-9]+)\\)?$" "\\1" GTK4_MICRO_VERSION "${GTK4_MICRO_VERSION}") + set(GTK4_VERSION "${GTK4_MAJOR_VERSION}.${GTK4_MINOR_VERSION}.${GTK4_MICRO_VERSION}") + unset(GTK4_MAJOR_VERSION) + unset(GTK4_MINOR_VERSION) + unset(GTK4_MICRO_VERSION) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GTK4 + REQUIRED_VARS GTK4_LIBRARY + VERSION_VAR GTK4_VERSION) diff --git a/cmake/FindGspell.cmake b/cmake/FindGspell.cmake index 51c33c7e..de29ed1d 100644 --- a/cmake/FindGspell.cmake +++ b/cmake/FindGspell.cmake @@ -4,7 +4,7 @@ find_pkg_config_with_fallback(Gspell LIB_NAMES gspell-1 INCLUDE_NAMES gspell.h INCLUDE_DIR_SUFFIXES gspell-1 gspell-1/gspell - DEPENDS Gtk + DEPENDS GTK3 ) include(FindPackageHandleStandardArgs) diff --git a/libdino/src/entity/encryption.vala b/libdino/src/entity/encryption.vala index 193d741b..ab5a0ae0 100644 --- a/libdino/src/entity/encryption.vala +++ b/libdino/src/entity/encryption.vala @@ -1,12 +1,16 @@ namespace Dino.Entities { -public enum Encryption { + public enum Encryption { NONE, PGP, OMEMO, DTLS_SRTP, SRTP, - UNKNOWN, -} + UNKNOWN; + + public bool is_some() { + return this != NONE; + } + } } \ No newline at end of file diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala index c7c2c375..e4710732 100644 --- a/libdino/src/plugin/interfaces.vala +++ b/libdino/src/plugin/interfaces.vala @@ -12,7 +12,8 @@ public enum Priority { } public enum WidgetType { - GTK + GTK3, + GTK4 } public interface RootInterface : Object { @@ -27,6 +28,8 @@ public interface EncryptionListEntry : Object { public abstract void encryption_activated(Entities.Conversation conversation, Plugins.SetInputFieldStatus callback); public abstract Object? get_encryption_icon(Entities.Conversation conversation, ContentItem content_item); + public abstract string? get_encryption_icon_name(Entities.Conversation conversation, ContentItem content_item); + } public interface CallEncryptionEntry : Object { @@ -45,15 +48,11 @@ public abstract class AccountSettingsEntry : Object { public abstract string name { get; } public virtual int16 label_top_padding { get { return -1; } } - public abstract AccountSettingsWidget? get_widget(WidgetType type); -} - -public interface AccountSettingsWidget : Object { - public abstract void set_account(Account account); - public abstract signal void activated(); - public abstract void deactivate(); + + public abstract void set_account(Account account); + public abstract Object? get_widget(WidgetType type); } public interface ContactDetailsProvider : Object { @@ -76,10 +75,8 @@ public interface TextCommand : Object { public interface ConversationTitlebarEntry : Object { public abstract string id { get; } public abstract double order { get; } - public abstract ConversationTitlebarWidget? get_widget(WidgetType type); -} + public abstract Object? get_widget(WidgetType type); -public interface ConversationTitlebarWidget : Object { public abstract void set_conversation(Conversation conversation); public abstract void unset_conversation(); } @@ -146,10 +143,14 @@ public abstract class MetaConversationItem : Object { public bool requires_header { get; set; default=false; } public bool in_edit_mode { get; set; default=false; } - public abstract Object? get_widget(WidgetType type); + public abstract Object? get_widget(ConversationItemWidgetInterface outer, WidgetType type); public abstract Gee.List? get_item_actions(WidgetType type); } +public interface ConversationItemWidgetInterface: Object { + public abstract void set_widget(Object object, WidgetType type); +} + public delegate void MessageActionEvoked(Object button, Plugins.MetaConversationItem evoked_on, Object widget); public class MessageAction : Object { public string icon_name; diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala index e28c4de7..e2801508 100644 --- a/libdino/src/plugin/registry.vala +++ b/libdino/src/plugin/registry.vala @@ -3,7 +3,7 @@ using Gee; namespace Dino.Plugins { public class Registry { - internal ArrayList encryption_list_entries = new ArrayList(); + internal HashMap encryption_list_entries = new HashMap(); internal HashMap call_encryption_entries = new HashMap(); internal ArrayList account_settings_entries = new ArrayList(); internal ArrayList contact_details_entries = new ArrayList(); @@ -17,11 +17,9 @@ public class Registry { public bool register_encryption_list_entry(EncryptionListEntry entry) { lock(encryption_list_entries) { - foreach(var e in encryption_list_entries) { - if (e.encryption == entry.encryption) return false; - } - encryption_list_entries.add(entry); - encryption_list_entries.sort((a,b) => b.name.collate(a.name)); + if (encryption_list_entries.has_key(entry.encryption)) return false; + + encryption_list_entries[entry.encryption] = entry; return true; } } diff --git a/libdino/src/service/call_peer_state.vala b/libdino/src/service/call_peer_state.vala index c97aa48d..c7fa04da 100644 --- a/libdino/src/service/call_peer_state.vala +++ b/libdino/src/service/call_peer_state.vala @@ -45,7 +45,10 @@ public class Dino.PeerState : Object { this.stream_interactor = stream_interactor; this.calls = stream_interactor.get_module(Calls.IDENTITY); - var session_info_type = stream_interactor.module_manager.get_module(call.account, Xep.JingleRtp.Module.IDENTITY).session_info_type; + Xep.JingleRtp.Module jinglertp_module = stream_interactor.module_manager.get_module(call.account, Xep.JingleRtp.Module.IDENTITY); + if (jinglertp_module == null) return; + + var session_info_type = jinglertp_module.session_info_type; session_info_type.mute_update_received.connect((session,mute, name) => { if (this.sid != session.sid) return; diff --git a/libdino/src/service/calls.vala b/libdino/src/service/calls.vala index 094a45c9..35b88866 100644 --- a/libdino/src/service/calls.vala +++ b/libdino/src/service/calls.vala @@ -465,8 +465,8 @@ namespace Dino { call_state.cim_message_type = message_stanza.type_; Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).approx_conversation_for_stanza(from_jid, to_jid, account, message_stanza.type_); - conversation.last_active = call_state.call.time; if (conversation == null) return; + conversation.last_active = call_state.call.time; if (call_state.call.direction == Call.DIRECTION_INCOMING) { call_incoming(call_state.call, call_state, conversation, video_requested, multiparty); diff --git a/libdino/src/service/content_item_store.vala b/libdino/src/service/content_item_store.vala index c6c47af4..6371e00b 100644 --- a/libdino/src/service/content_item_store.vala +++ b/libdino/src/service/content_item_store.vala @@ -44,37 +44,11 @@ public class ContentItemStore : StreamInteractionModule, Object { Gee.TreeSet items = new Gee.TreeSet(ContentItem.compare_func); foreach (var row in select) { - int provider = row[db.content_item.content_type]; + int id = row[db.content_item.id]; + int content_type = row[db.content_item.content_type]; int foreign_id = row[db.content_item.foreign_id]; DateTime time = new DateTime.from_unix_utc(row[db.content_item.time]); - switch (provider) { - case 1: - Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(foreign_id, conversation); - if (message != null) { - var message_item = new MessageItem(message, conversation, row[db.content_item.id]); - message_item.time = time; // In case of message corrections, the original time should be used - items.add(message_item); - } - break; - case 2: - FileTransfer? file_transfer = stream_interactor.get_module(FileTransferStorage.IDENTITY).get_file_by_id(foreign_id, conversation); - if (file_transfer != null) { - Message? message = null; - if (file_transfer.provider == 0 && file_transfer.info != null) { - message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(int.parse(file_transfer.info), conversation); - } - var file_item = new FileItem(file_transfer, conversation, row[db.content_item.id], message); - items.add(file_item); - } - break; - case 3: - Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(foreign_id, conversation); - if (call != null) { - var call_item = new CallItem(call, conversation, row[db.content_item.id]); - items.add(call_item); - } - break; - } + items.add(get_item(conversation, id, content_type, foreign_id, time)); } Gee.List ret = new ArrayList(); @@ -84,7 +58,42 @@ public class ContentItemStore : StreamInteractionModule, Object { return ret; } - public ContentItem? get_item(Conversation conversation, int type, int foreign_id) { + public ContentItem get_item(Conversation conversation, int id, int content_type, int foreign_id, DateTime time) throws Error { + switch (content_type) { + case 1: + Message? message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(foreign_id, conversation); + if (message != null) { + var message_item = new MessageItem(message, conversation, id); + message_item.time = time; // In case of message corrections, the original time should be used + return message_item; + } + break; + case 2: + FileTransfer? file_transfer = stream_interactor.get_module(FileTransferStorage.IDENTITY).get_file_by_id(foreign_id, conversation); + if (file_transfer != null) { + Message? message = null; + if (file_transfer.provider == 0 && file_transfer.info != null) { + message = stream_interactor.get_module(MessageStorage.IDENTITY).get_message_by_id(int.parse(file_transfer.info), conversation); + } + var file_item = new FileItem(file_transfer, conversation, id, message); + return file_item; + } + break; + case 3: + Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(foreign_id, conversation); + if (call != null) { + var call_item = new CallItem(call, conversation, id); + return call_item; + } + break; + default: + warning("Unknown content item type: %i", content_type); + break; + } + throw new Error(-1, 0, "Bad content type %i or non existing content item %i", content_type, foreign_id); + } + + public ContentItem? get_item_by_foreign(Conversation conversation, int type, int foreign_id) { QueryBuilder select = db.content_item.select() .with(db.content_item.content_type, "=", type) .with(db.content_item.foreign_id, "=", foreign_id); @@ -122,6 +131,26 @@ public class ContentItemStore : StreamInteractionModule, Object { return get_items_from_query(select, conversation); } +// public Gee.List get_latest_meta(Conversation conversation, int count) { +// QueryBuilder select = db.content_item.select() +// .with(db.content_item.conversation_id, "=", conversation.id) +// .with(db.content_item.hide, "=", false) +// .order_by(db.content_item.time, "DESC") +// .order_by(db.content_item.id, "DESC") +// .limit(count); +// +// var ret = new ArrayList(); +// foreach (var row in select) { +// var item_meta = new ContentItemMeta() { +// id = row[db.content_item.id], +// content_type = row[db.content_item.content_type], +// foreign_id = row[db.content_item.foreign_id], +// time = new DateTime.from_unix_utc(row[db.content_item.time]) +// }; +// } +// return ret; +// } + public Gee.List get_before(Conversation conversation, ContentItem item, int count) { long time = (long) item.time.to_unix(); QueryBuilder select = db.content_item.select() diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala index cc5489c3..23db5762 100644 --- a/libdino/src/service/counterpart_interaction_manager.vala +++ b/libdino/src/service/counterpart_interaction_manager.vala @@ -154,7 +154,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object { conversation.read_up_to = message; // TODO: This only marks messages as read, not http file transfers. - ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id); + ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_foreign(conversation, 1, message.id); if (content_item == null) return; ContentItem? read_up_to_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_id(conversation, conversation.read_up_to_item); if (read_up_to_item != null && read_up_to_item.compare(content_item) > 0) return; diff --git a/libdino/src/service/message_correction.vala b/libdino/src/service/message_correction.vala index 322fa1c1..d5d15578 100644 --- a/libdino/src/service/message_correction.vala +++ b/libdino/src/service/message_correction.vala @@ -144,7 +144,7 @@ public class MessageCorrection : StreamInteractionModule, MessageListener { } private void on_received_correction(Conversation conversation, int message_id) { - ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message_id); + ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_foreign(conversation, 1, message_id); if (content_item != null) { received_correction(content_item); } diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index a34ca1c9..9239bfec 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -3,53 +3,55 @@ find_package(Gettext) include(${GETTEXT_USE_FILE}) gettext_compile(${GETTEXT_PACKAGE} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/po TARGET_NAME ${GETTEXT_PACKAGE}-translations) +find_package(GTK4 REQUIRED) find_packages(MAIN_PACKAGES REQUIRED Gee GLib GModule GObject - GTK3 + GTK4 ICU - Gspell ) set(RESOURCE_LIST - icons/dino-account-plus-symbolic.svg - icons/dino-changes-allowed-symbolic.svg - icons/dino-changes-prevent-symbolic.svg - icons/dino-conversation-list-placeholder-arrow.svg - icons/dino-double-tick-symbolic.svg - icons/dino-emoticon-symbolic.svg - icons/dino-qr-code-symbolic.svg - icons/dino-security-high-symbolic.svg - icons/dino-microphone-off-symbolic.svg - icons/dino-microphone-symbolic.svg - icons/dino-party-popper-symbolic.svg - icons/dino-phone-hangup-symbolic.svg - icons/dino-phone-in-talk-symbolic.svg - icons/dino-phone-missed-symbolic.svg - icons/dino-phone-ring-symbolic.svg - icons/dino-phone-symbolic.svg - icons/dino-status-away.svg - icons/dino-status-chat.svg - icons/dino-status-dnd.svg - icons/dino-status-online.svg - icons/im.dino.Dino.svg - icons/im.dino.Dino-symbolic.svg - icons/dino-tick-symbolic.svg - icons/dino-video-off-symbolic.svg - icons/dino-video-symbolic.svg + icons/scalable/actions/dino-account-plus-symbolic.svg - icons/dino-device-desktop-symbolic.svg - icons/dino-device-phone-symbolic.svg + icons/scalable/apps/im.dino.Dino.svg + icons/scalable/apps/im.dino.Dino-symbolic.svg - icons/dino-file-document-symbolic.svg - icons/dino-file-download-symbolic.svg - icons/dino-file-image-symbolic.svg - icons/dino-file-music-symbolic.svg - icons/dino-file-symbolic.svg - icons/dino-file-table-symbolic.svg - icons/dino-file-video-symbolic.svg + icons/scalable/devices/dino-device-desktop-symbolic.svg + icons/scalable/devices/dino-device-phone-symbolic.svg + icons/scalable/devices/dino-phone-hangup-symbolic.svg + icons/scalable/devices/dino-phone-in-talk-symbolic.svg + icons/scalable/devices/dino-phone-missed-symbolic.svg + icons/scalable/devices/dino-phone-ring-symbolic.svg + icons/scalable/devices/dino-phone-symbolic.svg + + icons/scalable/emotes/dino-emoticon-symbolic.svg + + icons/scalable/mimetypes/dino-file-document-symbolic.svg + icons/scalable/mimetypes/dino-file-download-symbolic.svg + icons/scalable/mimetypes/dino-file-image-symbolic.svg + icons/scalable/mimetypes/dino-file-music-symbolic.svg + icons/scalable/mimetypes/dino-file-symbolic.svg + icons/scalable/mimetypes/dino-file-table-symbolic.svg + icons/scalable/mimetypes/dino-file-video-symbolic.svg + + icons/scalable/status/dino-double-tick-symbolic.svg + icons/scalable/status/dino-microphone-off-symbolic.svg + icons/scalable/status/dino-microphone-symbolic.svg + icons/scalable/status/dino-security-high-symbolic.svg + icons/scalable/status/dino-status-away.svg + 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-tick-symbolic.svg + icons/scalable/status/dino-video-off-symbolic.svg + icons/scalable/status/dino-video-symbolic.svg + + icons/scalable/ui/dino-conversation-list-placeholder-arrow.svg + icons/scalable/ui/dino-qr-code-symbolic.svg + icons/scalable/ui/dino-party-popper-symbolic.svg add_conversation/add_contact_dialog.ui add_conversation/add_groupchat_dialog.ui @@ -60,13 +62,13 @@ set(RESOURCE_LIST call_widget.ui chat_input.ui contact_details_dialog.ui + conversation_item_widget.ui conversation_list_titlebar.ui conversation_list_titlebar_csd.ui conversation_row.ui conversation_view.ui file_default_widget.ui file_send_overlay.ui - emojichooser.ui global_search.ui conversation_content_view/item_metadata_header.ui conversation_content_view/view.ui @@ -101,13 +103,13 @@ compile_gresources( unset(MAIN_EXTRA_OPTIONS) unset(MAIN_EXTRA_PACKAGES) -find_package(GDK3) -if(GDK3_WITH_X11) - set(MAIN_EXTRA_OPTIONS ${MAIN_EXTRA_OPTIONS} -D GDK3_WITH_X11) - set(MAIN_EXTRA_PACKAGES ${MAIN_EXTRA_PACKAGES} gdk-x11-3.0) -endif(GDK3_WITH_X11) set(MAIN_EXTRA_OPTIONS ${MAIN_EXTRA_OPTIONS} --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi) +set(MAIN_DEFINITIONS) +if(GTK4_VERSION VERSION_GREATER_EQUAL "4.6") + set(MAIN_DEFINITIONS ${MAIN_DEFINITIONS} GTK_4_6) +endif() + vala_precompile(MAIN_VALA_C SOURCES src/main.vala @@ -145,24 +147,6 @@ SOURCES src/ui/call_window/participant_widget.vala src/ui/call_window/video_settings_popover.vala - src/ui/chat_input/chat_input_controller.vala - src/ui/chat_input/chat_text_view.vala - src/ui/chat_input/edit_history.vala - src/ui/chat_input/encryption_button.vala - src/ui/chat_input/occupants_tab_completer.vala - src/ui/chat_input/smiley_converter.vala - src/ui/chat_input/spell_checker.vala - src/ui/chat_input/view.vala - - src/ui/contact_details/blocking_provider.vala - src/ui/contact_details/settings_provider.vala - src/ui/contact_details/permissions_provider.vala - src/ui/contact_details/dialog.vala - src/ui/contact_details/muc_config_form_provider.vala - - src/ui/conversation_selector/conversation_selector_row.vala - src/ui/conversation_selector/conversation_selector.vala - src/ui/conversation_content_view/call_widget.vala src/ui/conversation_content_view/chat_state_populator.vala src/ui/conversation_content_view/content_populator.vala @@ -175,6 +159,22 @@ SOURCES src/ui/conversation_content_view/message_widget.vala src/ui/conversation_content_view/subscription_notification.vala + src/ui/chat_input/chat_input_controller.vala + src/ui/chat_input/chat_text_view.vala + src/ui/chat_input/encryption_button.vala + src/ui/chat_input/occupants_tab_completer.vala + src/ui/chat_input/smiley_converter.vala + src/ui/chat_input/view.vala + + src/ui/contact_details/blocking_provider.vala + src/ui/contact_details/settings_provider.vala + src/ui/contact_details/permissions_provider.vala + src/ui/contact_details/dialog.vala + src/ui/contact_details/muc_config_form_provider.vala + + src/ui/conversation_selector/conversation_selector.vala + src/ui/conversation_selector/conversation_selector_row.vala + src/ui/conversation_titlebar/call_entry.vala src/ui/conversation_titlebar/menu_entry.vala src/ui/conversation_titlebar/occupants_entry.vala @@ -197,28 +197,28 @@ SOURCES src/ui/util/sizing_bin.vala src/ui/util/size_request_box.vala src/ui/util/scaling_image.vala - src/ui/util/preview_file_chooser_native.vala CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/exports/xmpp-vala.vapi ${CMAKE_BINARY_DIR}/exports/qlite.vapi ${CMAKE_BINARY_DIR}/exports/dino_internal.vapi - vapi/emojichooser.vapi PACKAGES ${MAIN_PACKAGES} ${MAIN_EXTRA_PACKAGES} GRESOURCES ${MAIN_GRESOURCES_XML} +DEFINITIONS + ${MAIN_DEFINITIONS} OPTIONS ${MAIN_EXTRA_OPTIONS} ) -add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\") +add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\" -DG_LOG_DOMAIN="dino") if(WIN32) add_link_options("-Wl,--export-all-symbols") set(CMAKE_RC_COMPILE_OBJECT " --use-temp-file -O coff -i -o ") - add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET} src/emojichooser.c dino-info.rc) + add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET} dino-info.rc) else(WIN32) - add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET} src/emojichooser.c) + add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET}) endif(WIN32) add_dependencies(dino ${GETTEXT_PACKAGE}-translations) target_include_directories(dino PRIVATE src) @@ -232,18 +232,5 @@ install(TARGETS dino ${TARGET_INSTALL}) install(FILES data/im.dino.Dino.appdata.xml DESTINATION ${APPDATA_FILE_INSTALL_DIR}) install(FILES data/im.dino.Dino.desktop DESTINATION ${DESKTOP_FILE_INSTALL_DIR}) install(FILES data/im.dino.Dino.service DESTINATION ${SERVICE_FILE_INSTALL_DIR}) -install(FILES data/icons/im.dino.Dino.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/scalable/apps) -install(FILES data/icons/im.dino.Dino-symbolic.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/symbolic/apps) -install(FILES - data/icons/dino-status-away.svg - data/icons/dino-status-chat.svg - data/icons/dino-status-dnd.svg - data/icons/dino-status-online.svg - - data/icons/dino-changes-prevent-symbolic.svg - data/icons/dino-double-tick-symbolic.svg - data/icons/dino-qr-code-symbolic.svg - data/icons/dino-tick-symbolic.svg -DESTINATION - ${ICON_INSTALL_DIR}/hicolor/scalable/status -) +install(FILES data/icons/scalable/apps/im.dino.Dino.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/scalable/apps) +install(FILES data/icons/scalable/apps/im.dino.Dino-symbolic.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/symbolic/apps) diff --git a/main/data/add_conversation/add_contact_dialog.ui b/main/data/add_conversation/add_contact_dialog.ui index 6185c5ba..2a9884b6 100644 --- a/main/data/add_conversation/add_contact_dialog.ui +++ b/main/data/add_conversation/add_contact_dialog.ui @@ -1,128 +1,101 @@ + - + \ No newline at end of file diff --git a/main/data/add_conversation/add_groupchat_dialog.ui b/main/data/add_conversation/add_groupchat_dialog.ui index 29638f53..468051f5 100644 --- a/main/data/add_conversation/add_groupchat_dialog.ui +++ b/main/data/add_conversation/add_groupchat_dialog.ui @@ -1,201 +1,164 @@ + - + \ No newline at end of file diff --git a/main/data/add_conversation/conference_details_fragment.ui b/main/data/add_conversation/conference_details_fragment.ui index a4f6f5d3..158d35c0 100644 --- a/main/data/add_conversation/conference_details_fragment.ui +++ b/main/data/add_conversation/conference_details_fragment.ui @@ -1,272 +1,236 @@ +