summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2023-10-20 19:40:07 +0200
committermouse <[email protected]>2023-10-22 20:27:35 +0800
commit5752a3d49b6df46096f01c35b251c5f6f7ec259c (patch)
tree41e1cd84ac3b97c8d5f60020d4e54558f49caf38
parent2fdc5140395d7e1e0050b64af7f5eeb019ebbeb5 (diff)
downloadpluma-5752a3d49b6df46096f01c35b251c5f6f7ec259c.tar.bz2
pluma-5752a3d49b6df46096f01c35b251c5f6f7ec259c.tar.xz
replace deprecated gtk_image_menu_item*
-rw-r--r--.build.yml32
-rw-r--r--configure.ac5
-rw-r--r--plugins/spell/Makefile.am6
-rw-r--r--plugins/spell/pluma-automatic-spell-checker.c14
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 <glib/gi18n.h>
+#include <libmate-desktop/mate-image-menu-item.h>
+
#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),