Use new stock_pixmap API master
authorRicardo Mones <ricardo@mones.org>
Tue, 21 Feb 2017 22:49:32 +0000 (23:49 +0100)
committerRicardo Mones <ricardo@mones.org>
Tue, 21 Feb 2017 22:49:32 +0000 (23:49 +0100)
theme-reloader.c

index cb84ab050e7a74eeeed7a5564015e3bb95d66a98..123098d35bb554b5e4d484c1ef5504ebc64f9e3b 100644 (file)
@@ -24,6 +24,7 @@
 #include <gtk/gtk.h>
 
 #include "defs.h"
+#include "version.h"
 #include "plugin.h"
 #include "mainwindow.h"
 #include "menu.h"
@@ -34,7 +35,7 @@
 #include "addr_compl.h"
 
 #define PLUGIN_NAME (_("Theme Reloader"))
-#define VERSION "1.0.0"
+#define PLUGIN_VERSION "1.0.1"
 
 static void update_reload_themes_menu(void);
 
@@ -43,7 +44,7 @@ MainWindow *mainwin;
 static guint main_menu_id = 0;
 
 const gchar *plugin_name(void) { return PLUGIN_NAME; }
-const gchar *plugin_version(void) { return VERSION; }
+const gchar *plugin_version(void) { return PLUGIN_VERSION; }
 const gchar *plugin_type(void) { return "GTK2"; }
 const gchar *plugin_licence(void) { return "GPL3+"; }
 
@@ -69,6 +70,10 @@ static GtkActionEntry reloader_main_menu[] = {
 
 gint plugin_init(gchar **error)
 {
+       if (!check_plugin_version(MAKE_NUMERIC_VERSION(3,14,1,96),
+                       VERSION_NUMERIC, PLUGIN_NAME, error))
+               return -1;
+
        mainwin = mainwindow_get_mainwindow();
 
        gtk_action_group_add_actions(mainwin->action_group, reloader_main_menu,
@@ -114,13 +119,13 @@ static void reload_theme_cb(GtkAction *action, gpointer data)
 
        if (strcmp(prefs->pixmap_theme_path, theme) == 0) {
                debug_print("reloading theme '%s'\n", short_name);
-               main_window_reflect_prefs_all_real(FALSE);
+               stock_pixmap_invalidate_all_icons();
        } else {
                debug_print("switching theme to '%s'\n", short_name);
                g_free(prefs->pixmap_theme_path);
                prefs->pixmap_theme_path = g_strdup(theme);
-               main_window_reflect_prefs_all_real(TRUE);
        }
+       main_window_reflect_prefs_all_real(TRUE);
        compose_reflect_prefs_pixmap_theme();
        addrcompl_reflect_prefs_pixmap_theme();