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 562052 - Remove deprecated GTK+ symbols in gedit
Remove deprecated GTK+ symbols in gedit
Product: gedit
Classification: Applications
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 369150 (view as bug list)
Depends on: 572273
Blocks: 585692
Reported: 2008-11-23 20:56 UTC by Maxim Ermilov
Modified: 2010-04-12 18:51 UTC
See Also:
GNOME target: 3.0
GNOME version: 2.29/2.30

patch for this bug (19.05 KB, patch)
2008-11-24 01:44 UTC, Maxim Ermilov
needs-work Details | Review
corrected patch (33.18 KB, patch)
2008-11-25 21:03 UTC, Maxim Ermilov
none Details | Review
Remove deprecated GTK+ symbol: gtk_box_pack_start_defaults() (4.56 KB, patch)
2010-01-11 15:42 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
port to gtkcombobox (34.94 KB, patch)
2010-01-22 16:25 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review

Description Maxim Ermilov 2008-11-23 20:56:06 UTC
I'm working on implementing

If it's not a good idea, or not currently on the agenda, please let me know.
Otherwise I'll be working on this for now.
Comment 1 Paolo Borelli 2008-11-24 00:23:45 UTC
It's definately a good idea and help is welcome.

There should not be too much deprecated stuff... one of the things that uses deprecated widgets is the encoding selector in the file chooser: unfortunately last time we checked we could not get the same behavior with undeprecated widgets.
Comment 2 Maxim Ermilov 2008-11-24 01:44:03 UTC
Created attachment 123295 [details] [review]
patch for this bug

Use GtkComboBox in the encoding selector widgets && other
Comment 3 Paolo Borelli 2008-11-24 12:54:01 UTC
Thanks. However as I anticipated on comment 2 moving to combobox for the encoding selection we lose the current encoding indication we have in the current widget...
I guess at some point we'll have to leave with that.... Paolo, Jesse, Steve: Opinions?

In any case if we change that widget we should also refactor its name to GeditEncodingComboBox.

In the mean time I committed the rest of the patch.
Comment 4 2008-11-24 13:15:57 UTC
The current encoding indication can be solved with a different kind of hint (like bold face) or with toggle buttons in the combobox view. The problem is that this also means that the item drawn in the combobox when the drop down is not shown, also is displayed like this. There might be a trick to render it differently in the display entry, than in the drop down.
Comment 5 Maxim Ermilov 2008-11-25 21:03:02 UTC
Created attachment 123388 [details] [review]
corrected patch

current encoding now has PANGO_STYLE_ITALIC style & change widget name to GeditEncodingComboBox
Comment 6 Paolo Borelli 2009-01-06 14:29:54 UTC
*** Bug 369150 has been marked as a duplicate of this bug. ***
Comment 7 André Klapper 2009-02-26 01:16:51 UTC
Paolo, can this get a review?
Comment 8 Paolo Borelli 2009-02-26 09:10:48 UTC
the patch looks mostly good, but I have not made my mind yet wrt to the ui change involved. I decided to punt this for the next cycle.
Comment 9 André Klapper 2009-04-04 11:32:25 UTC
Targetting to 2.28 to make sure that this won't be forgotten.
Comment 10 André Klapper 2009-05-18 13:57:33 UTC
Gedit has branched now so this would be possible to get in.
Comment 11 André Klapper 2009-07-14 07:12:24 UTC
Paolo: Any decisions about the UI change?
Can this get into master?
Comment 12 André Klapper 2010-01-05 12:52:44 UTC
Current to-do list:
gtk_action_connect_proxy, gtk_box_pack_start_defaults, gtk_option_menu_get_history, gtk_option_menu_set_history, gtk_option_menu_set_menu, gtk_rc_style_unref, gtk_widget_get_action, gtk_widget_unref
Comment 13 Javier Jardón (IRC: jjardon) 2010-01-11 15:42:21 UTC
Created attachment 151170 [details] [review]
Remove deprecated GTK+ symbol: gtk_box_pack_start_defaults()
Comment 14 Paolo Borelli 2010-01-11 15:47:45 UTC
Review of attachment 151170 [details] [review]:

Javier's patch is ok.
Comment 15 André Klapper 2010-01-11 16:26:17 UTC
I assume that fixing gtk_rc_style_unref/gtk_widget_unref would be also accepted?
Comment 16 Javier Jardón (IRC: jjardon) 2010-01-11 16:29:15 UTC
Comment on attachment 151170 [details] [review]
Remove deprecated GTK+ symbol: gtk_box_pack_start_defaults() 

commit a2459132e00e716fd14ca0268c97c8cbf48c31ff
Comment 17 Ignacio Casal Quinteiro (nacho) 2010-01-11 16:44:25 UTC
(In reply to comment #15)
> I assume that fixing gtk_rc_style_unref/gtk_widget_unref would be also
> accepted?

I think this was already fixed?
Comment 18 Ignacio Casal Quinteiro (nacho) 2010-01-22 16:25:24 UTC
Created attachment 152021 [details] [review]
port to gtkcombobox

This patch is based on the previous one.
Comment 19 Paolo Borelli 2010-01-23 14:44:37 UTC
Review of attachment 152021 [details] [review]:

In the end as discussed on irc we do not like using italic much... let's just use a plain combo and see if anyone complains.

Minor comments inline in the patch, apart from those let's get this committed

::: gedit/gedit-encodings-combo-box.c
@@ +234,3 @@
+static gboolean
+RowSeparatorFunc (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)

Why camel case? let's keep the usual codestyle

@@ +240,3 @@
+	gtk_tree_model_get (model, iter, NAME_COLUMN, &str, -1);
+	if (str != NULL && strlen (str) != 0)

no need for strlen here: if (str != NULL && *str != '\0')
Comment 20 Ignacio Casal Quinteiro (nacho) 2010-01-23 15:05:35 UTC
Comment on attachment 152021 [details] [review]
port to gtkcombobox

Pushed fixing what you said and also disposing the store, that I forgot doing before.
Comment 21 Ignacio Casal Quinteiro (nacho) 2010-01-23 16:02:15 UTC
Also removed gtk_action_connect_proxy. I'm closing this bug now.
Comment 22 André Klapper 2010-04-12 16:45:08 UTC
Reopening as GTK_WIDGET_TOPLEVEL and gtk_widget_get_action are used.

./gedit/gedit-panel.c:	if (GTK_WIDGET_TOPLEVEL (toplevel) && GEDIT_IS_WINDOW (toplevel))
./gedit/gedit-encodings-combo-box.c:	if (!GTK_WIDGET_TOPLEVEL (toplevel))
./gedit/gedit-window.c:	action = gtk_widget_get_action (GTK_WIDGET (proxy));
Comment 23 Ignacio Casal Quinteiro (nacho) 2010-04-12 17:08:03 UTC
Fixed gtk_widget_get_action as gtk_activatable_get_related_action requires only 2.16.
Comment 24 Ignacio Casal Quinteiro (nacho) 2010-04-12 18:51:00 UTC
Fixed GTK_WIDGET_TOPLEVEL ifdeffing. Thanks for reporting.