2005-09-15 [paul] 1.9.14cvs31
authorPaul Mangan <paul@claws-mail.org>
Thu, 15 Sep 2005 07:50:55 +0000 (07:50 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 15 Sep 2005 07:50:55 +0000 (07:50 +0000)
* src/prefs_actions.c
* src/prefs_filtering_action.c
* src/prefs_quote.c
* src/quote_fmt.c
* src/summaryview.c
* src/gtk/description_window.c
* src/gtk/description_window.h
* src/gtk/quicksearch.c
allow interaction with the called
description window
Patch by Anders Hammar

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/gtk/description_window.c
src/gtk/description_window.h
src/gtk/quicksearch.c
src/prefs_actions.c
src/prefs_filtering_action.c
src/prefs_quote.c
src/quote_fmt.c
src/summaryview.c

index 6e5ee12..6dc53b9 100644 (file)
@@ -1,3 +1,17 @@
+2005-09-15 [paul]      1.9.14cvs31
+
+       * src/prefs_actions.c
+       * src/prefs_filtering_action.c
+       * src/prefs_quote.c
+       * src/quote_fmt.c
+       * src/summaryview.c
+       * src/gtk/description_window.c
+       * src/gtk/description_window.h
+       * src/gtk/quicksearch.c
+               allow interaction with the called
+               description window
+               Patch by Anders Hammar
+
 2005-09-14 [paul]      1.9.14cvs30
 
        * src/compose.c
index 32d7c0c..09d0290 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.2.2.14 -r 1.2.2.15 po/sk.po;  ) > 1.9.14cvs28.patchset
 ( cvs diff -u -r 1.105.2.33 -r 1.105.2.34 src/prefs_account.c;  ) > 1.9.14cvs29.patchset
 ( cvs diff -u -r 1.382.2.169 -r 1.382.2.170 src/compose.c;  ) > 1.9.14cvs30.patchset
+( cvs diff -u -r 1.60.2.21 -r 1.60.2.22 src/prefs_actions.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/prefs_filtering_action.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/prefs_quote.c;  cvs diff -u -r 1.8.2.2 -r 1.8.2.3 src/quote_fmt.c;  cvs diff -u -r 1.395.2.123 -r 1.395.2.124 src/summaryview.c;  cvs diff -u -r 1.5.2.11 -r 1.5.2.12 src/gtk/description_window.c;  cvs diff -u -r 1.1 -r 1.2 src/gtk/description_window.h;  cvs diff -u -r 1.1.2.20 -r 1.1.2.21 src/gtk/quicksearch.c;  ) > 1.9.14cvs31.patchset
index b81bc81..c3cb337 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=30
+EXTRA_VERSION=31
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dc78a4f..a4d4678 100644 (file)
 #include "description_window.h"
 #include "gtkutils.h"
 
-static void description_create                 (DescriptionWindow *dwindow);
-static gboolean description_window_key_pressed (GtkWidget *widget,
-                                                GdkEventKey *event,
-                                                gpointer data);
+static void description_create                         (DescriptionWindow *dwindow);
+static gboolean description_window_key_pressed         (GtkWidget *widget,
+                                                        GdkEventKey *event,
+                                                        gpointer data);
+static gboolean description_window_focus_in_event      (GtkWidget *widget,
+                                                        GdkEventFocus *event,
+                                                        gpointer data);
+static gboolean description_window_focus_out_event     (GtkWidget *widget,
+                                                        GdkEventFocus *event,
+                                                        gpointer data);
+
 
 void description_window_create(DescriptionWindow *dwindow)
 {
-       if (!dwindow->window)
+       if (!dwindow->window) {
                description_create(dwindow);
-
-       manage_window_set_transient(GTK_WINDOW(dwindow->window));
-       gtk_widget_show(dwindow->window);
-       gtk_main();
-       gtk_widget_hide(dwindow->window);
+       
+               gtk_window_set_transient_for(GTK_WINDOW(dwindow->window), GTK_WINDOW(dwindow->parent));
+       
+               gtk_widget_show(dwindow->window);
+               gtk_main();
+               gtk_widget_hide(dwindow->window);
+               gtk_widget_destroy(dwindow->window);
+               dwindow->window = NULL; 
+       } else printf("windows exist\n");
 }
 
 static void description_create(DescriptionWindow * dwindow)
@@ -137,6 +148,10 @@ static void description_create(DescriptionWindow * dwindow)
                         G_CALLBACK(gtk_main_quit), NULL);
        g_signal_connect(G_OBJECT(dwindow->window), "key_press_event",
                         G_CALLBACK(description_window_key_pressed), NULL);
+       g_signal_connect(G_OBJECT(dwindow->window), "focus_in_event",
+                        G_CALLBACK(description_window_focus_in_event), NULL);
+       g_signal_connect(G_OBJECT(dwindow->window), "focus_out_event",
+                        G_CALLBACK(description_window_focus_out_event), NULL);
        g_signal_connect(G_OBJECT(dwindow->window), "delete_event",
                         G_CALLBACK(gtk_main_quit), NULL);
 
@@ -144,11 +159,32 @@ static void description_create(DescriptionWindow * dwindow)
 }
 
 static gboolean description_window_key_pressed(GtkWidget *widget,
-                                          GdkEventKey *event,
-                                          gpointer data)
+                                              GdkEventKey *event,
+                                              gpointer data)
 {
        if (event && event->keyval == GDK_Escape)
                gtk_main_quit();
        return FALSE;
 }
 
+static gboolean description_window_focus_in_event (GtkWidget *widget,
+                                                  GdkEventFocus *event,
+                                                  gpointer data)
+{
+       if (gtk_grab_get_current != widget)
+               gtk_grab_add(GTK_WINDOW(widget));
+
+       return FALSE;
+}
+
+static gboolean description_window_focus_out_event (GtkWidget *widget,
+                                                  GdkEventFocus *event,
+                                                  gpointer data)
+{
+       gtk_grab_remove(GTK_WINDOW(widget));
+               
+       return FALSE;
+}
+
+
+
index 9c3f7eb..d94d0c9 100644 (file)
@@ -25,6 +25,7 @@ typedef struct _DescriptionWindow DescriptionWindow;
 struct _DescriptionWindow
 {
        GtkWidget       * window;
+       GtkWidget       * parent;
        /** Number of columns for each line of data **/
        int               columns;
        /** title of the window **/
index 3812370..46668d0 100644 (file)
@@ -251,6 +251,7 @@ static gchar *search_descr_strings[] = {
 };
  
 static DescriptionWindow search_descr = {
+       NULL,
        NULL, 
        2,
        N_("Extended Search symbols"),
index dbba7e8..b3cdbcd 100644 (file)
@@ -77,7 +77,7 @@ static gint prefs_actions_clist_set_row       (GtkTreeIter *row);
 
 /* callback functions */
 static void prefs_actions_help_cb      (GtkWidget      *w,
-                                        gpointer        data);
+                                        GtkWidget      *window);
 static void prefs_actions_register_cb  (GtkWidget      *w,
                                         gpointer        data);
 static void prefs_actions_substitute_cb        (GtkWidget      *w,
@@ -261,7 +261,7 @@ static void prefs_actions_create(MainWindow *mainwin)
        gtk_widget_show(help_button);
        gtk_box_pack_end(GTK_BOX(reg_hbox), help_button, FALSE, FALSE, 0);
        g_signal_connect(G_OBJECT(help_button), "clicked",
-                        G_CALLBACK(prefs_actions_help_cb), NULL);
+                        G_CALLBACK(prefs_actions_help_cb), GTK_WINDOW(window));
 
        cond_hbox = gtk_hbox_new(FALSE, 8);
        gtk_widget_show(cond_hbox);
@@ -776,15 +776,17 @@ static gchar *actions_desc_strings[] = {
 
 
 static DescriptionWindow actions_desc_win = { 
-        NULL, 
-        2,
-        N_("Description of symbols"),
+       NULL,
+       NULL,
+       2,
+       N_("Description of symbols"),
         actions_desc_strings
 };
 
 
-static void prefs_actions_help_cb(GtkWidget *w, gpointer data)
+static void prefs_actions_help_cb(GtkWidget *w, GtkWidget *window)
 {
+       actions_desc_win.parent = window;
        description_window_create(&actions_desc_win);
 }
 
index e307421..608f058 100644 (file)
@@ -1055,6 +1055,7 @@ static gchar *exec_desc_strings[] = {
 };
 
 static DescriptionWindow exec_desc_win = { 
+       NULL,
         NULL, 
         2,
         N_("Description of symbols"),
index 09f11b9..a0293a6 100644 (file)
@@ -182,7 +182,7 @@ void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_widget_show (btn_quotedesc);
        gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
        g_signal_connect(G_OBJECT(btn_quotedesc), "clicked",
-                        G_CALLBACK(quote_fmt_quote_description), NULL);
+                        G_CALLBACK(quote_fmt_quote_description), GTK_WIDGET(window));
 
        /* quote chars */
 
index 73717f7..1f8f6a6 100644 (file)
@@ -71,15 +71,17 @@ static gchar *quote_desc_strings[] = {
 };
 
 static DescriptionWindow quote_desc_win = { 
-        NULL, 
+        NULL,
+       NULL,
         2,
         N_("Description of symbols"),
         quote_desc_strings
 };
 
 
-void quote_fmt_quote_description(void)
+void quote_fmt_quote_description(GtkWidget *widget, GtkWidget *pref_window)
 {
+       quote_desc_win.parent = pref_window;
        description_window_create(&quote_desc_win);
 }
 
index 6684528..0ba613a 100644 (file)
@@ -1630,9 +1630,12 @@ void summary_select_node(SummaryView *summaryview, GtkCTreeNode *node,
 
 static guint summary_get_msgnum(SummaryView *summaryview, GtkCTreeNode *node)
 {
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+       GtkCTree *ctree =NULL;
        MsgInfo *msginfo;
 
+       if (!summaryview)
+               return 0;
+       ctree = GTK_CTREE(summaryview->ctree);
        if (!node)
                return 0;
        msginfo = gtk_ctree_node_get_row_data(ctree, node);
@@ -2090,7 +2093,10 @@ static void summary_set_column_titles(SummaryView *summaryview)
 
 void summary_reflect_prefs(void)
 {
-       SummaryView *summaryview = mainwindow_get_mainwindow()->summaryview;
+       SummaryView *summaryview = NULL;
+       if (!mainwindow_get_mainwindow())
+               return;
+       summaryview = mainwindow_get_mainwindow()->summaryview;
        bold_style = bold_marked_style = bold_deleted_style = 
                small_style = small_marked_style = small_deleted_style = NULL;
        summary_set_fonts(summaryview);