After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 361679 - Replace all the deprecated widgets
Replace all the deprecated widgets
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: general
GIT master
Other All
: Normal enhancement
: ---
Assigned To: Ekiga maintainers
Ekiga maintainers
Depends on:
Blocks: 361678
 
 
Reported: 2006-10-12 11:35 UTC by Luis Menina
Modified: 2007-12-08 20:04 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to allow building with G_DISABLE_DEPRECATED (1.23 KB, patch)
2007-04-07 00:14 UTC, Luis Menina
committed Details | Review
First patch to eliminate a bunch of them (3.16 KB, patch)
2007-11-19 00:37 UTC, Luis Menina
committed Details | Review
Last ride to get rid of GtkTooltips (13.38 KB, patch)
2007-12-03 00:56 UTC, Luis Menina
reviewed Details | Review
Patch to comply to GTK 2.10 (2.99 KB, patch)
2007-12-08 17:38 UTC, Luis Menina
committed Details | Review

Description Luis Menina 2006-10-12 11:35:19 UTC
See http://bugzilla.gnome.org/show_bug.cgi?id=361134#c8
Requires to compile ekiga with the DISABLE_DEPRECATED flag.
Comment 1 Luis Menina 2007-02-21 22:59:59 UTC
Hum... Compiling with this flag set just gives me... nothing. Are all the deprecated widgets gone ?
Comment 2 Damien Sandras 2007-02-22 08:26:26 UTC
I think it is GTK_DISABLE_DEPRECATED and G_DISABLE_DEPRECATED.

There should still be a few deprecated widgets.
Comment 3 Luis Menina 2007-02-27 01:59:39 UTC
I hit bug 156034, which means we can't compile with these flags on, due to a libgnomeui problem. So it seems I also need to compile with GNOME_DISABLE_DEPRECATED.
Comment 4 Luis Menina 2007-04-07 00:14:05 UTC
Created attachment 85933 [details] [review]
Patch to allow building with G_DISABLE_DEPRECATED

This trivial patch fixes the code using deprecated glib symbols. This allows to build with G_DISABLE_DEPRECATED defined.
Comment 5 Snark 2007-04-07 16:25:01 UTC
Applied, thanks!

Does that mean you're finished with this bug report, or is there some more to do ?
Comment 6 Luis Menina 2007-04-08 23:21:06 UTC
Well, this was only for G_DISABLE_DEPRECATED. Now the big work is with GTK_DISABLE_DEPRECATED (which requires GNOME_DISABLE_DEPRECTED). There's much more to do...
Comment 7 Snark 2007-04-09 07:30:06 UTC
Ok. Are you sure GTK_DISABLE_DEPRECATED requires GNOME_DISABLE_DEPRECATED and not the other more logical way around ?

Do we use that many deprecated stuff !?
Comment 8 Luis Menina 2007-04-09 14:05:13 UTC
Yes, I'm sure, see comment 3. With just GTK_DISABLE_DEPRECATED, you can't compile. And it seems we use no GNOME deprecated stuff, as AFAIR compiling with GNOME_DISABLE_DEPRECATED works.

The deprecated stuff I saw was the use of GtkOptionMenu scattered around, but I couldn't compile the remaining files without correcting that error.

But don't worry, Ekiga is not the only one : http://liberforce.over-blog.org/article-10053850.html
Comment 9 Snark 2007-04-09 17:08:43 UTC
Ok, thanks :-)
Comment 10 Luis Menina 2007-04-29 22:52:04 UTC
Here is a list of the deprecated GTK symbols still in use in ekiga:

lib/gui/gmpreferences.c:  option_menu = gtk_option_menu_new ();
lib/gui/gmpreferences.c:  gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
lib/gui/gmpreferences.c:  gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu),
lib/gui/gmpreferences.c:  option_menu = gtk_option_menu_new ();
lib/gui/gmpreferences.c:  gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
lib/gui/gmpreferences.c:  gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu),
lib/gui/gmpreferences.c:  gtk_option_menu_remove_menu (GTK_OPTION_MENU (option_menu));
lib/gui/gmpreferences.c:  gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
lib/gui/gmpreferences.c:  gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), history);
lib/gui/gmlevelmeter.c:  lm = gtk_type_new (gtk_levelmeter_get_type ());
lib/gui/gmstatusbar.c:      gtk_timeout_add (15000, gm_statusbar_clear_msg_cb,
lib/gui/gmconfwidgets.c:    if (current_value != gtk_option_menu_get_history (GTK_OPTION_MENU (e)))
lib/gui/gmconfwidgets.c:        gtk_option_menu_set_history (GTK_OPTION_MENU (e), current_value);
lib/gui/gmconfwidgets.c:    if (gtk_option_menu_get_history (GTK_OPTION_MENU (data)) != cpt)
lib/gui/gmconfwidgets.c:      gtk_option_menu_set_history (GTK_OPTION_MENU (data), cpt);
src/gui/addressbook.cpp:        gtk_object_sink (GTK_OBJECT (menu));
src/gui/addressbook.cpp:        gtk_object_sink (GTK_OBJECT (menu));
src/gui/callshistory.cpp:      gtk_object_sink (GTK_OBJECT (menu));
src/gui/druid.cpp: * BEHAVIOR     :  Updates the given GtkOptionMenu with the given array and

These symbols should be changed lik this:
gtk_timeout_add -> g_timeout_add
gtk_object_sink -> g_object_ref_sink
gtk_type_new -> ?
gtk_option_menu_* -> gtk_combo_box_*

I can't submit a patch for this, as I currently can't build ekiga (pwlib version bump breaks the build).
Comment 11 Snark 2007-04-30 05:57:11 UTC
gtk_type_new (something) -> g_object_new (something, NULL) ?
Comment 12 Snark 2007-10-27 11:47:27 UTC
Anything new about that bug?
Comment 13 Luis Menina 2007-11-02 23:13:47 UTC
No sorry, I'm quite busy at the moment with non-GNOME related stuff...
Hope to hack on this soon again, and try to transform it into a GNOME Goal...
Comment 14 Luis Menina 2007-11-11 18:31:21 UTC
Here is the list of deprecated GTK 2.12.1 symbols used in svn trunk:

[liberforce@donald ekiga]$ egrep -n -R -f ~/gtk-deprecated-symbols.txt --include="*.c" *
lib/gui/gmpreferences.c:60:  GtkTooltips *tips;
lib/gui/gmpreferences.c:191:    gtk_tooltips_set_tip (gpw->tips, entry, tooltip, NULL);
lib/gui/gmpreferences.c:233:    gtk_tooltips_set_tip (gpw->tips, toggle, tooltip, NULL);
lib/gui/gmpreferences.c:310:    gtk_tooltips_set_tip (gpw->tips, hscale, tooltip, NULL);
lib/gui/gmpreferences.c:406:    gtk_tooltips_set_tip (gpw->tips, spin_button, tooltip, NULL);
lib/gui/gmpreferences.c:498:    gtk_tooltips_set_tip (gpw->tips, spin_button1, spin1_tooltip, NULL);
lib/gui/gmpreferences.c:499:    gtk_tooltips_set_tip (gpw->tips, spin_button2, spin2_tooltip, NULL);
lib/gui/gmpreferences.c:555:  option_menu = gtk_option_menu_new ();
lib/gui/gmpreferences.c:569:  gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
lib/gui/gmpreferences.c:570:  gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu),
lib/gui/gmpreferences.c:580:    gtk_tooltips_set_tip (gpw->tips, option_menu, tooltip, NULL);
lib/gui/gmpreferences.c:677:    gtk_tooltips_set_tip (gpw->tips, option_menu, tooltip, NULL);
lib/gui/gmpreferences.c:872:  gpw->tips = gtk_tooltips_new ();
lib/gui/gmgroupseditor.c:1204:  gtk_object_sink ((gpointer) popup_menu);
lib/gui/gmlevelmeter.c:152:  lm = gtk_type_new (gtk_levelmeter_get_type ());
lib/gui/gmstatusbar.c:130:      gtk_timeout_add (15000, gm_statusbar_clear_msg_cb, 
lib/gui/gmconfwidgets.c:311:    if (current_value != gtk_option_menu_get_history (GTK_OPTION_MENU (e)))
lib/gui/gmconfwidgets.c:312:    gtk_option_menu_set_history (GTK_OPTION_MENU (e), current_value);
Comment 15 Luis Menina 2007-11-11 18:33:08 UTC
Oh, BTW, the GNOME Goal for this kind of stuff is http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/Glib

Feel free to add comments to it if you wish, even if currently ekiga is free of Glib deprecated symbols.
Comment 16 Snark 2007-11-11 19:14:57 UTC
I got rid of the easy targets : gtk_object_sink, gtk_type_new and gtk_timeout_add.
Comment 17 Luis Menina 2007-11-11 19:36:05 UTC
gasp, was working on that at the same time :(
Comment 18 Snark 2007-11-11 20:16:01 UTC
Oups, sorry... notice I didn't touch the rest, so it should be at most 3 chunks :-(
Comment 19 Luis Menina 2007-11-11 22:50:00 UTC
no problem ;-)
but notice that my solution for gtk_timeout_add is slightly different, as g_timeout_add_seconds is prefered nowadays:

     if (flash_message)
-      g_timeout_add (15000, gm_statusbar_clear_msg_cb,
-                    GINT_TO_POINTER (msg_id));
+    {
+#if GTK_CHECK_VERSION(2, 14, 0)
+      g_timeout_add_seconds (15, gm_statusbar_clear_msg_cb, 
+                      GINT_TO_POINTER (msg_id));
+#else
+      g_timeout_add (15000, gm_statusbar_clear_msg_cb, 
+                      GINT_TO_POINTER (msg_id));
+#endif
+    }
Comment 20 Luis Menina 2007-11-12 02:20:14 UTC
I've got some troubles to test ekiga... when I run it, It segfaults:

(process:18484): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function

(process:18484): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed

(process:18484): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
Comment 21 Luis Menina 2007-11-12 02:22:49 UTC
hum... the error kinda disapeared, but I still have one with audio device... gonna sort that out
Comment 22 Snark 2007-11-12 08:19:53 UTC
What is the minimal gtk+ version we accept? I don't like #ifdef'd code that much :-/

And I think we have a bug : we set a timer to clear the flash bar in 15s... what happens if :
time: we display a message
time+14.999s: we display another, very important message
time+15s: we clear the status bar
?
Comment 23 Luis Menina 2007-11-12 08:57:48 UTC
configure.ac: PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10.0)
configure.ac: PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.8.0 gmodule-2.0 gobject-2.0 gthread-2.0)

Ekiga requires GTK 2.10 and Glib 2.8 at least, but g_timeout_add and g_timeout_add_seconds are part of Glib, not GTK. g_timeout_add_second is fairly new (introduced with Glib 2.14), but is the way to go now. I think that special casing it makes sense, since we shouldn't require glib 2.14 just for that. Once the glib requirements get bumped, this kind of code can be cleaned. Moreover, it's  easy to find as every section will call GTK_CHECK_VERSION, and ekiga's current requirements are easy to find.

Oops, now that you tell me, there's a bug in my code: I should have uses GLIB_CHECK_VERSION and not GTK_CHECK_VERSION...

For the bug you mention... well, I really don't know, as I just focused on the symbols.
Comment 24 Snark 2007-11-12 09:18:22 UTC
Well, then lets keep the #ifdef...

I'll just report the new problem I found as a bug.
Comment 25 Luis Menina 2007-11-19 00:37:35 UTC
Created attachment 99308 [details] [review]
First patch to eliminate a bunch of them

Here I don't really know how to replace the behavior of the "deactivate" signal that was used. It's #if 0'ed for now. Any idea ?
Comment 26 Luis Menina 2007-12-02 23:03:07 UTC
Well, it seems that my patch was modified and commited, while it was just a first draft... It's not rant, but, could you please inform me when this happens ? Otherwise I'm stuck waiting for some answer, or a review of that patch, instead of going foward with development...
Comment 27 Luis Menina 2007-12-02 23:09:18 UTC
Here's the remaining stuff I'll work on:
[liberforce@donald ekiga]$ egrep -n -R -f ~/gtk-2.12.1-deprecated-symbols.txt --include="*.c" --include="*.cpp" *
lib/engine/gui/gtk-frontend/addressbook-window.cpp:348:    gtk_menu_item_remove_submenu (GTK_MENU_ITEM (self->priv->menu_item_view));
lib/engine/gui/gtk-frontend/addressbook-window.cpp:459:  gtk_menu_item_remove_submenu (GTK_MENU_ITEM (self->priv->menu_item_view));
lib/gui/gmpreferences.c:60:  GtkTooltips *tips;
lib/gui/gmpreferences.c:191:    gtk_tooltips_set_tip (gpw->tips, entry, tooltip, NULL);
lib/gui/gmpreferences.c:233:    gtk_tooltips_set_tip (gpw->tips, toggle, tooltip, NULL);
lib/gui/gmpreferences.c:310:    gtk_tooltips_set_tip (gpw->tips, hscale, tooltip, NULL);
lib/gui/gmpreferences.c:406:    gtk_tooltips_set_tip (gpw->tips, spin_button, tooltip, NULL);
lib/gui/gmpreferences.c:498:    gtk_tooltips_set_tip (gpw->tips, spin_button1, spin1_tooltip, NULL);
lib/gui/gmpreferences.c:499:    gtk_tooltips_set_tip (gpw->tips, spin_button2, spin2_tooltip, NULL);
lib/gui/gmpreferences.c:590:    gtk_tooltips_set_tip (gpw->tips, combo_box, tooltip, NULL);
lib/gui/gmpreferences.c:695:    gtk_tooltips_set_tip (gpw->tips, option_menu, tooltip, NULL);
lib/gui/gmpreferences.c:890:  gpw->tips = gtk_tooltips_new ();
src/gui/main.cpp:115:  GtkTooltips *tips;
src/gui/main.cpp:853:  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), 
src/gui/main.cpp:876:    gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), 
src/gui/main.cpp:1029:  gtk_tooltips_set_tip (mw->tips, GTK_WIDGET (mw->connect_button), 
src/gui/main.cpp:1484:  gtk_tooltips_set_tip (mw->tips, hscale_brightness,
src/gui/main.cpp:1506:  gtk_tooltips_set_tip (mw->tips, hscale_whiteness,
src/gui/main.cpp:1528:  gtk_tooltips_set_tip (mw->tips, hscale_colour,
src/gui/main.cpp:1550:  gtk_tooltips_set_tip (mw->tips, hscale_contrast,
src/gui/main.cpp:1798:  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), mw->tips,
src/gui/main.cpp:1821:  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), mw->tips,
src/gui/main.cpp:1842:  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), mw->tips,
src/gui/main.cpp:1863:  gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (item), mw->tips,
src/gui/main.cpp:1958:  gtk_tooltips_set_tip (mw->tips, mw->statusbar_ebox,
src/gui/main.cpp:2484:  gtk_tooltips_set_tip (mw->tips, GTK_WIDGET (e), tip_text, NULL);
src/gui/main.cpp:3663:  mw->tips = gtk_tooltips_new ();
src/gui/main.cpp:4078:    gtk_tooltips_set_tip (mw->tips, GTK_WIDGET (mw->statusbar_ebox), 
src/gui/druid.cpp:159: * BEHAVIOR     :  Updates the given GtkOptionMenu with the given array and
Comment 28 Luis Menina 2007-12-03 00:54:22 UTC
The GtkTooltip interface was added with GTK 2.12, which was released 2007, 14 September. Does the code needs to be #if'ed, or may we safely bump the GTK requirements to 2.12 ?

The patch is cooked as if we could bump to 2.12. I we can't, you'll have to wait and apply it when Ekiga will bump to 2.12.
Comment 29 Luis Menina 2007-12-03 00:56:14 UTC
Created attachment 100078 [details] [review]
Last ride to get rid of GtkTooltips

Could someone please give a look on this and tell me if it's commited or not ? Thanks.
Comment 30 Snark 2007-12-03 04:36:35 UTC
Oooohh... gtk_menu_item_remove_submenu is deprecated in 2.12 !?

Your patch looks good ; I'll let Damien decide if we chase 2.12 already... that probably depends on how easy it is to get gtk+ 2.12 on win32 too.
Comment 31 Luis Menina 2007-12-06 12:26:18 UTC
GTK 2.12.3 binaries for Windows are available...
http://ftp.acc.umu.se/pub/gnome/binaries/win32/gtk+/2.12/
Comment 32 Luis Menina 2007-12-06 12:46:43 UTC
My error was to check the deprecated stuff against 2.12 instead of 2.10, which is still a recent version. Damien, can you set the delay between a new GTK release and the time ekiga should use the stuff of that GTK release ? 6 months ? One year ? Another GTK release ?

If you want to stick to 2.10, I can split the patch to have the remaining stuff about option menus fixed (that was mostly ekiga functions naming and comments issues).

The other patch would be for the GtkTooltips->GtkTooltip migration only, which is the part that requires GTK 2.12, and could be applied later.
Comment 33 Luis Menina 2007-12-08 17:38:55 UTC
Created attachment 100596 [details] [review]
Patch to comply to GTK 2.10

This fixes the GTK 2.10 compliance.
Comment 34 Luis Menina 2007-12-08 17:57:08 UTC
Th ebove patch fixes the final stuff for GTK 2.10 compliance. I will open a separate bug for GTK 2.12 compliance, so we can close this one. This patch is a subset of the previous one, so as snark reviewed it, please commit it.
Comment 35 Luis Menina 2007-12-08 18:35:35 UTC
marking as reviewed as it's a independant subset of the last patch, wich was reviewed by snark.
Comment 36 Snark 2007-12-08 20:02:24 UTC
Ok, committed. I let you close :-)
Comment 37 Luis Menina 2007-12-08 20:03:48 UTC
Yeah, thanks very much :-)
Hope to improve my score ;-)