fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / editvcard.c
index a07a7743486f69fa1e0446558ed0dbae1a6ab75d..115e40a3269d060cbc4e8139ead1fb096ae679c1 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2007 Match Grun and the Claws Mail team
+ * Copyright (C) 2001-2012 Match Grun 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 /*
@@ -23,6 +23,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include "defs.h"
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkstatusbar.h>
-#include <gtk/gtkfilesel.h>
-#include <gtk/gtkhseparator.h>
-#include <gtk/gtkstock.h>
+#include <gtk/gtk.h>
 
 #include "addressbook.h"
 #include "prefs_common.h"
@@ -131,7 +122,7 @@ static gint edit_vcard_delete_event( GtkWidget *widget, GdkEventAny *event, gboo
 }
 
 static gboolean edit_vcard_key_pressed( GtkWidget *widget, GdkEventKey *event, gboolean *cancelled ) {
-       if (event && event->keyval == GDK_Escape) {
+       if (event && event->keyval == GDK_KEY_Escape) {
                *cancelled = TRUE;
                gtk_main_quit();
        }
@@ -160,7 +151,7 @@ static void addressbook_edit_vcard_create( gboolean *cancelled ) {
        gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
        gtk_window_set_title(GTK_WINDOW(window), _("Edit vCard Entry"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(window), TRUE); 
+       gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(edit_vcard_delete_event),
                         cancelled);
@@ -254,7 +245,7 @@ AdapterDSource *addressbook_edit_vcard( AddressIndex *addrIndex, AdapterDSource
        gtk_widget_grab_focus(vcardedit.name_entry);
        gtk_widget_show(vcardedit.window);
        manage_window_set_transient(GTK_WINDOW(vcardedit.window));
-
+       gtk_window_set_modal(GTK_WINDOW(vcardedit.window), TRUE);
        edit_vcard_status_show( "" );
        if( ads ) {
                ds = ads->dataSource;
@@ -273,6 +264,7 @@ AdapterDSource *addressbook_edit_vcard( AddressIndex *addrIndex, AdapterDSource
 
        gtk_main();
        gtk_widget_hide(vcardedit.window);
+       gtk_window_set_modal(GTK_WINDOW(vcardedit.window), FALSE);
        if (cancelled == TRUE) return NULL;
 
        fin = FALSE;