File scim-wnn-gtk3.patch of Package scim-wnn

Index: scim-wnn-1.0.0/src/scim_wnn_imengine_setup.cpp
===================================================================
--- scim-wnn-1.0.0.orig/src/scim_wnn_imengine_setup.cpp
+++ scim-wnn-1.0.0/src/scim_wnn_imengine_setup.cpp
@@ -167,7 +167,9 @@ static GtkWidget    * __widget_alp = 0;
 static GtkWidget    * __widget_numkeyselect = 0;
 static GtkWidget    * __widget_autoconversion = 0;
 static GtkWidget    * __widget_romkan_table = 0;
+#if ! GTK_CHECK_VERSION(3, 0, 0)
 static GtkTooltips  * __widget_tooltips = 0;
+#endif
 
 static ListData __list_data [] =
 {
@@ -541,11 +543,14 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __widget_server);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_server, _("input the server name to connect."));
+#else
     if (!__widget_tooltips)
         __widget_tooltips = gtk_tooltips_new();
     gtk_tooltips_set_tip (__widget_tooltips, __widget_server,
                               _("input the server name to connect."), NULL);
-
+#endif
 
     /* wnnenvrc */
     label = gtk_label_new_with_mnemonic (_("_wnnenvrc: "));
@@ -569,8 +574,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     //gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_wnn_rc, _("input the path of wnnenvrc."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_wnn_rc,
                               _("input the path of wnnenvrc."), NULL);
+#endif
 
     /* servertype */
     label = gtk_label_new_with_mnemonic (_("Server_type: "));
@@ -592,8 +601,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __list_data[0].widget);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_servertype, _("select the server type from Wnn4 / Wnn6 / Wnn7."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_servertype,
                               _("select the server type from Wnn4 / Wnn6 / Wnn7."), NULL);
+#endif
 
     /* default preeditor */
     label = gtk_label_new_with_mnemonic (_("Default_PreEditor: "));
@@ -614,8 +627,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __list_data[3].widget);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_preeditor, _("select the default preeditor."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_preeditor,
                               _("select the default preeditor."), NULL);
+#endif
 
 
     /* ALP */
@@ -635,8 +652,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __widget_alp);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_alp, _("set the count of conversion until displaying the list of lookup result automatically."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_alp,
                               _("set the count of conversion until displaying the list of lookup result automatically."), NULL);
+#endif
 
     /* numkeyselection */
     label = gtk_label_new_with_mnemonic (_("_NumKey selection: "));
@@ -653,8 +674,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __widget_numkeyselect);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_numkeyselect, _("If you use the candidate selection by numkey, check this."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_numkeyselect,
                               _("If you use the candidate selection by numkey, check this."), NULL);
+#endif
 
     /* auto conversion */
     label = gtk_label_new_with_mnemonic (_("Auto _conversion: "));
@@ -671,8 +696,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __widget_autoconversion);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_autoconversion, _("If you set default to the auto conversion mode use, check this."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_autoconversion,
                               _("If you set default to the auto conversion mode use, check this."), NULL);
+#endif
 
 
     /* completion */
@@ -690,8 +719,12 @@ create_options_page ()
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
     gtk_label_set_mnemonic_widget (GTK_LABEL (label), __widget_yosoku);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text(__widget_yosoku, _("if you use YOSOKU-input, check this."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_yosoku,
                               _("if you use YOSOKU-input , check this."), NULL);
+#endif
 
 
     // romkan_table
@@ -715,9 +748,12 @@ create_options_page ()
     gtk_table_attach (GTK_TABLE (table), button2, 2, 3, 8, 9,
                       (GtkAttachOptions) (GTK_FILL),
                       (GtkAttachOptions) (GTK_FILL), 4, 4);
+#if GTK_CHECK_VERSION(3, 0, 0)
+    gtk_widget_set_tooltip_text (__widget_romkan_table, _("input the path of Roma-Kana convert table file."));
+#else
     gtk_tooltips_set_tip (__widget_tooltips, __widget_romkan_table,
                               _("input the path of Roma-Kana convert table file."), NULL);
-
+#endif
 
 
     /* connect all signals */
@@ -807,11 +843,17 @@ create_keyboard_page (unsigned int page)
                           &(data[i].data));
     }
 
+#if ! GTK_CHECK_VERSION(3, 0, 0)
     if (!__widget_tooltips)
         __widget_tooltips = gtk_tooltips_new();
+#endif
     for (unsigned int i = 0; data[i].key; ++ i) {
+#if GTK_CHECK_VERSION(3, 0, 0)
+	gtk_widget_set_tooltip_text (data[i].entry, _(data[i].tooltip));
+#else
         gtk_tooltips_set_tip (__widget_tooltips, data[i].entry,
                               _(data[i].tooltip), NULL);
+#endif
     }
 
     return table;
openSUSE Build Service is sponsored by