summaryrefslogtreecommitdiff
blob: e075a05679d5fc2b355df1eb5f4c868875ffba78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Index: src/wp/ap/unix/ap_UnixDialog_Spell.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixDialog_Spell.cpp,v
retrieving revision 1.46
diff -u -5 -r1.46 ap_UnixDialog_Spell.cpp
--- src/wp/ap/unix/ap_UnixDialog_Spell.cpp	29 Jan 2006 15:36:28 -0000	1.46
+++ src/wp/ap/unix/ap_UnixDialog_Spell.cpp	29 Jan 2006 21:06:13 -0000
@@ -204,17 +204,15 @@
         while (bRes) {
      
             // show word in main window
             makeWordVisible();
      
+			gpointer inst = gtk_tree_view_get_selection (GTK_TREE_VIEW (m_lvSuggestions));
+			g_signal_handler_block (inst, m_listHandlerID);
             // update dialog with new misspelled word info/suggestions
             _updateWindow();
-     
-		m_listHandlerID = g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (m_lvSuggestions)), 
-						  "changed",
-						  G_CALLBACK (AP_UnixDialog_Spell__onSuggestionSelected), 
-						  (gpointer)this);
+			g_signal_handler_unblock (inst, m_listHandlerID);
 
 			// run into the GTK event loop for this window
 	    gint response = abiRunModalDialog (GTK_DIALOG(mainWindow), false);
 	    UT_DEBUGMSG (("ROB: response='%d'\n", response));
             switch(response) {
@@ -335,10 +333,14 @@
 												"text", COLUMN_SUGGESTION,
 												NULL);
 	GtkTreeViewColumn *column = gtk_tree_view_get_column (GTK_TREE_VIEW (m_lvSuggestions), 0);
 	gtk_tree_view_column_set_sort_column_id (column, COLUMN_SUGGESTION);
 
+	m_listHandlerID = g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (m_lvSuggestions)), 
+				  "changed",
+				  G_CALLBACK (AP_UnixDialog_Spell__onSuggestionSelected), 
+				  (gpointer)this);
 
     gtk_widget_show_all (m_wDialog);
     return m_wDialog;
 }
 
@@ -432,10 +434,15 @@
 			gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
 								COLUMN_SUGGESTION, suggest,  
 								COLUMN_NUMBER, i,
 								-1);
 	    }
+		// put the first suggestion in the entry
+		suggest = (gchar*) _convertToMB((UT_UCSChar*)m_Suggestions->getNthItem(0));
+        g_signal_handler_block(G_OBJECT(m_eChange), m_replaceHandlerID);
+        gtk_entry_set_text(GTK_ENTRY(m_eChange), suggest);
+        g_signal_handler_unblock(G_OBJECT(m_eChange), m_replaceHandlerID);      
     }
 
 	gtk_tree_view_set_model (GTK_TREE_VIEW (m_lvSuggestions), model);
 	g_object_unref (G_OBJECT (model));