2012-07-28 [ticho] 3.8.1cvs23
[claws.git] / src / gtk / pluginwindow.c
index 1a100f5d7a4c08fe2e1e780c0414dc5938a060af..26685f60a0686704747e9f3b54fb993edc9d3e94 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail Team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
@@ -184,7 +185,7 @@ static void unload_cb(GtkButton *button, PluginWindow *pluginwindow)
 {
        Plugin *plugin = pluginwindow->selected_plugin;
 
-       g_return_if_fail(plugin != NULL);
+       cm_return_if_fail(plugin != NULL);
        pluginwindow->loading = TRUE;
        plugin_unload(plugin);
        pluginwindow->loading = FALSE;
@@ -232,21 +233,21 @@ static gboolean pluginwindow_key_pressed(GtkWidget *widget, GdkEventKey *event,
 {
        if (event) {
                switch (event->keyval) {
-                       case GDK_Escape : 
-                       case GDK_Return : 
-                       case GDK_KP_Enter :
+                       case GDK_KEY_Escape : 
+                       case GDK_KEY_Return : 
+                       case GDK_KEY_KP_Enter :
                                close_cb(NULL, pluginwindow);
                                break;
-                       case GDK_Insert : 
-                       case GDK_KP_Insert :
-                       case GDK_KP_Add : 
-                       case GDK_plus :
+                       case GDK_KEY_Insert : 
+                       case GDK_KEY_KP_Insert :
+                       case GDK_KEY_KP_Add : 
+                       case GDK_KEY_plus :
                                load_cb(NULL, pluginwindow);
                                break;
-                       case GDK_Delete : 
-                       case GDK_KP_Delete :
-                       case GDK_KP_Subtract : 
-                       case GDK_minus :
+                       case GDK_KEY_Delete : 
+                       case GDK_KEY_KP_Delete :
+                       case GDK_KEY_KP_Subtract : 
+                       case GDK_KEY_minus :
                                unload_cb(NULL, pluginwindow);
                                break;
                        default :
@@ -262,7 +263,7 @@ static gboolean pluginwindow_key_pressed(GtkWidget *widget, GdkEventKey *event,
 static void pluginwindow_size_allocate_cb(GtkWidget *widget,
                                         GtkAllocation *allocation)
 {
-       g_return_if_fail(allocation != NULL);
+       cm_return_if_fail(allocation != NULL);
 
        prefs_common.pluginswin_width = allocation->width;
        prefs_common.pluginswin_height = allocation->height;
@@ -293,7 +294,6 @@ void pluginwindow_create()
        GtkWidget *vbox3;
        GtkWidget *hbox_info;
        static GdkGeometry geometry;
-       CLAWS_TIP_DECL();       
 
        debug_print("Creating plugins window...\n");
 
@@ -409,6 +409,7 @@ void pluginwindow_create()
                           G_CALLBACK(pluginwindow_key_pressed), pluginwindow);
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(pluginwindow_delete_cb), pluginwindow);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        CLAWS_SET_TIP(load_btn,
                        _("Click here to load one or more plugins"));