summaryrefslogtreecommitdiff
path: root/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch
blob: c93e9b4654a1e0167c47bb00ef85540ef48c0797 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
From a59b0fac02e74a971ac3f08bf28c17ce361a9526 Mon Sep 17 00:00:00 2001
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date: Wed, 2 Mar 2016 15:47:49 +0200
Subject: [PATCH] Port to Gtk3

Some unused (or not useful) code was removed, functionality should stay
the same.

Code still contains quite a few uses of deprecated API.

Upstream-Status: Submitted
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 applet/agent.c        |  3 +--
 applet/main.c         | 43 -------------------------------------------
 applet/status.c       |  8 --------
 configure.ac          |  3 +--
 properties/ethernet.c | 14 +++++++-------
 properties/main.c     |  2 +-
 properties/wifi.c     | 12 ++++++------
 7 files changed, 16 insertions(+), 69 deletions(-)

diff --git a/applet/agent.c b/applet/agent.c
index 65bed08..04fe86a 100644
--- a/applet/agent.c
+++ b/applet/agent.c
@@ -126,7 +126,6 @@ static void request_input_dialog(GHashTable *request,
 	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
 	gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
 	gtk_window_set_urgency_hint(GTK_WINDOW(dialog), TRUE);
-	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
 	input->dialog = dialog;
 
 	gtk_dialog_add_button(GTK_DIALOG(dialog),
@@ -139,7 +138,7 @@ static void request_input_dialog(GHashTable *request,
 	gtk_table_set_row_spacings(GTK_TABLE(table), 4);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 20);
 	gtk_container_set_border_width(GTK_CONTAINER(table), 12);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
+	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG(dialog))), table);
 
 	label = gtk_label_new(_("Please provide some network information:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
diff --git a/applet/main.c b/applet/main.c
index f12d371..cd16285 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -157,46 +157,6 @@ static void name_owner_changed(DBusGProxy *proxy, const char *name,
 	}
 }
 
-static void open_uri(GtkWindow *parent, const char *uri)
-{
-	GtkWidget *dialog;
-	GdkScreen *screen;
-	GError *error = NULL;
-	gchar *cmdline;
-
-	screen = gtk_window_get_screen(parent);
-
-	cmdline = g_strconcat("xdg-open ", uri, NULL);
-
-	if (gdk_spawn_command_line_on_screen(screen,
-				cmdline, &error) == FALSE) {
-		dialog = gtk_message_dialog_new(parent,
-				GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
-				GTK_BUTTONS_CLOSE, "%s", error->message);
-		gtk_dialog_run(GTK_DIALOG(dialog));
-		gtk_widget_destroy(dialog);
-		g_error_free(error);
-	}
-
-	g_free(cmdline);
-}
-
-static void about_url_hook(GtkAboutDialog *dialog,
-				const gchar *url, gpointer data)
-{
-	open_uri(GTK_WINDOW(dialog), url);
-}
-
-static void about_email_hook(GtkAboutDialog *dialog,
-				const gchar *email, gpointer data)
-{
-	gchar *uri;
-
-	uri = g_strconcat("mailto:", email, NULL);
-	open_uri(GTK_WINDOW(dialog), uri);
-	g_free(uri);
-}
-
 static void about_callback(GtkWidget *item, gpointer user_data)
 {
 	const gchar *authors[] = {
@@ -204,9 +164,6 @@ static void about_callback(GtkWidget *item, gpointer user_data)
 		NULL
 	};
 
-	gtk_about_dialog_set_url_hook(about_url_hook, NULL, NULL);
-	gtk_about_dialog_set_email_hook(about_email_hook, NULL, NULL);
-
 	gtk_show_about_dialog(NULL, "version", VERSION,
 			"copyright", "Copyright \xc2\xa9 2008 Intel Corporation",
 			"comments", _("A connection manager for the GNOME desktop"),
diff --git a/applet/status.c b/applet/status.c
index aed6f1e..015ff29 100644
--- a/applet/status.c
+++ b/applet/status.c
@@ -102,8 +102,6 @@ static void icon_animation_start(IconAnimation *animation,
 {
 	available = TRUE;
 
-	gtk_status_icon_set_tooltip(statusicon, NULL);
-
 	animation->start = start;
 	animation->end = (end == 0) ? animation->count - 1 : end;
 
@@ -120,8 +118,6 @@ static void icon_animation_stop(IconAnimation *animation)
 {
 	available = TRUE;
 
-	gtk_status_icon_set_tooltip(statusicon, NULL);
-
 	if (animation->id > 0)
 		g_source_remove(animation->id);
 
@@ -251,8 +247,6 @@ void status_unavailable(void)
 	available = FALSE;
 
 	gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_notifier);
-	gtk_status_icon_set_tooltip(statusicon,
-				"Connection Manager daemon is not running");
 
 	gtk_status_icon_set_visible(statusicon, TRUE);
 }
@@ -299,7 +293,6 @@ static void set_ready(gint signal)
 
 	if (signal < 0) {
 		gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_wired);
-		gtk_status_icon_set_tooltip(statusicon, NULL);
 		return;
 	}
 
@@ -311,7 +304,6 @@ static void set_ready(gint signal)
 		index = 4;
 
 	gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_signal[index]);
-	gtk_status_icon_set_tooltip(statusicon, NULL);
 }
 
 struct timeout_data {
diff --git a/configure.ac b/configure.ac
index b972e07..a4dad5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,8 +55,7 @@ AC_SUBST(DBUS_LIBS)
 DBUS_BINDING_TOOL="dbus-binding-tool"
 AC_SUBST(DBUS_BINDING_TOOL)
 
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8, dummy=yes,
-				AC_MSG_ERROR(gtk+ >= 2.8 is required))
+PKG_CHECK_MODULES(GTK, gtk+-3.0)
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
diff --git a/properties/ethernet.c b/properties/ethernet.c
index 31db7a0..0b6b423 100644
--- a/properties/ethernet.c
+++ b/properties/ethernet.c
@@ -82,7 +82,7 @@ void add_ethernet_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
 	gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
 
-	table = gtk_table_new(1, 1, TRUE);
+	table = gtk_table_new(1, 1, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 10);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 10);
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
@@ -136,7 +136,7 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
 	gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
 
-	table = gtk_table_new(5, 5, TRUE);
+	table = gtk_table_new(5, 5, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 10);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 10);
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
@@ -144,9 +144,9 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d
 	label = gtk_label_new(_("Configuration:"));
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1);
 
-	combo = gtk_combo_box_new_text();
-	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP");
-	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "MANUAL");
+	combo = gtk_combo_box_text_new();
+	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP");
+	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "MANUAL");
 	gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo),
 					separator_function, NULL, NULL);
 	gtk_table_attach_defaults(GTK_TABLE(table), combo, 2, 4, 0, 1);
@@ -219,7 +219,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy)
 	case CONNMAN_POLICY_DHCP:
 		gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
 		for (i = 0; i < 3; i++) {
-			gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0);
+			gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0);
 			gtk_widget_set_sensitive(entry[i], 0);
 			gtk_entry_set_text(GTK_ENTRY(entry[i]), _(""));
 		}
@@ -227,7 +227,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy)
 	case CONNMAN_POLICY_MANUAL:
 		gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1);
 		for (i = 0; i < 3; i++) {
-			gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1);
+			gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1);
 			gtk_widget_set_sensitive(entry[i], 1);
 		}
 		break;
diff --git a/properties/main.c b/properties/main.c
index c05f443..6f76361 100644
--- a/properties/main.c
+++ b/properties/main.c
@@ -429,7 +429,7 @@ static GtkWidget *create_interfaces(GtkWidget *window)
 
 	scrolled = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
-				GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+				GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
 							GTK_SHADOW_OUT);
 	gtk_box_pack_start(GTK_BOX(hbox), scrolled, FALSE, TRUE, 0);
diff --git a/properties/wifi.c b/properties/wifi.c
index bd325ef..a5827e0 100644
--- a/properties/wifi.c
+++ b/properties/wifi.c
@@ -125,7 +125,7 @@ void add_wifi_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
 	gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
 
-	table = gtk_table_new(1, 1, TRUE);
+	table = gtk_table_new(1, 1, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 10);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 10);
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
@@ -185,9 +185,9 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 3, 4);
 	data->ipv4.label[0] = label;
 
-	combo = gtk_combo_box_new_text();
-	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP");
-	gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Manual");
+	combo = gtk_combo_box_text_new();
+	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP");
+	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "Manual");
 
 	gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo),
 			separator_function, NULL, NULL);
@@ -335,14 +335,14 @@ void update_wifi_ipv4(struct config_data *data, guint policy)
 	case CONNMAN_POLICY_DHCP:
 		gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
 		for (i = 0; i < 3; i++) {
-			gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0);
+			gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0);
 			gtk_widget_set_sensitive(entry[i], 0);
 		}
 		break;
 	case CONNMAN_POLICY_MANUAL:
 		gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1);
 		for (i = 0; i < 3; i++) {
-			gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1);
+			gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1);
 			gtk_widget_set_sensitive(entry[i], 1);
 		}
 		break;
-- 
2.8.1