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 589700 - GNOME Goal: Use GtkBuilder instead of libglade
GNOME Goal: Use GtkBuilder instead of libglade
Status: RESOLVED OBSOLETE
Product: planner
Classification: Other
Component: General
0.14.x
Other All
: Normal normal
: 0.15
Assigned To: Luis Menina
planner-maint
cleanup
Depends on: 589153
Blocks: 572883 695210
 
 
Reported: 2009-07-25 16:58 UTC by André Klapper
Modified: 2021-06-04 20:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Dropped libglade dependencies (822.78 KB, patch)
2009-10-04 17:16 UTC, Andreu Correa Casablanca
none Details | Review
Dropped libglade dependencies (412.58 KB, patch)
2010-02-25 02:18 UTC, Roberto Guido
needs-work Details | Review
GtkBuilder .ui files (420.08 KB, patch)
2010-02-25 02:34 UTC, Roberto Guido
none Details | Review
Dropped libglade dependencies (494.15 KB, patch)
2010-03-24 13:41 UTC, Roberto Guido
needs-work Details | Review
Removed GnomeEntry (36.94 KB, patch)
2010-04-09 17:37 UTC, Roberto Guido
rejected Details | Review
Drop libglade dependencies (499.49 KB, patch)
2012-03-25 13:56 UTC, Roberto Guido
needs-work Details | Review

Description André Klapper 2009-07-25 16:58:26 UTC
GNOME 3 (2010) will completely remove libglade.
See http://live.gnome.org/GnomeGoals/RemoveLibGladeUseGtkBuilder .
See http://www.gnome.org/~fpeters/299.html for automated statistics.
Comment 1 Alexandre Franke 2009-07-27 18:55:24 UTC
Indeed, this needs to be done. Thanks for the report.
Comment 2 Andreu Correa Casablanca 2009-10-04 12:28:07 UTC
I'm working on it now!
Comment 3 Andreu Correa Casablanca 2009-10-04 17:16:21 UTC
Created attachment 144721 [details] [review]
Dropped libglade dependencies

This patch drops the libglade dependencies from planner, also introduces one "problem". The eds-plugin (evolution plugin) will not run because evolution depends on libglade.

(I think the po files also need to be refactorized to translate the .ui files instead the .glade files)
Comment 4 André Klapper 2009-10-04 17:25:08 UTC
Evolution-data-server does not depend on libglade, Evolution still does.
Adding dependency to bug 589153.
Comment 5 Andreu Correa Casablanca 2009-10-04 17:45:34 UTC
I readed the code of "planner-eds-plugin.c", and found some things that I can't change because I don't understand where are stored the code of some structs:

for example, there are PlannerPlugin *plugin variable

and later appears that in the code "plugin->priv->glade", priv is PlannerPluginPriv type, but the PlannerPluginPriv type doesn't have the glade field... :s

I supose there is a redifinition on the eds .h files included in the file planner-eds-plugin.c , there isn't any redefinition in the planner files that matches with this usage (priv->glade).

I spent a lot of time searching U_U .
Comment 6 André Klapper 2009-12-30 15:06:02 UTC
Can the patch here please get a review/commit?
Comment 7 Roberto Guido 2010-02-25 02:18:38 UTC
Created attachment 154653 [details] [review]
Dropped libglade dependencies

This is an update of the previous patch, aligned to the current HEAD.
Compiles also with --enable-eds --enable-eds-backend.
Please review and commit this ASAP, due overlap with #575129 .
Comment 8 Roberto Guido 2010-02-25 02:34:49 UTC
Created attachment 154654 [details] [review]
GtkBuilder .ui files

Oops... I forgot to add Andreu's files in the previous patch...
This is to be applied just after previous one.
Sorry :-\
Comment 9 Javier Jardón (IRC: jjardon) 2010-03-21 22:58:09 UTC
Review of attachment 154653 [details] [review]:

Hello, could you take a look to the comments below?

::: src/planner-sql-plugin.c
@@ +972,3 @@
 	user_entry = gnome_entry_gtk_entry (
+	password_entry = GTK_WIDGET (gtk_builder_get_object (gui, "password_entry"));;
+		GNOME_ENTRY (GTK_WIDGET (gtk_builder_get_object (gui, "user_entry"))));

I'm pretty sure that this doesn't work.

You need to port GnomeEntry to GtkComboBoxEntry.
Comment 10 Roberto Guido 2010-03-24 13:41:13 UTC
Created attachment 156976 [details] [review]
Dropped libglade dependencies

Yet another update against HEAD.

GnomeEntry has been substitute by normal GtkEntry, which has less functionality but seems the most similar widget in accepted libraries for Gnome 3.0. No indications has been supplied for correct migration from GnomeEntry, and reproduce the whole functionality in Planner seems a waste.
I personally suggest to temporary leave GtkEntry and talk with other ex-GnomeEntry users and GTK+ developers to provide a shared implementation.
Comment 11 Javier Jardón (IRC: jjardon) 2010-03-24 14:02:56 UTC
Hello Robert,

How about GtkComboBoxEntry?
Comment 12 Roberto Guido 2010-03-24 15:35:57 UTC
(In reply to comment #11)
> How about GtkComboBoxEntry?
> 
Problem is not the graphic widget, but the history management, which is the real difference between GnomeEntry and everything else.
After little discussion on #gnome-love it seems no one is going to port the functionality in a commonly shared library (see: GTK+), I will try to provide a replacement in Planner codebase but also will push for GTK+ integration.
Comment 13 Roberto Guido 2010-04-09 17:37:43 UTC
Created attachment 158311 [details] [review]
Removed GnomeEntry

I've included code from GnomeEntry in a new PlannerEntry widget, and dropped dependency from libgnomeui.
This patch depends on the previous one.
Comment 14 André Klapper 2010-04-15 15:27:41 UTC
Alexandre, can the patches here get a review and commit?
Comment 15 Javier Jardón (IRC: jjardon) 2010-09-30 17:26:25 UTC
ping
Comment 16 André Klapper 2012-01-12 15:11:47 UTC
Alexandre, can the patches here get a review and commit?
Comment 17 Steve Frécinaux 2012-03-07 10:05:14 UTC
Review of attachment 156976 [details] [review]:

The idea is definitely there, and the glade files looks like they have been split the right way, but a few things should be fixed.

::: src/planner-calendar-dialog.c
@@ +596,1 @@
+	GError* error = NULL;

Please define the GError variable at the top of the function, where other variables are defined. This is important for coding style.

@@ +597,3 @@
+	builder = gtk_builder_new ();
+	if (!gtk_builder_add_from_file (builder, filename, &error))
+	{

Coding style: the '{' should be a the end of the 'if' line. This should be checked everywhere through the patch.

@@ +599,3 @@
+	{
+		g_warning ("Couldn't load builder file: %s", error->message);
+		g_error_free (error);

You should:
- free the filename variable
- unref the builder
- return NULL

I'm pretty sure something will go wrong later if you continue with a buggy builder.

Same goes for every instance of the same copy-pasted code in every touched C files.

::: src/planner-calendar-selector.c
@@ +110,2 @@
 	g_object_set_data_full (G_OBJECT (selector),
 				"data", data,

The builder object is not unreffed in this function, so it is leaked.

::: src/planner-day-type-dialog.c
@@ +184,2 @@
 	g_signal_connect_object (data->project,
 				 "day_added",

builder object seems leeked here too.

::: src/planner-default-week-dialog.c
@@ +214,2 @@
 	default_week_dialog_setup_day_option_menu (GTK_OPTION_MENU (data->day_option_menu),
 						   data->project,

And here. I think every place where a builder object is created should be verified. Looks like a lot of Glade objects were leaked :p
Comment 18 Roberto Guido 2012-03-25 13:56:03 UTC
Created attachment 210568 [details] [review]
Drop libglade dependencies

Right, I was a little too precipitous :-P
Better this one?
Comment 19 Steve Frécinaux 2012-03-28 08:09:01 UTC
Review of attachment 210568 [details] [review]:

The patch looks alright, just a small nitpick highlighted below.

Also, your patch is missing two parts:
- removing the libglade dependency from the configure.ac and Makefile.am files
- removing the old, now-unused glade files and the glade/ directory containing them.

::: src/planner-calendar-dialog.c
@@ +597,1 @@
+	error = NULL;

I think you should use 

GError *error = NULL

at the top instead of leaving it undefined and assigning it just before use. I think so because:
- this is the usual way of using error pointers within gnome so people are expecting it
- if the error pointer is not null, you had an error before and should error out anyway.
Comment 20 Luis Menina 2013-03-04 17:23:32 UTC
Review of attachment 158311 [details] [review]:

We decided with the maintainer to remove GnomeEntry instead of keeping its dead code around. There's a minimal loss of functionnality for now, but a similar feature could be reimplemented if required. Thanks for your effort.
Comment 21 Luis Menina 2013-03-04 17:26:00 UTC
Removing libgnomeui dependency is in bug #589045, let's keep this one only for libglade.
Comment 22 Mart Raudsepp 2021-06-04 20:55:31 UTC
A port away from libglade exists in https://gitlab.gnome.org/World/planner/-/merge_requests/22 and will hopefully be merged soon.
Closing the report here in preparations of bugzilla shutdown. Please track that merge request instead for port away from libglade (and initial gtk3 port)