[gnome-initial-setup] welcome, eula, location, network: Reindent
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] welcome, eula, location, network: Reindent
- Date: Tue, 12 Jun 2012 05:20:48 +0000 (UTC)
commit c77dd33db3d0351c4bbe55f561ece2f80e01c64d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 12 00:54:17 2012 -0400
welcome, eula, location, network: Reindent
Use an indent offset of 2, not 8, to help with readability.
This is just a cosmetic commit.
gnome-initial-setup/gis-eula-pages.c | 218 +++---
gnome-initial-setup/gis-location-page.c | 378 +++++-----
gnome-initial-setup/gis-network-page.c | 1172 +++++++++++++++---------------
gnome-initial-setup/gis-welcome-page.c | 56 +-
4 files changed, 912 insertions(+), 912 deletions(-)
---
diff --git a/gnome-initial-setup/gis-eula-pages.c b/gnome-initial-setup/gis-eula-pages.c
index fa12dc7..cd50376 100644
--- a/gnome-initial-setup/gis-eula-pages.c
+++ b/gnome-initial-setup/gis-eula-pages.c
@@ -16,150 +16,150 @@ splice_buffer (GInputStream *stream,
GtkTextBuffer *buffer,
GError **error)
{
- char contents[8192];
- gssize n_read;
- GtkTextIter iter;
+ char contents[8192];
+ gssize n_read;
+ GtkTextIter iter;
- while (TRUE) {
- n_read = g_input_stream_read (stream, contents, sizeof (contents), NULL, error);
+ while (TRUE) {
+ n_read = g_input_stream_read (stream, contents, sizeof (contents), NULL, error);
- /* error or eof */
- if (n_read <= 0)
- break;
+ /* error or eof */
+ if (n_read <= 0)
+ break;
- gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_buffer_insert (buffer, &iter, contents, n_read);
- }
+ gtk_text_buffer_get_end_iter (buffer, &iter);
+ gtk_text_buffer_insert (buffer, &iter, contents, n_read);
+ }
}
static GtkWidget *
build_eula_text_view (GFile *eula)
{
- GInputStream *input_stream = NULL;
- GError *error = NULL;
- GtkWidget *widget = NULL;
- GtkTextBuffer *buffer;
- GtkTextIter start, end;
-
- input_stream = G_INPUT_STREAM (g_file_read (eula, NULL, &error));
- if (error != NULL)
- goto out;
-
- buffer = gtk_text_buffer_new (NULL);
- splice_buffer (input_stream, buffer, &error);
- if (error != NULL)
- goto out;
-
- /* monospace the text */
- gtk_text_buffer_create_tag (buffer, "monospace", "family", "monospace", NULL);
- gtk_text_buffer_get_start_iter (buffer, &start);
- gtk_text_buffer_get_end_iter (buffer, &end);
- gtk_text_buffer_apply_tag_by_name (buffer, "monospace", &start, &end);
-
- widget = gtk_text_view_new_with_buffer (buffer);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), FALSE);
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (widget), FALSE);
+ GInputStream *input_stream = NULL;
+ GError *error = NULL;
+ GtkWidget *widget = NULL;
+ GtkTextBuffer *buffer;
+ GtkTextIter start, end;
+
+ input_stream = G_INPUT_STREAM (g_file_read (eula, NULL, &error));
+ if (error != NULL)
+ goto out;
+
+ buffer = gtk_text_buffer_new (NULL);
+ splice_buffer (input_stream, buffer, &error);
+ if (error != NULL)
+ goto out;
+
+ /* monospace the text */
+ gtk_text_buffer_create_tag (buffer, "monospace", "family", "monospace", NULL);
+ gtk_text_buffer_get_start_iter (buffer, &start);
+ gtk_text_buffer_get_end_iter (buffer, &end);
+ gtk_text_buffer_apply_tag_by_name (buffer, "monospace", &start, &end);
+
+ widget = gtk_text_view_new_with_buffer (buffer);
+ gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), FALSE);
+ gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (widget), FALSE);
out:
- if (error != NULL) {
- g_printerr ("Error while reading EULA: %s", error->message);
- g_error_free (error);
- }
+ if (error != NULL) {
+ g_printerr ("Error while reading EULA: %s", error->message);
+ g_error_free (error);
+ }
- g_clear_object (&input_stream);
- return widget;
+ g_clear_object (&input_stream);
+ return widget;
}
static void
eula_checkbox_toggled (GtkToggleButton *checkbox,
SetupData *setup)
{
- gtk_assistant_set_page_complete (gis_get_assistant (setup),
- g_object_get_data (G_OBJECT (checkbox), "assistant-page"),
- gtk_toggle_button_get_active (checkbox));
+ gtk_assistant_set_page_complete (gis_get_assistant (setup),
+ g_object_get_data (G_OBJECT (checkbox), "assistant-page"),
+ gtk_toggle_button_get_active (checkbox));
}
static void
build_eula_page (SetupData *setup,
GFile *eula)
{
- GtkWidget *text_view;
- GtkWidget *vbox;
- GtkWidget *scrolled_window;
- GtkWidget *checkbox;
- GtkAssistant *assistant = gis_get_assistant (setup);
-
- text_view = build_eula_text_view (eula);
- if (text_view == NULL)
- return;
-
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_SHADOW_ETCHED_IN);
- gtk_widget_set_vexpand (scrolled_window, TRUE);
- gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
-
- checkbox = gtk_check_button_new_with_mnemonic (_("I have _agreed to the "
- "terms and conditions in "
- "this end user license "
- "agreement."));
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
- gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
- gtk_container_add (GTK_CONTAINER (vbox), checkbox);
-
- /* XXX: 1 is the location after the welcome page.
- * Remove this hardcoded thing. */
- gtk_assistant_insert_page (assistant, vbox, 1);
- gtk_assistant_set_page_complete (assistant, vbox, FALSE);
-
- gtk_widget_show_all (GTK_WIDGET (vbox));
- g_signal_connect (checkbox, "toggled",
- G_CALLBACK (eula_checkbox_toggled),
- setup);
- g_object_set_data (G_OBJECT (checkbox), "assistant-page", vbox);
+ GtkWidget *text_view;
+ GtkWidget *vbox;
+ GtkWidget *scrolled_window;
+ GtkWidget *checkbox;
+ GtkAssistant *assistant = gis_get_assistant (setup);
+
+ text_view = build_eula_text_view (eula);
+ if (text_view == NULL)
+ return;
+
+ scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_SHADOW_ETCHED_IN);
+ gtk_widget_set_vexpand (scrolled_window, TRUE);
+ gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
+
+ checkbox = gtk_check_button_new_with_mnemonic (_("I have _agreed to the "
+ "terms and conditions in "
+ "this end user license "
+ "agreement."));
+
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
+ gtk_container_add (GTK_CONTAINER (vbox), scrolled_window);
+ gtk_container_add (GTK_CONTAINER (vbox), checkbox);
+
+ /* XXX: 1 is the location after the welcome page.
+ * Remove this hardcoded thing. */
+ gtk_assistant_insert_page (assistant, vbox, 1);
+ gtk_assistant_set_page_complete (assistant, vbox, FALSE);
+
+ gtk_widget_show_all (GTK_WIDGET (vbox));
+ g_signal_connect (checkbox, "toggled",
+ G_CALLBACK (eula_checkbox_toggled),
+ setup);
+ g_object_set_data (G_OBJECT (checkbox), "assistant-page", vbox);
}
void
gis_prepare_eula_pages (EulasData *data)
{
- gchar *eulas_dir_path;
- GFile *eulas_dir;
- GError *error = NULL;
- GFileEnumerator *enumerator = NULL;
- GFileInfo *info;
- SetupData *setup = data->setup;
+ gchar *eulas_dir_path;
+ GFile *eulas_dir;
+ GError *error = NULL;
+ GFileEnumerator *enumerator = NULL;
+ GFileInfo *info;
+ SetupData *setup = data->setup;
- eulas_dir_path = g_build_filename (UIDIR, "eulas", NULL);
- eulas_dir = g_file_new_for_path (eulas_dir_path);
- g_free (eulas_dir_path);
+ eulas_dir_path = g_build_filename (UIDIR, "eulas", NULL);
+ eulas_dir = g_file_new_for_path (eulas_dir_path);
+ g_free (eulas_dir_path);
- if (!g_file_query_exists (eulas_dir, NULL))
- goto out;
+ if (!g_file_query_exists (eulas_dir, NULL))
+ goto out;
- enumerator = g_file_enumerate_children (eulas_dir,
- G_FILE_ATTRIBUTE_STANDARD_NAME,
- G_FILE_QUERY_INFO_NONE,
- NULL,
- &error);
+ enumerator = g_file_enumerate_children (eulas_dir,
+ G_FILE_ATTRIBUTE_STANDARD_NAME,
+ G_FILE_QUERY_INFO_NONE,
+ NULL,
+ &error);
- if (error != NULL)
- goto out;
+ if (error != NULL)
+ goto out;
- while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL) {
- GFile *eula = g_file_get_child (eulas_dir, g_file_info_get_name (info));
- build_eula_page (setup, eula);
- }
+ while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL) {
+ GFile *eula = g_file_get_child (eulas_dir, g_file_info_get_name (info));
+ build_eula_page (setup, eula);
+ }
- if (error != NULL)
- goto out;
+ if (error != NULL)
+ goto out;
out:
- if (error != NULL) {
- g_printerr ("Error while parsing eulas: %s", error->message);
- g_error_free (error);
- }
+ if (error != NULL) {
+ g_printerr ("Error while parsing eulas: %s", error->message);
+ g_error_free (error);
+ }
- g_object_unref (eulas_dir);
- g_clear_object (&enumerator);
+ g_object_unref (eulas_dir);
+ g_clear_object (&enumerator);
}
diff --git a/gnome-initial-setup/gis-location-page.c b/gnome-initial-setup/gis-location-page.c
index ad4eeb4..6cb9134 100644
--- a/gnome-initial-setup/gis-location-page.c
+++ b/gnome-initial-setup/gis-location-page.c
@@ -18,68 +18,68 @@ set_timezone_cb (GObject *source,
GAsyncResult *res,
gpointer user_data)
{
- LocationData *data = user_data;
- GError *error;
-
- error = NULL;
- if (!timedate1_call_set_timezone_finish (data->dtm,
- res,
- &error)) {
- /* TODO: display any error in a user friendly way */
- g_warning ("Could not set system timezone: %s", error->message);
- g_error_free (error);
- }
+ LocationData *data = user_data;
+ GError *error;
+
+ error = NULL;
+ if (!timedate1_call_set_timezone_finish (data->dtm,
+ res,
+ &error)) {
+ /* TODO: display any error in a user friendly way */
+ g_warning ("Could not set system timezone: %s", error->message);
+ g_error_free (error);
+ }
}
static void
queue_set_timezone (LocationData *data)
{
- /* for now just do it */
- if (data->current_location) {
- timedate1_call_set_timezone (data->dtm,
- data->current_location->zone,
- TRUE,
- NULL,
- set_timezone_cb,
- data);
- }
+ /* for now just do it */
+ if (data->current_location) {
+ timedate1_call_set_timezone (data->dtm,
+ data->current_location->zone,
+ TRUE,
+ NULL,
+ set_timezone_cb,
+ data);
+ }
}
static void
update_timezone (LocationData *data)
{
- SetupData *setup = data->setup;
- GString *str;
- gchar *location;
- gchar *timezone;
- gchar *c;
-
- str = g_string_new ("");
- for (c = data->current_location->zone; *c; c++) {
- switch (*c) {
- case '_':
- g_string_append_c (str, ' ');
- break;
- case '/':
- g_string_append (str, " / ");
- break;
- default:
- g_string_append_c (str, *c);
- }
- }
-
- c = strstr (str->str, " / ");
- location = g_strdup (c + 3);
- timezone = g_strdup (str->str);
-
- gtk_label_set_label (OBJ(GtkLabel*,"current-location-label"), location);
- gtk_label_set_label (OBJ(GtkLabel*,"current-timezone-label"), timezone);
-
- g_free (location);
- g_free (timezone);
-
- g_string_free (str, TRUE);
+ SetupData *setup = data->setup;
+ GString *str;
+ gchar *location;
+ gchar *timezone;
+ gchar *c;
+
+ str = g_string_new ("");
+ for (c = data->current_location->zone; *c; c++) {
+ switch (*c) {
+ case '_':
+ g_string_append_c (str, ' ');
+ break;
+ case '/':
+ g_string_append (str, " / ");
+ break;
+ default:
+ g_string_append_c (str, *c);
+ }
+ }
+
+ c = strstr (str->str, " / ");
+ location = g_strdup (c + 3);
+ timezone = g_strdup (str->str);
+
+ gtk_label_set_label (OBJ(GtkLabel*,"current-location-label"), location);
+ gtk_label_set_label (OBJ(GtkLabel*,"current-timezone-label"), timezone);
+
+ g_free (location);
+ g_free (timezone);
+
+ g_string_free (str, TRUE);
}
static void
@@ -100,50 +100,50 @@ static void
set_location_from_gweather_location (LocationData *data,
GWeatherLocation *gloc)
{
- SetupData *setup = data->setup;
- GWeatherTimezone *zone = gweather_location_get_timezone (gloc);
- gchar *city = gweather_location_get_city_name (gloc);
-
- if (zone != NULL) {
- const gchar *name;
- const gchar *id;
- GtkLabel *label;
-
- label = OBJ(GtkLabel*, "current-timezone-label");
-
- name = gweather_timezone_get_name (zone);
- id = gweather_timezone_get_tzid (zone);
- if (name == NULL) {
- /* Why does this happen ? */
- name = id;
- }
- gtk_label_set_label (label, name);
- cc_timezone_map_set_timezone (data->map, id);
- }
-
- if (city != NULL) {
- GtkLabel *label;
-
- label = OBJ(GtkLabel*, "current-location-label");
- gtk_label_set_label (label, city);
- }
-
- g_free (city);
+ SetupData *setup = data->setup;
+ GWeatherTimezone *zone = gweather_location_get_timezone (gloc);
+ gchar *city = gweather_location_get_city_name (gloc);
+
+ if (zone != NULL) {
+ const gchar *name;
+ const gchar *id;
+ GtkLabel *label;
+
+ label = OBJ(GtkLabel*, "current-timezone-label");
+
+ name = gweather_timezone_get_name (zone);
+ id = gweather_timezone_get_tzid (zone);
+ if (name == NULL) {
+ /* Why does this happen ? */
+ name = id;
+ }
+ gtk_label_set_label (label, name);
+ cc_timezone_map_set_timezone (data->map, id);
+ }
+
+ if (city != NULL) {
+ GtkLabel *label;
+
+ label = OBJ(GtkLabel*, "current-location-label");
+ gtk_label_set_label (label, city);
+ }
+
+ g_free (city);
}
static void
location_changed (GObject *object, GParamSpec *param, LocationData *data)
{
- GWeatherLocationEntry *entry = GWEATHER_LOCATION_ENTRY (object);
- GWeatherLocation *gloc;
+ GWeatherLocationEntry *entry = GWEATHER_LOCATION_ENTRY (object);
+ GWeatherLocation *gloc;
- gloc = gweather_location_entry_get_location (entry);
- if (gloc == NULL)
- return;
+ gloc = gweather_location_entry_get_location (entry);
+ if (gloc == NULL)
+ return;
- set_location_from_gweather_location (data, gloc);
+ set_location_from_gweather_location (data, gloc);
- gweather_location_unref (gloc);
+ gweather_location_unref (gloc);
}
#define WANT_GEOCLUE 0
@@ -160,124 +160,124 @@ position_callback (GeocluePosition *pos,
GError *error,
LocationData *data)
{
- if (error) {
- g_printerr ("Error getting position: %s\n", error->message);
- g_error_free (error);
- } else {
- if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE &&
- fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) {
- GWeatherLocation *city = gweather_location_find_nearest_city (latitude, longitude);
- set_location_from_gweather_location (data, city);
- } else {
- g_print ("Position not available.\n");
- }
- }
+ if (error) {
+ g_printerr ("Error getting position: %s\n", error->message);
+ g_error_free (error);
+ } else {
+ if (fields & GEOCLUE_POSITION_FIELDS_LATITUDE &&
+ fields & GEOCLUE_POSITION_FIELDS_LONGITUDE) {
+ GWeatherLocation *city = gweather_location_find_nearest_city (latitude, longitude);
+ set_location_from_gweather_location (data, city);
+ } else {
+ g_print ("Position not available.\n");
+ }
+ }
}
static void
determine_location (GtkWidget *widget,
LocationData *data)
{
- GeoclueMaster *master;
- GeoclueMasterClient *client;
- GeocluePosition *position = NULL;
- GError *error = NULL;
-
- master = geoclue_master_get_default ();
- client = geoclue_master_create_client (master, NULL, NULL);
- g_object_unref (master);
-
- if (!geoclue_master_client_set_requirements (client,
- GEOCLUE_ACCURACY_LEVEL_LOCALITY,
- 0, TRUE,
- GEOCLUE_RESOURCE_ALL,
- NULL)){
- g_printerr ("Setting requirements failed");
- goto out;
- }
-
- position = geoclue_master_client_create_position (client, &error);
- if (position == NULL) {
- g_warning ("Creating GeocluePosition failed: %s", error->message);
- goto out;
- }
-
- geoclue_position_get_position_async (position,
- (GeocluePositionCallback) position_callback,
- data);
+ GeoclueMaster *master;
+ GeoclueMasterClient *client;
+ GeocluePosition *position = NULL;
+ GError *error = NULL;
+
+ master = geoclue_master_get_default ();
+ client = geoclue_master_create_client (master, NULL, NULL);
+ g_object_unref (master);
+
+ if (!geoclue_master_client_set_requirements (client,
+ GEOCLUE_ACCURACY_LEVEL_LOCALITY,
+ 0, TRUE,
+ GEOCLUE_RESOURCE_ALL,
+ NULL)){
+ g_printerr ("Setting requirements failed");
+ goto out;
+ }
+
+ position = geoclue_master_client_create_position (client, &error);
+ if (position == NULL) {
+ g_warning ("Creating GeocluePosition failed: %s", error->message);
+ goto out;
+ }
+
+ geoclue_position_get_position_async (position,
+ (GeocluePositionCallback) position_callback,
+ data);
out:
- g_clear_error (&error);
- g_object_unref (client);
- g_object_unref (position);
+ g_clear_error (&error);
+ g_object_unref (client);
+ g_object_unref (position);
}
#endif
void
gis_prepare_location_page (LocationData *data)
{
- GtkWidget *frame, *map, *entry;
- GWeatherLocation *world;
- GError *error;
- const gchar *timezone;
- SetupData *setup = data->setup;
-
- frame = WID("location-map-frame");
-
- error = NULL;
- data->dtm = timedate1_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_FLAGS_NONE,
- "org.freedesktop.timedate1",
- "/org/freedesktop/timedate1",
- NULL,
- &error);
- if (data->dtm == NULL) {
- g_error ("Failed to create proxy for timedated: %s", error->message);
- exit (1);
- }
-
- data->map = cc_timezone_map_new ();
- map = (GtkWidget *)data->map;
- gtk_widget_set_hexpand (map, TRUE);
- gtk_widget_set_vexpand (map, TRUE);
- gtk_widget_set_halign (map, GTK_ALIGN_FILL);
- gtk_widget_set_valign (map, GTK_ALIGN_FILL);
- gtk_widget_show (map);
-
- gtk_container_add (GTK_CONTAINER (frame), map);
-
- world = gweather_location_new_world (FALSE);
- entry = gweather_location_entry_new (world);
- gtk_entry_set_placeholder_text (GTK_ENTRY (entry), _("Search for a location"));
- gtk_widget_set_halign (entry, GTK_ALIGN_END);
- gtk_widget_show (entry);
-
- frame = WID("location-page");
- gtk_grid_attach (GTK_GRID (frame), entry, 1, 1, 1, 1);
-
- timezone = timedate1_get_timezone (data->dtm);
-
- if (!cc_timezone_map_set_timezone (data->map, timezone)) {
- g_warning ("Timezone '%s' is unhandled, setting %s as default", timezone, DEFAULT_TZ);
- cc_timezone_map_set_timezone (data->map, DEFAULT_TZ);
- }
- else {
- g_debug ("System timezone is '%s'", timezone);
- }
-
- data->current_location = cc_timezone_map_get_location (data->map);
- update_timezone (data);
-
- g_signal_connect (G_OBJECT (entry), "notify::location",
- G_CALLBACK (location_changed), data);
-
- g_signal_connect (map, "location-changed",
- G_CALLBACK (location_changed_cb), data);
+ GtkWidget *frame, *map, *entry;
+ GWeatherLocation *world;
+ GError *error;
+ const gchar *timezone;
+ SetupData *setup = data->setup;
+
+ frame = WID("location-map-frame");
+
+ error = NULL;
+ data->dtm = timedate1_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.freedesktop.timedate1",
+ "/org/freedesktop/timedate1",
+ NULL,
+ &error);
+ if (data->dtm == NULL) {
+ g_error ("Failed to create proxy for timedated: %s", error->message);
+ exit (1);
+ }
+
+ data->map = cc_timezone_map_new ();
+ map = (GtkWidget *)data->map;
+ gtk_widget_set_hexpand (map, TRUE);
+ gtk_widget_set_vexpand (map, TRUE);
+ gtk_widget_set_halign (map, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (map, GTK_ALIGN_FILL);
+ gtk_widget_show (map);
+
+ gtk_container_add (GTK_CONTAINER (frame), map);
+
+ world = gweather_location_new_world (FALSE);
+ entry = gweather_location_entry_new (world);
+ gtk_entry_set_placeholder_text (GTK_ENTRY (entry), _("Search for a location"));
+ gtk_widget_set_halign (entry, GTK_ALIGN_END);
+ gtk_widget_show (entry);
+
+ frame = WID("location-page");
+ gtk_grid_attach (GTK_GRID (frame), entry, 1, 1, 1, 1);
+
+ timezone = timedate1_get_timezone (data->dtm);
+
+ if (!cc_timezone_map_set_timezone (data->map, timezone)) {
+ g_warning ("Timezone '%s' is unhandled, setting %s as default", timezone, DEFAULT_TZ);
+ cc_timezone_map_set_timezone (data->map, DEFAULT_TZ);
+ }
+ else {
+ g_debug ("System timezone is '%s'", timezone);
+ }
+
+ data->current_location = cc_timezone_map_get_location (data->map);
+ update_timezone (data);
+
+ g_signal_connect (G_OBJECT (entry), "notify::location",
+ G_CALLBACK (location_changed), data);
+
+ g_signal_connect (map, "location-changed",
+ G_CALLBACK (location_changed_cb), data);
#if WANT_GEOCLUE
- g_signal_connect (WID ("location-auto-button"), "clicked",
- G_CALLBACK (determine_location), data);
+ g_signal_connect (WID ("location-auto-button"), "clicked",
+ G_CALLBACK (determine_location), data);
#else
- gtk_widget_hide (WID ("location-auto-button"));
+ gtk_widget_hide (WID ("location-auto-button"));
#endif
}
diff --git a/gnome-initial-setup/gis-network-page.c b/gnome-initial-setup/gis-network-page.c
index 82fed69..aa30b46 100644
--- a/gnome-initial-setup/gis-network-page.c
+++ b/gnome-initial-setup/gis-network-page.c
@@ -15,15 +15,15 @@
#include "panel-cell-renderer-security.h"
enum {
- PANEL_WIRELESS_COLUMN_ID,
- PANEL_WIRELESS_COLUMN_TITLE,
- PANEL_WIRELESS_COLUMN_SORT,
- PANEL_WIRELESS_COLUMN_STRENGTH,
- PANEL_WIRELESS_COLUMN_MODE,
- PANEL_WIRELESS_COLUMN_SECURITY,
- PANEL_WIRELESS_COLUMN_ACTIVATING,
- PANEL_WIRELESS_COLUMN_ACTIVE,
- PANEL_WIRELESS_COLUMN_PULSE
+ PANEL_WIRELESS_COLUMN_ID,
+ PANEL_WIRELESS_COLUMN_TITLE,
+ PANEL_WIRELESS_COLUMN_SORT,
+ PANEL_WIRELESS_COLUMN_STRENGTH,
+ PANEL_WIRELESS_COLUMN_MODE,
+ PANEL_WIRELESS_COLUMN_SECURITY,
+ PANEL_WIRELESS_COLUMN_ACTIVATING,
+ PANEL_WIRELESS_COLUMN_ACTIVE,
+ PANEL_WIRELESS_COLUMN_PULSE
};
static gint
@@ -32,243 +32,243 @@ wireless_sort_cb (GtkTreeModel *model,
GtkTreeIter *b,
gpointer user_data)
{
- gchar *str_a;
- gchar *str_b;
- gint retval;
-
- gtk_tree_model_get (model, a, PANEL_WIRELESS_COLUMN_SORT, &str_a, -1);
- gtk_tree_model_get (model, b, PANEL_WIRELESS_COLUMN_SORT, &str_b, -1);
-
- /* special case blank entries to the bottom */
- if (g_strcmp0 (str_a, "") == 0) {
- retval = 1;
- goto out;
- }
- if (g_strcmp0 (str_b, "") == 0) {
- retval = -1;
- goto out;
- }
-
- retval = g_strcmp0 (str_a, str_b);
-out:
- g_free (str_a);
- g_free (str_b);
-
- return retval;
+ gchar *str_a;
+ gchar *str_b;
+ gint retval;
+
+ gtk_tree_model_get (model, a, PANEL_WIRELESS_COLUMN_SORT, &str_a, -1);
+ gtk_tree_model_get (model, b, PANEL_WIRELESS_COLUMN_SORT, &str_b, -1);
+
+ /* special case blank entries to the bottom */
+ if (g_strcmp0 (str_a, "") == 0) {
+ retval = 1;
+ goto out;
+ }
+ if (g_strcmp0 (str_b, "") == 0) {
+ retval = -1;
+ goto out;
+ }
+
+ retval = g_strcmp0 (str_a, str_b);
+ out:
+ g_free (str_a);
+ g_free (str_b);
+
+ return retval;
}
static GPtrArray *
get_strongest_unique_aps (const GPtrArray *aps)
{
- const GByteArray *ssid;
- const GByteArray *ssid_tmp;
- GPtrArray *unique = NULL;
- gboolean add_ap;
- guint i;
- guint j;
- NMAccessPoint *ap;
- NMAccessPoint *ap_tmp;
-
- /* we will have multiple entries for typical hotspots,
- * just keep the one with the strongest signal
- */
- unique = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- if (aps == NULL)
- goto out;
-
- for (i = 0; i < aps->len; i++) {
- ap = NM_ACCESS_POINT (g_ptr_array_index (aps, i));
- ssid = nm_access_point_get_ssid (ap);
- add_ap = TRUE;
-
- /* get already added list */
- for (j = 0; j < unique->len; j++) {
- ap_tmp = NM_ACCESS_POINT (g_ptr_array_index (unique, j));
- ssid_tmp = nm_access_point_get_ssid (ap_tmp);
-
- /* is this the same type and data? */
- if (nm_utils_same_ssid (ssid, ssid_tmp, TRUE)) {
- /* the new access point is stronger */
- if (nm_access_point_get_strength (ap) >
- nm_access_point_get_strength (ap_tmp)) {
- g_ptr_array_remove (unique, ap_tmp);
- add_ap = TRUE;
- } else {
- add_ap = FALSE;
- }
- break;
- }
- }
- if (add_ap) {
- g_ptr_array_add (unique, g_object_ref (ap));
- }
+ const GByteArray *ssid;
+ const GByteArray *ssid_tmp;
+ GPtrArray *unique = NULL;
+ gboolean add_ap;
+ guint i;
+ guint j;
+ NMAccessPoint *ap;
+ NMAccessPoint *ap_tmp;
+
+ /* we will have multiple entries for typical hotspots,
+ * just keep the one with the strongest signal
+ */
+ unique = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ if (aps == NULL)
+ goto out;
+
+ for (i = 0; i < aps->len; i++) {
+ ap = NM_ACCESS_POINT (g_ptr_array_index (aps, i));
+ ssid = nm_access_point_get_ssid (ap);
+ add_ap = TRUE;
+
+ /* get already added list */
+ for (j = 0; j < unique->len; j++) {
+ ap_tmp = NM_ACCESS_POINT (g_ptr_array_index (unique, j));
+ ssid_tmp = nm_access_point_get_ssid (ap_tmp);
+
+ /* is this the same type and data? */
+ if (nm_utils_same_ssid (ssid, ssid_tmp, TRUE)) {
+ /* the new access point is stronger */
+ if (nm_access_point_get_strength (ap) >
+ nm_access_point_get_strength (ap_tmp)) {
+ g_ptr_array_remove (unique, ap_tmp);
+ add_ap = TRUE;
+ } else {
+ add_ap = FALSE;
}
-
-out:
- return unique;
+ break;
+ }
+ }
+ if (add_ap) {
+ g_ptr_array_add (unique, g_object_ref (ap));
+ }
+ }
+
+ out:
+ return unique;
}
static guint
get_access_point_security (NMAccessPoint *ap)
{
- NM80211ApFlags flags;
- NM80211ApSecurityFlags wpa_flags;
- NM80211ApSecurityFlags rsn_flags;
- guint type;
-
- flags = nm_access_point_get_flags (ap);
- wpa_flags = nm_access_point_get_wpa_flags (ap);
- rsn_flags = nm_access_point_get_rsn_flags (ap);
-
- if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
- wpa_flags == NM_802_11_AP_SEC_NONE &&
- rsn_flags == NM_802_11_AP_SEC_NONE)
- type = NM_AP_SEC_NONE;
- else if ((flags & NM_802_11_AP_FLAGS_PRIVACY) &&
- wpa_flags == NM_802_11_AP_SEC_NONE &&
- rsn_flags == NM_802_11_AP_SEC_NONE)
- type = NM_AP_SEC_WEP;
- else if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
- wpa_flags != NM_802_11_AP_SEC_NONE &&
- rsn_flags != NM_802_11_AP_SEC_NONE)
- type = NM_AP_SEC_WPA;
- else
- type = NM_AP_SEC_WPA2;
-
- return type;
+ NM80211ApFlags flags;
+ NM80211ApSecurityFlags wpa_flags;
+ NM80211ApSecurityFlags rsn_flags;
+ guint type;
+
+ flags = nm_access_point_get_flags (ap);
+ wpa_flags = nm_access_point_get_wpa_flags (ap);
+ rsn_flags = nm_access_point_get_rsn_flags (ap);
+
+ if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags == NM_802_11_AP_SEC_NONE &&
+ rsn_flags == NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_NONE;
+ else if ((flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags == NM_802_11_AP_SEC_NONE &&
+ rsn_flags == NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_WEP;
+ else if (!(flags & NM_802_11_AP_FLAGS_PRIVACY) &&
+ wpa_flags != NM_802_11_AP_SEC_NONE &&
+ rsn_flags != NM_802_11_AP_SEC_NONE)
+ type = NM_AP_SEC_WPA;
+ else
+ type = NM_AP_SEC_WPA2;
+
+ return type;
}
static void
add_access_point (NetworkData *data, NMAccessPoint *ap, NMAccessPoint *active)
{
- const GByteArray *ssid;
- const gchar *ssid_text;
- const gchar *object_path;
- GtkTreeIter iter;
- gboolean activated, activating;
-
- ssid = nm_access_point_get_ssid (ap);
- object_path = nm_object_get_path (NM_OBJECT (ap));
-
- if (ssid == NULL)
- return;
- ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
-
- if (active &&
- nm_utils_same_ssid (ssid, nm_access_point_get_ssid (active), TRUE)) {
- switch (nm_device_get_state (data->nm_device))
- {
- case NM_DEVICE_STATE_PREPARE:
- case NM_DEVICE_STATE_CONFIG:
- case NM_DEVICE_STATE_NEED_AUTH:
- case NM_DEVICE_STATE_IP_CONFIG:
- case NM_DEVICE_STATE_SECONDARIES:
- activated = FALSE;
- activating = TRUE;
- break;
- case NM_DEVICE_STATE_ACTIVATED:
- activated = TRUE;
- activating = FALSE;
- break;
- default:
- activated = FALSE;
- activating = FALSE;
- break;
- }
- } else {
- activated = FALSE;
- activating = FALSE;
- }
-
- gtk_list_store_append (data->ap_list, &iter);
- gtk_list_store_set (data->ap_list, &iter,
- PANEL_WIRELESS_COLUMN_ID, object_path,
- PANEL_WIRELESS_COLUMN_TITLE, ssid_text,
- PANEL_WIRELESS_COLUMN_SORT, ssid_text,
- PANEL_WIRELESS_COLUMN_STRENGTH, nm_access_point_get_strength (ap),
- PANEL_WIRELESS_COLUMN_MODE, nm_access_point_get_mode (ap),
- PANEL_WIRELESS_COLUMN_SECURITY, get_access_point_security (ap),
- PANEL_WIRELESS_COLUMN_ACTIVATING, activating,
- PANEL_WIRELESS_COLUMN_ACTIVE, activated,
- PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
- -1);
- if (activating) {
- GtkTreePath *path;
- GtkTreeModel *model;
-
- model = (GtkTreeModel*)data->ap_list;
- path = gtk_tree_model_get_path (model, &iter);
- data->row = gtk_tree_row_reference_new (model, path);
- gtk_tree_path_free (path);
- }
+ const GByteArray *ssid;
+ const gchar *ssid_text;
+ const gchar *object_path;
+ GtkTreeIter iter;
+ gboolean activated, activating;
+
+ ssid = nm_access_point_get_ssid (ap);
+ object_path = nm_object_get_path (NM_OBJECT (ap));
+
+ if (ssid == NULL)
+ return;
+ ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
+
+ if (active &&
+ nm_utils_same_ssid (ssid, nm_access_point_get_ssid (active), TRUE)) {
+ switch (nm_device_get_state (data->nm_device))
+ {
+ case NM_DEVICE_STATE_PREPARE:
+ case NM_DEVICE_STATE_CONFIG:
+ case NM_DEVICE_STATE_NEED_AUTH:
+ case NM_DEVICE_STATE_IP_CONFIG:
+ case NM_DEVICE_STATE_SECONDARIES:
+ activated = FALSE;
+ activating = TRUE;
+ break;
+ case NM_DEVICE_STATE_ACTIVATED:
+ activated = TRUE;
+ activating = FALSE;
+ break;
+ default:
+ activated = FALSE;
+ activating = FALSE;
+ break;
+ }
+ } else {
+ activated = FALSE;
+ activating = FALSE;
+ }
+
+ gtk_list_store_append (data->ap_list, &iter);
+ gtk_list_store_set (data->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ID, object_path,
+ PANEL_WIRELESS_COLUMN_TITLE, ssid_text,
+ PANEL_WIRELESS_COLUMN_SORT, ssid_text,
+ PANEL_WIRELESS_COLUMN_STRENGTH, nm_access_point_get_strength (ap),
+ PANEL_WIRELESS_COLUMN_MODE, nm_access_point_get_mode (ap),
+ PANEL_WIRELESS_COLUMN_SECURITY, get_access_point_security (ap),
+ PANEL_WIRELESS_COLUMN_ACTIVATING, activating,
+ PANEL_WIRELESS_COLUMN_ACTIVE, activated,
+ PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
+ -1);
+ if (activating) {
+ GtkTreePath *path;
+ GtkTreeModel *model;
+
+ model = (GtkTreeModel*)data->ap_list;
+ path = gtk_tree_model_get_path (model, &iter);
+ data->row = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
+ }
}
static void
add_access_point_other (NetworkData *data)
{
- GtkTreeIter iter;
-
- gtk_list_store_append (data->ap_list, &iter);
- gtk_list_store_set (data->ap_list, &iter,
- PANEL_WIRELESS_COLUMN_ID, "ap-other...",
- /* TRANSLATORS: this is when the access point is not listed
- * * in the dropdown (or hidden) and the user has to select
- * * another entry manually */
-
- PANEL_WIRELESS_COLUMN_TITLE, C_("Wireless access point", "Other..."),
- /* always last */
- PANEL_WIRELESS_COLUMN_SORT, "",
- PANEL_WIRELESS_COLUMN_STRENGTH, 0,
- PANEL_WIRELESS_COLUMN_MODE, NM_802_11_MODE_UNKNOWN,
- PANEL_WIRELESS_COLUMN_SECURITY, NM_AP_SEC_UNKNOWN,
- PANEL_WIRELESS_COLUMN_ACTIVATING, FALSE,
- PANEL_WIRELESS_COLUMN_ACTIVE, FALSE,
- PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
- -1);
+ GtkTreeIter iter;
+
+ gtk_list_store_append (data->ap_list, &iter);
+ gtk_list_store_set (data->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ID, "ap-other...",
+ /* TRANSLATORS: this is when the access point is not listed
+ * * in the dropdown (or hidden) and the user has to select
+ * * another entry manually */
+
+ PANEL_WIRELESS_COLUMN_TITLE, C_("Wireless access point", "Other..."),
+ /* always last */
+ PANEL_WIRELESS_COLUMN_SORT, "",
+ PANEL_WIRELESS_COLUMN_STRENGTH, 0,
+ PANEL_WIRELESS_COLUMN_MODE, NM_802_11_MODE_UNKNOWN,
+ PANEL_WIRELESS_COLUMN_SECURITY, NM_AP_SEC_UNKNOWN,
+ PANEL_WIRELESS_COLUMN_ACTIVATING, FALSE,
+ PANEL_WIRELESS_COLUMN_ACTIVE, FALSE,
+ PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
+ -1);
}
static void
select_and_scroll_to_ap (NetworkData *data, NMAccessPoint *ap)
{
- GtkTreeModel *model;
- GtkTreeView *tv;
- GtkTreeViewColumn *col;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gchar *ssid_target;
- const GByteArray *ssid;
- const gchar *ssid_text;
- SetupData *setup = data->setup;
-
- model = (GtkTreeModel *)data->ap_list;
-
- if (!gtk_tree_model_get_iter_first (model, &iter))
- return;
-
- tv = OBJ(GtkTreeView*, "network-list");
- col = OBJ(GtkTreeViewColumn*, "network-list-column");
- selection = OBJ(GtkTreeSelection*, "network-list-selection");
-
- ssid = nm_access_point_get_ssid (ap);
- ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
-
- do {
- gtk_tree_model_get (model, &iter,
- PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
- -1);
- if (g_strcmp0 (ssid_target, ssid_text) == 0) {
- g_free (ssid_target);
- gtk_tree_selection_select_iter (selection, &iter);
- path = gtk_tree_model_get_path (model, &iter);
- gtk_tree_view_scroll_to_cell (tv, path, col, FALSE, 0, 0);
- gtk_tree_path_free (path);
- break;
- }
- g_free (ssid_target);
-
- } while (gtk_tree_model_iter_next (model, &iter));
+ GtkTreeModel *model;
+ GtkTreeView *tv;
+ GtkTreeViewColumn *col;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ gchar *ssid_target;
+ const GByteArray *ssid;
+ const gchar *ssid_text;
+ SetupData *setup = data->setup;
+
+ model = (GtkTreeModel *)data->ap_list;
+
+ if (!gtk_tree_model_get_iter_first (model, &iter))
+ return;
+
+ tv = OBJ(GtkTreeView*, "network-list");
+ col = OBJ(GtkTreeViewColumn*, "network-list-column");
+ selection = OBJ(GtkTreeSelection*, "network-list-selection");
+
+ ssid = nm_access_point_get_ssid (ap);
+ ssid_text = nm_utils_escape_ssid (ssid->data, ssid->len);
+
+ do {
+ gtk_tree_model_get (model, &iter,
+ PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
+ -1);
+ if (g_strcmp0 (ssid_target, ssid_text) == 0) {
+ g_free (ssid_target);
+ gtk_tree_selection_select_iter (selection, &iter);
+ path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_view_scroll_to_cell (tv, path, col, FALSE, 0, 0);
+ gtk_tree_path_free (path);
+ break;
+ }
+ g_free (ssid_target);
+
+ } while (gtk_tree_model_iter_next (model, &iter));
}
static void refresh_wireless_list (NetworkData *data);
@@ -276,113 +276,113 @@ static void refresh_wireless_list (NetworkData *data);
static gboolean
refresh_again (gpointer user_data)
{
- NetworkData *data = user_data;
+ NetworkData *data = user_data;
- refresh_wireless_list (data);
+ refresh_wireless_list (data);
- return FALSE;
+ return FALSE;
}
static void
refresh_without_device (NetworkData *data)
{
- GtkWidget *label;
- GtkWidget *spinner;
- GtkWidget *swin;
- SetupData *setup = data->setup;
-
- swin = WID("network-scrolledwindow");
- label = WID("no-network-label");
- spinner = WID("no-network-spinner");
-
- if (nm_client_get_state (data->nm_client) == NM_STATE_CONNECTED_GLOBAL)
- gtk_label_set_text (GTK_LABEL (label), _("Wireless network is not available, but we are connected anyway."));
- else if (data->nm_device != NULL)
- gtk_label_set_text (GTK_LABEL (label), _("Network is not available, make sure to turn airplane mode off."));
- else
- gtk_label_set_text (GTK_LABEL (label), _("No network devices found"));
-
- gtk_widget_hide (swin);
- gtk_widget_hide (spinner);
- gtk_widget_show (label);
+ GtkWidget *label;
+ GtkWidget *spinner;
+ GtkWidget *swin;
+ SetupData *setup = data->setup;
+
+ swin = WID("network-scrolledwindow");
+ label = WID("no-network-label");
+ spinner = WID("no-network-spinner");
+
+ if (nm_client_get_state (data->nm_client) == NM_STATE_CONNECTED_GLOBAL)
+ gtk_label_set_text (GTK_LABEL (label), _("Wireless network is not available, but we are connected anyway."));
+ else if (data->nm_device != NULL)
+ gtk_label_set_text (GTK_LABEL (label), _("Network is not available, make sure to turn airplane mode off."));
+ else
+ gtk_label_set_text (GTK_LABEL (label), _("No network devices found"));
+
+ gtk_widget_hide (swin);
+ gtk_widget_hide (spinner);
+ gtk_widget_show (label);
}
static void
refresh_wireless_list (NetworkData *data)
{
- NMDeviceState state = NM_DEVICE_STATE_UNAVAILABLE;
- NMAccessPoint *active_ap = NULL;
- NMAccessPoint *ap;
- const GPtrArray *aps;
- GPtrArray *unique_aps;
- guint i;
- GtkWidget *label;
- GtkWidget *spinner;
- GtkWidget *swin;
- SetupData *setup = data->setup;
-
- data->refreshing = TRUE;
-
- if (NM_IS_DEVICE_WIFI (data->nm_device)) {
- state = nm_device_get_state (data->nm_device);
-
- active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (data->nm_device));
-
- gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), NULL);
- gtk_list_store_clear (data->ap_list);
- if (data->row) {
- gtk_tree_row_reference_free (data->row);
- data->row = NULL;
- }
-
- aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (data->nm_device));
- }
-
- swin = WID("network-scrolledwindow");
- label = WID("no-network-label");
- spinner = WID("no-network-spinner");
-
- if (state == NM_DEVICE_STATE_UNMANAGED ||
- state == NM_DEVICE_STATE_UNAVAILABLE) {
- refresh_without_device (data);
- goto out;
- }
- else if (aps == NULL || aps->len == 0) {
- gtk_label_set_text (GTK_LABEL (label), _("Checking for available wireless networks"));
- gtk_widget_hide (swin);
- gtk_widget_show (spinner);
- gtk_widget_show (label);
- g_timeout_add_seconds (1, refresh_again, data);
-
- goto out;
- }
- else {
- gtk_widget_show (swin);
- gtk_widget_hide (spinner);
- gtk_widget_hide (label);
- }
-
- unique_aps = get_strongest_unique_aps (aps);
- for (i = 0; i < unique_aps->len; i++) {
- ap = NM_ACCESS_POINT (g_ptr_array_index (unique_aps, i));
- add_access_point (data, ap, active_ap);
- }
- g_ptr_array_unref (unique_aps);
- add_access_point_other (data);
-
-out:
- gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), (GtkTreeModel*)data->ap_list);
-
- if (active_ap)
- select_and_scroll_to_ap (data, active_ap);
-
- data->refreshing = FALSE;
+ NMDeviceState state = NM_DEVICE_STATE_UNAVAILABLE;
+ NMAccessPoint *active_ap = NULL;
+ NMAccessPoint *ap;
+ const GPtrArray *aps;
+ GPtrArray *unique_aps;
+ guint i;
+ GtkWidget *label;
+ GtkWidget *spinner;
+ GtkWidget *swin;
+ SetupData *setup = data->setup;
+
+ data->refreshing = TRUE;
+
+ if (NM_IS_DEVICE_WIFI (data->nm_device)) {
+ state = nm_device_get_state (data->nm_device);
+
+ active_ap = nm_device_wifi_get_active_access_point (NM_DEVICE_WIFI (data->nm_device));
+
+ gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), NULL);
+ gtk_list_store_clear (data->ap_list);
+ if (data->row) {
+ gtk_tree_row_reference_free (data->row);
+ data->row = NULL;
+ }
+
+ aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (data->nm_device));
+ }
+
+ swin = WID("network-scrolledwindow");
+ label = WID("no-network-label");
+ spinner = WID("no-network-spinner");
+
+ if (state == NM_DEVICE_STATE_UNMANAGED ||
+ state == NM_DEVICE_STATE_UNAVAILABLE) {
+ refresh_without_device (data);
+ goto out;
+ }
+ else if (aps == NULL || aps->len == 0) {
+ gtk_label_set_text (GTK_LABEL (label), _("Checking for available wireless networks"));
+ gtk_widget_hide (swin);
+ gtk_widget_show (spinner);
+ gtk_widget_show (label);
+ g_timeout_add_seconds (1, refresh_again, data);
+
+ goto out;
+ }
+ else {
+ gtk_widget_show (swin);
+ gtk_widget_hide (spinner);
+ gtk_widget_hide (label);
+ }
+
+ unique_aps = get_strongest_unique_aps (aps);
+ for (i = 0; i < unique_aps->len; i++) {
+ ap = NM_ACCESS_POINT (g_ptr_array_index (unique_aps, i));
+ add_access_point (data, ap, active_ap);
+ }
+ g_ptr_array_unref (unique_aps);
+ add_access_point_other (data);
+
+ out:
+ gtk_tree_view_set_model (OBJ(GtkTreeView*, "network-list"), (GtkTreeModel*)data->ap_list);
+
+ if (active_ap)
+ select_and_scroll_to_ap (data, active_ap);
+
+ data->refreshing = FALSE;
}
static void
device_state_changed (NMDevice *device, GParamSpec *pspec, NetworkData *data)
{
- refresh_wireless_list (data);
+ refresh_wireless_list (data);
}
static void
@@ -391,12 +391,12 @@ connection_activate_cb (NMClient *client,
GError *error,
gpointer user_data)
{
- NetworkData *data = user_data;
+ NetworkData *data = user_data;
- if (connection == NULL) {
- /* failed to activate */
- refresh_wireless_list (data);
- }
+ if (connection == NULL) {
+ /* failed to activate */
+ refresh_wireless_list (data);
+ }
}
static void
@@ -406,311 +406,311 @@ connection_add_activate_cb (NMClient *client,
GError *error,
gpointer user_data)
{
- connection_activate_cb (client, connection, error, user_data);
+ connection_activate_cb (client, connection, error, user_data);
}
static void
connect_to_hidden_network_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
- NetworkData *data = data;
- GError *error = NULL;
- GVariant *result = NULL;
-
- result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
- if (result == NULL) {
- g_warning ("failed to connect to hidden network: %s",
- error->message);
- g_error_free (error);
- }
-
- refresh_wireless_list (data);
+ NetworkData *data = data;
+ GError *error = NULL;
+ GVariant *result = NULL;
+
+ result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
+ if (result == NULL) {
+ g_warning ("failed to connect to hidden network: %s",
+ error->message);
+ g_error_free (error);
+ }
+
+ refresh_wireless_list (data);
}
static void
connect_to_hidden_network (NetworkData *data)
{
- GDBusProxy *proxy;
- GVariant *res = NULL;
- GError *error = NULL;
-
- /* connect to NM applet */
- proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
- NULL,
- "org.gnome.network_manager_applet",
- "/org/gnome/network_manager_applet",
- "org.gnome.network_manager_applet",
- NULL,
- &error);
- if (proxy == NULL) {
- g_warning ("failed to connect to NM applet: %s",
- error->message);
- g_error_free (error);
- goto out;
- }
-
- /* try to show the hidden network UI */
- g_dbus_proxy_call (proxy,
- "ConnectToHiddenNetwork",
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- 5000, /* don't wait forever */
- NULL,
- connect_to_hidden_network_cb,
- data);
-
-out:
- if (proxy != NULL)
- g_object_unref (proxy);
- if (res != NULL)
- g_variant_unref (res);
+ GDBusProxy *proxy;
+ GVariant *res = NULL;
+ GError *error = NULL;
+
+ /* connect to NM applet */
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
+ NULL,
+ "org.gnome.network_manager_applet",
+ "/org/gnome/network_manager_applet",
+ "org.gnome.network_manager_applet",
+ NULL,
+ &error);
+ if (proxy == NULL) {
+ g_warning ("failed to connect to NM applet: %s",
+ error->message);
+ g_error_free (error);
+ goto out;
+ }
+
+ /* try to show the hidden network UI */
+ g_dbus_proxy_call (proxy,
+ "ConnectToHiddenNetwork",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ 5000, /* don't wait forever */
+ NULL,
+ connect_to_hidden_network_cb,
+ data);
+
+ out:
+ if (proxy != NULL)
+ g_object_unref (proxy);
+ if (res != NULL)
+ g_variant_unref (res);
}
static void
wireless_selection_changed (GtkTreeSelection *selection, NetworkData *data)
{
- GtkTreeModel *model;
- GtkTreeIter iter;
- gchar *object_path;
- gchar *ssid_target;
- GSList *list, *filtered, *l;
- NMConnection *connection;
- NMConnection *connection_to_activate;
- NMSettingWireless *setting;
- const GByteArray *ssid;
- const gchar *ssid_tmp;
-
- if (data->refreshing)
- return;
-
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- gtk_tree_model_get (model, &iter,
- PANEL_WIRELESS_COLUMN_ID, &object_path,
- PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
- -1);
-
- gtk_list_store_set (data->ap_list, &iter,
- PANEL_WIRELESS_COLUMN_ACTIVATING, TRUE,
- -1);
-
- if (g_strcmp0 (object_path, "ap-other...") == 0) {
- connect_to_hidden_network (data);
- goto out;
- }
-
- list = nm_remote_settings_list_connections (data->nm_settings);
- filtered = nm_device_filter_connections (data->nm_device, list);
-
- connection_to_activate = NULL;
-
- for (l = filtered; l; l = l->next) {
- connection = NM_CONNECTION (l->data);
- setting = nm_connection_get_setting_wireless (connection);
- if (!NM_IS_SETTING_WIRELESS (setting))
- continue;
-
- ssid = nm_setting_wireless_get_ssid (setting);
- if (ssid == NULL)
- continue;
- ssid_tmp = nm_utils_escape_ssid (ssid->data, ssid->len);
- if (g_strcmp0 (ssid_target, ssid_tmp) == 0) {
- connection_to_activate = connection;
- break;
- }
- }
- g_slist_free (list);
- g_slist_free (filtered);
-
- if (connection_to_activate != NULL) {
- nm_client_activate_connection (data->nm_client,
- connection_to_activate,
- data->nm_device, NULL,
- connection_activate_cb, data);
- goto out;
- }
-
- nm_client_add_and_activate_connection (data->nm_client,
- NULL,
- data->nm_device, object_path,
- connection_add_activate_cb, data);
-
-out:
- g_free (object_path);
- g_free (ssid_target);
-
- refresh_wireless_list (data);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *object_path;
+ gchar *ssid_target;
+ GSList *list, *filtered, *l;
+ NMConnection *connection;
+ NMConnection *connection_to_activate;
+ NMSettingWireless *setting;
+ const GByteArray *ssid;
+ const gchar *ssid_tmp;
+
+ if (data->refreshing)
+ return;
+
+ if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter,
+ PANEL_WIRELESS_COLUMN_ID, &object_path,
+ PANEL_WIRELESS_COLUMN_TITLE, &ssid_target,
+ -1);
+
+ gtk_list_store_set (data->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_ACTIVATING, TRUE,
+ -1);
+
+ if (g_strcmp0 (object_path, "ap-other...") == 0) {
+ connect_to_hidden_network (data);
+ goto out;
+ }
+
+ list = nm_remote_settings_list_connections (data->nm_settings);
+ filtered = nm_device_filter_connections (data->nm_device, list);
+
+ connection_to_activate = NULL;
+
+ for (l = filtered; l; l = l->next) {
+ connection = NM_CONNECTION (l->data);
+ setting = nm_connection_get_setting_wireless (connection);
+ if (!NM_IS_SETTING_WIRELESS (setting))
+ continue;
+
+ ssid = nm_setting_wireless_get_ssid (setting);
+ if (ssid == NULL)
+ continue;
+ ssid_tmp = nm_utils_escape_ssid (ssid->data, ssid->len);
+ if (g_strcmp0 (ssid_target, ssid_tmp) == 0) {
+ connection_to_activate = connection;
+ break;
+ }
+ }
+ g_slist_free (list);
+ g_slist_free (filtered);
+
+ if (connection_to_activate != NULL) {
+ nm_client_activate_connection (data->nm_client,
+ connection_to_activate,
+ data->nm_device, NULL,
+ connection_activate_cb, data);
+ goto out;
+ }
+
+ nm_client_add_and_activate_connection (data->nm_client,
+ NULL,
+ data->nm_device, object_path,
+ connection_add_activate_cb, data);
+
+ out:
+ g_free (object_path);
+ g_free (ssid_target);
+
+ refresh_wireless_list (data);
}
static void
connection_state_changed (NMActiveConnection *c, GParamSpec *pspec, NetworkData *data)
{
- refresh_wireless_list (data);
+ refresh_wireless_list (data);
}
static void
active_connections_changed (NMClient *client, GParamSpec *pspec, NetworkData *data)
{
- const GPtrArray *connections;
- guint i;
-
- connections = nm_client_get_active_connections (client);
- for (i = 0; connections && (i < connections->len); i++) {
- NMActiveConnection *connection;
-
- connection = g_ptr_array_index (connections, i);
- if (!g_object_get_data (G_OBJECT (connection), "has-state-changed-handler")) {
- g_signal_connect (connection, "notify::state",
- G_CALLBACK (connection_state_changed), data);
- g_object_set_data (G_OBJECT (connection), "has-state-changed-handler", GINT_TO_POINTER (1));
- }
- }
-
- refresh_wireless_list (data);
+ const GPtrArray *connections;
+ guint i;
+
+ connections = nm_client_get_active_connections (client);
+ for (i = 0; connections && (i < connections->len); i++) {
+ NMActiveConnection *connection;
+
+ connection = g_ptr_array_index (connections, i);
+ if (!g_object_get_data (G_OBJECT (connection), "has-state-changed-handler")) {
+ g_signal_connect (connection, "notify::state",
+ G_CALLBACK (connection_state_changed), data);
+ g_object_set_data (G_OBJECT (connection), "has-state-changed-handler", GINT_TO_POINTER (1));
+ }
+ }
+
+ refresh_wireless_list (data);
}
static gboolean
bump_pulse (gpointer user_data)
{
- NetworkData *data = user_data;
- GtkTreeIter iter;
- GtkTreePath *path;
- GtkTreeModel *model;
-
- data->pulse++;
-
- if (!data->refreshing &&
- gtk_tree_row_reference_valid (data->row)) {
- model = (GtkTreeModel *)data->ap_list;
- path = gtk_tree_row_reference_get_path (data->row);
- gtk_tree_model_get_iter (model, &iter, path);
- gtk_tree_path_free (path);
- gtk_list_store_set (data->ap_list, &iter,
- PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
- -1);
- }
-
- return TRUE;
+ NetworkData *data = user_data;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ GtkTreeModel *model;
+
+ data->pulse++;
+
+ if (!data->refreshing &&
+ gtk_tree_row_reference_valid (data->row)) {
+ model = (GtkTreeModel *)data->ap_list;
+ path = gtk_tree_row_reference_get_path (data->row);
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_path_free (path);
+ gtk_list_store_set (data->ap_list, &iter,
+ PANEL_WIRELESS_COLUMN_PULSE, data->pulse,
+ -1);
+ }
+
+ return TRUE;
}
void
gis_prepare_network_page (NetworkData *data)
{
- GtkTreeViewColumn *col;
- GtkCellRenderer *cell;
- GtkTreeSortable *sortable;
- GtkTreeSelection *selection;
- const GPtrArray *devices;
- NMDevice *device;
- guint i;
- DBusGConnection *bus;
- GError *error;
- SetupData *setup = data->setup;
-
- col = OBJ(GtkTreeViewColumn*, "network-list-column");
-
- cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
- /* black small diamond */
- g_object_set (cell, "text", "\342\254\251", NULL);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "visible", PANEL_WIRELESS_COLUMN_ACTIVE,
- NULL);
- cell = gtk_cell_renderer_spinner_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
- gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", FALSE, NULL);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "active", PANEL_WIRELESS_COLUMN_ACTIVATING,
- "visible", PANEL_WIRELESS_COLUMN_ACTIVATING,
- "pulse", PANEL_WIRELESS_COLUMN_PULSE,
- NULL);
- g_timeout_add (80, bump_pulse, data);
-
- cell = gtk_cell_renderer_text_new ();
- g_object_set (cell, "width", 400, "width-chars", 45, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, TRUE);
- gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", TRUE, NULL);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "text", PANEL_WIRELESS_COLUMN_TITLE,
- NULL);
-
- cell = panel_cell_renderer_mode_new ();
- gtk_cell_renderer_set_padding (cell, 4, 0);
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "mode", PANEL_WIRELESS_COLUMN_MODE,
- NULL);
-
- cell = panel_cell_renderer_signal_new ();
- gtk_cell_renderer_set_padding (cell, 4, 0);
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "signal", PANEL_WIRELESS_COLUMN_STRENGTH,
- NULL);
-
- cell = panel_cell_renderer_security_new ();
- gtk_cell_renderer_set_padding (cell, 4, 0);
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
- "security", PANEL_WIRELESS_COLUMN_SECURITY,
- NULL);
-
- data->ap_list = g_object_ref (OBJ(GtkListStore *, "liststore-wireless"));
- sortable = GTK_TREE_SORTABLE (data->ap_list);
- gtk_tree_sortable_set_sort_column_id (sortable,
- PANEL_WIRELESS_COLUMN_SORT,
- GTK_SORT_ASCENDING);
- gtk_tree_sortable_set_sort_func (sortable,
- PANEL_WIRELESS_COLUMN_SORT,
- wireless_sort_cb,
- sortable,
- NULL);
-
- data->nm_client = nm_client_new ();
-
- g_signal_connect (data->nm_client, "notify::active-connections",
- G_CALLBACK (active_connections_changed), data);
-
- devices = nm_client_get_devices (data->nm_client);
- if (devices) {
- for (i = 0; i < devices->len; i++) {
- device = g_ptr_array_index (devices, i);
-
- if (!nm_device_get_managed (device))
- continue;
-
- if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_WIFI) {
- /* FIXME deal with multiple, dynamic devices */
- data->nm_device = device;
- g_signal_connect (G_OBJECT (device), "notify::state",
- G_CALLBACK (device_state_changed), data);
- break;
- }
- }
- }
-
- if (data->nm_device == NULL) {
- refresh_without_device (data);
- goto out;
- }
-
- error = NULL;
- bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
- if (!bus) {
- g_warning ("Error connecting to system D-Bus: %s",
- error->message);
- g_error_free (error);
- }
- data->nm_settings = nm_remote_settings_new (bus);
-
- selection = OBJ(GtkTreeSelection*, "network-list-selection");
-
- g_signal_connect (selection, "changed",
- G_CALLBACK (wireless_selection_changed), data);
-
- refresh_wireless_list (data);
-
-out: ;
+ GtkTreeViewColumn *col;
+ GtkCellRenderer *cell;
+ GtkTreeSortable *sortable;
+ GtkTreeSelection *selection;
+ const GPtrArray *devices;
+ NMDevice *device;
+ guint i;
+ DBusGConnection *bus;
+ GError *error;
+ SetupData *setup = data->setup;
+
+ col = OBJ(GtkTreeViewColumn*, "network-list-column");
+
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ /* black small diamond */
+ g_object_set (cell, "text", "\342\254\251", NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "visible", PANEL_WIRELESS_COLUMN_ACTIVE,
+ NULL);
+ cell = gtk_cell_renderer_spinner_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", FALSE, NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "active", PANEL_WIRELESS_COLUMN_ACTIVATING,
+ "visible", PANEL_WIRELESS_COLUMN_ACTIVATING,
+ "pulse", PANEL_WIRELESS_COLUMN_PULSE,
+ NULL);
+ g_timeout_add (80, bump_pulse, data);
+
+ cell = gtk_cell_renderer_text_new ();
+ g_object_set (cell, "width", 400, "width-chars", 45, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, TRUE);
+ gtk_cell_area_cell_set (gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)), cell, "align", TRUE, NULL);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "text", PANEL_WIRELESS_COLUMN_TITLE,
+ NULL);
+
+ cell = panel_cell_renderer_mode_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "mode", PANEL_WIRELESS_COLUMN_MODE,
+ NULL);
+
+ cell = panel_cell_renderer_signal_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "signal", PANEL_WIRELESS_COLUMN_STRENGTH,
+ NULL);
+
+ cell = panel_cell_renderer_security_new ();
+ gtk_cell_renderer_set_padding (cell, 4, 0);
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (col), cell, FALSE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (col), cell,
+ "security", PANEL_WIRELESS_COLUMN_SECURITY,
+ NULL);
+
+ data->ap_list = g_object_ref (OBJ(GtkListStore *, "liststore-wireless"));
+ sortable = GTK_TREE_SORTABLE (data->ap_list);
+ gtk_tree_sortable_set_sort_column_id (sortable,
+ PANEL_WIRELESS_COLUMN_SORT,
+ GTK_SORT_ASCENDING);
+ gtk_tree_sortable_set_sort_func (sortable,
+ PANEL_WIRELESS_COLUMN_SORT,
+ wireless_sort_cb,
+ sortable,
+ NULL);
+
+ data->nm_client = nm_client_new ();
+
+ g_signal_connect (data->nm_client, "notify::active-connections",
+ G_CALLBACK (active_connections_changed), data);
+
+ devices = nm_client_get_devices (data->nm_client);
+ if (devices) {
+ for (i = 0; i < devices->len; i++) {
+ device = g_ptr_array_index (devices, i);
+
+ if (!nm_device_get_managed (device))
+ continue;
+
+ if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_WIFI) {
+ /* FIXME deal with multiple, dynamic devices */
+ data->nm_device = device;
+ g_signal_connect (G_OBJECT (device), "notify::state",
+ G_CALLBACK (device_state_changed), data);
+ break;
+ }
+ }
+ }
+
+ if (data->nm_device == NULL) {
+ refresh_without_device (data);
+ goto out;
+ }
+
+ error = NULL;
+ bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+ if (!bus) {
+ g_warning ("Error connecting to system D-Bus: %s",
+ error->message);
+ g_error_free (error);
+ }
+ data->nm_settings = nm_remote_settings_new (bus);
+
+ selection = OBJ(GtkTreeSelection*, "network-list-selection");
+
+ g_signal_connect (selection, "changed",
+ G_CALLBACK (wireless_selection_changed), data);
+
+ refresh_wireless_list (data);
+
+ out: ;
}
diff --git a/gnome-initial-setup/gis-welcome-page.c b/gnome-initial-setup/gis-welcome-page.c
index d1812fd..b3c0fbb 100644
--- a/gnome-initial-setup/gis-welcome-page.c
+++ b/gnome-initial-setup/gis-welcome-page.c
@@ -13,32 +13,32 @@
void
gis_prepare_welcome_page (WelcomeData *data)
{
- gchar *s;
- SetupData *setup = data->setup;
- GKeyFile *overrides = gis_get_overrides (setup);
-
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-image",
- NULL, NULL);
-
- if (s && g_file_test (s, G_FILE_TEST_EXISTS))
- gtk_image_set_from_file (GTK_IMAGE (WID ("welcome-image")), s);
-
- g_free (s);
-
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-title",
- NULL, NULL);
- if (s)
- gtk_label_set_text (GTK_LABEL (WID ("welcome-title")), s);
- g_free (s);
-
- s = g_key_file_get_locale_string (overrides,
- "Welcome", "welcome-subtitle",
- NULL, NULL);
- if (s)
- gtk_label_set_text (GTK_LABEL (WID ("welcome-subtitle")), s);
- g_free (s);
-
- g_key_file_unref (overrides);
+ gchar *s;
+ SetupData *setup = data->setup;
+ GKeyFile *overrides = gis_get_overrides (setup);
+
+ s = g_key_file_get_locale_string (overrides,
+ "Welcome", "welcome-image",
+ NULL, NULL);
+
+ if (s && g_file_test (s, G_FILE_TEST_EXISTS))
+ gtk_image_set_from_file (GTK_IMAGE (WID ("welcome-image")), s);
+
+ g_free (s);
+
+ s = g_key_file_get_locale_string (overrides,
+ "Welcome", "welcome-title",
+ NULL, NULL);
+ if (s)
+ gtk_label_set_text (GTK_LABEL (WID ("welcome-title")), s);
+ g_free (s);
+
+ s = g_key_file_get_locale_string (overrides,
+ "Welcome", "welcome-subtitle",
+ NULL, NULL);
+ if (s)
+ gtk_label_set_text (GTK_LABEL (WID ("welcome-subtitle")), s);
+ g_free (s);
+
+ g_key_file_unref (overrides);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]