From 5752a3d49b6df46096f01c35b251c5f6f7ec259c Mon Sep 17 00:00:00 2001 From: raveit65 Date: Fri, 20 Oct 2023 19:40:07 +0200 Subject: replace deprecated gtk_image_menu_item* --- .build.yml | 32 +++++++++++++++++++++++++++ configure.ac | 5 +++++ plugins/spell/Makefile.am | 6 ++++- plugins/spell/pluma-automatic-spell-checker.c | 14 +++++++----- 4 files changed, 50 insertions(+), 7 deletions(-) diff --git a/.build.yml b/.build.yml index 2eeb7461..42f9e6f5 100644 --- a/.build.yml +++ b/.build.yml @@ -22,6 +22,9 @@ requires: - python3 - which - yelp-tools + # mate-desktop dependencies + - dconf + - iso-codes debian: # Useful URL: https://github.com/mate-desktop/debian-packages @@ -50,6 +53,9 @@ requires: - python3-dev - python3-lxml - yelp-tools + # mate-desktop dependencies + - iso-codes + - libdconf-dev fedora: # Useful URL: https://src.fedoraproject.org/cgit/rpms/pluma.git @@ -73,6 +79,10 @@ requires: - python3-devel - python3-lxml - redhat-rpm-config + # mate-desktop dependencies + - dconf-devel + - gobject-introspection-devel + - iso-codes-devel ubuntu: - autopoint @@ -97,6 +107,9 @@ requires: - python3-dev - python3-lxml - yelp-tools + # mate-desktop dependencies + - iso-codes + - libdconf-dev variables: - 'CHECKERS=" @@ -115,8 +128,27 @@ variables: -enable-checker alpha.unix.cstring.OutOfBounds -enable-checker alpha.core.FixedAddr -enable-checker security.insecureAPI.strcpy"' + - MATE_DESKTOP_VERSION=1.27.1 before_scripts: + - cd ${START_DIR} + - if [ ! -f mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz ];then + - curl -Ls -o mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz https://github.com/mate-desktop/mate-desktop/releases/download/v${MATE_DESKTOP_VERSION}/mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz + - fi + - tar xf mate-desktop-${MATE_DESKTOP_VERSION}.tar.xz + - cd mate-desktop-${MATE_DESKTOP_VERSION} + - if [ ${DISTRO_NAME} == "debian" -o ${DISTRO_NAME} == "ubuntu" ];then + - ./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu + - else + - ./autogen.sh --prefix=/usr + - fi + - if [ ${TRAVIS} == "false" ]; then + - make clean + - fi + - make + - make install + + - cd ${START_DIR} - curl -Ls -o /usr/bin/gla11y https://github.com/hypra/gla11y/raw/v0.3/gla11y - chmod +x /usr/bin/gla11y diff --git a/configure.ac b/configure.ac index aeb49875..23610802 100644 --- a/configure.ac +++ b/configure.ac @@ -157,6 +157,7 @@ AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes") GTK_REQUIRED=3.22.0 GTKSOURCEVIEW_REQUIRED=4.0.2 +MATE_DESKTOP_REQUIRED=1.27.1 PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) PKG_CHECK_MODULES(PLUMA, [ @@ -171,6 +172,10 @@ PKG_CHECK_MODULES(PLUMA, [ libpeas-gtk-1.0 >= 1.2.0 ]) +PKG_CHECK_MODULES(MATE_DESKTOP, mate-desktop-2.0 >= $MATE_DESKTOP_REQUIRED) +AC_SUBST(MATE_DESKTOP_CFLAGS) +AC_SUBST(MATE_DESKTOP_LIBS) + PKG_CHECK_MODULES(X11, [x11]) PLUMA_CFLAGS="$PLUMA_CFLAGS $X11_CFLAGS" diff --git a/plugins/spell/Makefile.am b/plugins/spell/Makefile.am index 9a83544d..4a1d327b 100644 --- a/plugins/spell/Makefile.am +++ b/plugins/spell/Makefile.am @@ -5,6 +5,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ $(PLUMA_CFLAGS) \ $(ENCHANT_CFLAGS) \ + $(MATE_DESKTOP_CFLAGS) \ $(WARN_CFLAGS) plugin_LTLIBRARIES = libspell.la @@ -26,7 +27,10 @@ libspell_la_SOURCES = \ pluma-spell-utils.h libspell_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libspell_la_LIBADD = $(PLUMA_LIBS) $(ENCHANT_LIBS) +libspell_la_LIBADD = \ + $(PLUMA_LIBS) \ + $(ENCHANT_LIBS) \ + $(MATE_DESKTOP_LIBS) uidir = $(PLUMA_PLUGINS_DATA_DIR)/spell ui_files = spell-checker.ui languages-dialog.ui pluma-spell-setup-dialog.ui diff --git a/plugins/spell/pluma-automatic-spell-checker.c b/plugins/spell/pluma-automatic-spell-checker.c index e978cbb4..84165135 100644 --- a/plugins/spell/pluma-automatic-spell-checker.c +++ b/plugins/spell/pluma-automatic-spell-checker.c @@ -41,6 +41,8 @@ #include +#include + #include "pluma-automatic-spell-checker.h" #include "pluma-spell-utils.h" @@ -497,8 +499,8 @@ build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word) gtk_menu_shell_append (GTK_MENU_SHELL (topmenu), mi); /* Ignore all */ - mi = gtk_image_menu_item_new_with_mnemonic (_("_Ignore All")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), + mi = mate_image_menu_item_new_with_mnemonic (_("_Ignore All")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (mi), gtk_image_new_from_icon_name ("go-bottom", GTK_ICON_SIZE_MENU)); @@ -512,8 +514,8 @@ build_suggestion_menu (PlumaAutomaticSpellChecker *spell, const gchar *word) gtk_menu_shell_append (GTK_MENU_SHELL (topmenu), mi); /* + Add to Dictionary */ - mi = gtk_image_menu_item_new_with_mnemonic (_("_Add")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), + mi = mate_image_menu_item_new_with_mnemonic (_("_Add")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (mi), gtk_image_new_from_icon_name ("list-add", GTK_ICON_SIZE_MENU)); @@ -551,8 +553,8 @@ populate_popup (GtkTextView *textview, GtkMenu *menu, PlumaAutomaticSpellChecker /* then, on top of it, the suggestions menu. */ img = gtk_image_new_from_icon_name ("tools-check-spelling", GTK_ICON_SIZE_MENU); - mi = gtk_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions...")); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img); + mi = mate_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions...")); + mate_image_menu_item_set_image (MATE_IMAGE_MENU_ITEM (mi), img); word = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (spell->doc), &start, &end, FALSE); gtk_menu_item_set_submenu (GTK_MENU_ITEM (mi), -- cgit v1.2.1