[ekiga] Ported lib/gui/gmpreferences* to GtkGrid (instead of GtkTable) and made the preference window follow



commit 3421db9935e2a368c0076b54fb34ea278482eb02
Author: Julien Puydt <jpuydt free fr>
Date:   Tue Jun 18 16:14:32 2013 +0200

    Ported lib/gui/gmpreferences* to GtkGrid (instead of GtkTable) and made the preference window follow

 lib/engine/gui/gtk-frontend/preferences-window.cpp |   63 ++--
 lib/gui/gmpreferences.c                            |  413 +++++++++-----------
 lib/gui/gmpreferences.h                            |   91 +++--
 3 files changed, 260 insertions(+), 307 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp 
b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index a5119c6..2e71370 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -453,8 +453,8 @@ gm_pw_init_general_page (GtkWidget *prefs_window,
                                 _("Personal Information"), 2, 2);
 
   entry = gnome_prefs_entry_new (subsection, _("_Full name:"),
-                           PERSONAL_DATA_KEY "full_name",
-                           _("Enter your full name"), 0, false);
+                                PERSONAL_DATA_KEY "full_name",
+                                _("Enter your full name"), 0, 2, false);
   gtk_widget_set_size_request (GTK_WIDGET (entry), 250, -1);
   gtk_entry_set_max_length (GTK_ENTRY (entry), 65);
 }
@@ -470,15 +470,15 @@ gm_pw_init_interface_page (GtkWidget *prefs_window,
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                 _("Video Display"), 1, 2);
 
-  gnome_prefs_toggle_new (subsection, _("Place windows displaying video _above other windows"), 
VIDEO_DISPLAY_KEY "stay_on_top", _("Place windows displaying video above other windows during calls"), 0);
+  gnome_prefs_toggle_new (subsection, _("Place windows displaying video _above other windows"), 
VIDEO_DISPLAY_KEY "stay_on_top", _("Place windows displaying video above other windows during calls"), 0, 2);
 
   /* Network Settings */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                            _("Network Settings"), 2, 2);
 
-  gnome_prefs_spin_new (subsection, _("Type of Service (TOS):"), PROTOCOLS_KEY "rtp_tos_field", _("The Type 
of Service (TOS) byte on outgoing RTP IP packets. This byte is used by the network to provide some level of 
Quality of Service (QoS). Default value 184 (0xB8) corresponds to Expedited Forwarding (EF) PHB as defined in 
RFC 3246."), 0.0, 255.0, 1.0, 0, NULL, true);
+  gnome_prefs_spin_new (subsection, _("Type of Service (TOS):"), PROTOCOLS_KEY "rtp_tos_field", _("The Type 
of Service (TOS) byte on outgoing RTP IP packets. This byte is used by the network to provide some level of 
Quality of Service (QoS). Default value 184 (0xB8) corresponds to Expedited Forwarding (EF) PHB as defined in 
RFC 3246."), 0.0, 255.0, 1.0, 0, 2, NULL, true);
 
-  gnome_prefs_toggle_new (subsection, _("Enable network _detection"), NAT_KEY "enable_stun", _("Enable the 
automatic network setup resulting from the STUN test"), 1);
+  gnome_prefs_toggle_new (subsection, _("Enable network _detection"), NAT_KEY "enable_stun", _("Enable the 
automatic network setup resulting from the STUN test"), 1, 2);
 }
 
 static void
@@ -490,19 +490,19 @@ gm_pw_init_call_options_page (GtkWidget *prefs_window,
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                            _("Call Forwarding"), 3, 2);
 
-  gnome_prefs_toggle_new (subsection, _("_Always forward calls to the given host"), CALL_FORWARDING_KEY 
"always_forward", _("If enabled, all incoming calls will be forwarded to the host that is specified in the 
protocol settings"), 0);
+  gnome_prefs_toggle_new (subsection, _("_Always forward calls to the given host"), CALL_FORWARDING_KEY 
"always_forward", _("If enabled, all incoming calls will be forwarded to the host that is specified in the 
protocol settings"), 0, 2);
 
-  gnome_prefs_toggle_new (subsection, _("Forward calls to the given host if _no answer"), 
CALL_FORWARDING_KEY "forward_on_no_answer", _("If enabled, all incoming calls will be forwarded to the host 
that is specified in the protocol settings if you do not answer the call"), 1);
+  gnome_prefs_toggle_new (subsection, _("Forward calls to the given host if _no answer"), 
CALL_FORWARDING_KEY "forward_on_no_answer", _("If enabled, all incoming calls will be forwarded to the host 
that is specified in the protocol settings if you do not answer the call"), 1, 2);
 
-  gnome_prefs_toggle_new (subsection, _("Forward calls to the given host if _busy"), CALL_FORWARDING_KEY 
"forward_on_busy", _("If enabled, all incoming calls will be forwarded to the host that is specified in the 
protocol settings if you already are in a call or if you are in busy mode"), 2);
+  gnome_prefs_toggle_new (subsection, _("Forward calls to the given host if _busy"), CALL_FORWARDING_KEY 
"forward_on_busy", _("If enabled, all incoming calls will be forwarded to the host that is specified in the 
protocol settings if you already are in a call or if you are in busy mode"), 2, 2);
 
 
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                            _("Call Options"), 2, 3);
 
   /* Add all the fields */
-  gnome_prefs_spin_new (subsection, _("Call forwarding delay (in seconds):"), CALL_OPTIONS_KEY 
"no_answer_timeout", _("Automatically reject or forward incoming calls if no answer is given after the 
specified amount of time (in seconds)"), 10.0, 299.0, 1.0, 0, NULL, true);
-  gnome_prefs_toggle_new (subsection, _("_Automatically answer incoming calls"), CALL_OPTIONS_KEY 
"auto_answer", _("If enabled, automatically answer incoming calls"), 1);
+  gnome_prefs_spin_new (subsection, _("Call forwarding delay (in seconds):"), CALL_OPTIONS_KEY 
"no_answer_timeout", _("Automatically reject or forward incoming calls if no answer is given after the 
specified amount of time (in seconds)"), 10.0, 299.0, 1.0, 0, 3, NULL, true);
+  gnome_prefs_toggle_new (subsection, _("_Automatically answer incoming calls"), CALL_OPTIONS_KEY 
"auto_answer", _("If enabled, automatically answer incoming calls"), 1, 3);
 }
 
 
@@ -537,10 +537,7 @@ gm_pw_init_sound_events_page (GtkWidget *prefs_window,
                                            1, 1);
 
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-  gtk_table_attach (GTK_TABLE (subsection), vbox, 0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_SHRINK), 
-                    (GtkAttachOptions) (GTK_SHRINK),
-                    0, 0);
+  gtk_grid_attach (GTK_GRID (subsection), vbox, 0, 0, 1, 1);
 
   /* The 3rd column will be invisible and contain the config key containing
      the file to play. The 4th one contains the key determining if the
@@ -666,7 +663,7 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
                                            _("Misc Settings"), 2, 2);
 
   entry =
-    gnome_prefs_entry_new (subsection, _("Forward _URI:"), H323_KEY "forward_host", _("The host where calls 
should be forwarded if call forwarding is enabled"), 1, false);
+    gnome_prefs_entry_new (subsection, _("Forward _URI:"), H323_KEY "forward_host", _("The host where calls 
should be forwarded if call forwarding is enabled"), 1, 2, false);
   if (!g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
     gtk_entry_set_text (GTK_ENTRY (entry), "h323:");
 
@@ -675,13 +672,13 @@ gm_pw_init_h323_page (GtkWidget *prefs_window,
                                 _("Advanced Settings"), 5, 4);
 
   /* The toggles */
-  gnome_prefs_toggle_new (subsection, _("Enable H.245 _tunneling"), H323_KEY "enable_h245_tunneling", 
_("This enables H.245 Tunneling mode. In H.245 Tunneling mode H.245 messages are encapsulated into the H.225 
channel (port 1720). This saves one TCP connection during calls. H.245 Tunneling was introduced in 
H.323v2."), 0);
+  gnome_prefs_toggle_new (subsection, _("Enable H.245 _tunneling"), H323_KEY "enable_h245_tunneling", 
_("This enables H.245 Tunneling mode. In H.245 Tunneling mode H.245 messages are encapsulated into the H.225 
channel (port 1720). This saves one TCP connection during calls. H.245 Tunneling was introduced in 
H.323v2."), 0, 4);
 
-  gnome_prefs_toggle_new (subsection, _("Enable _early H.245"), H323_KEY "enable_early_h245", _("This 
enables H.245 early in the setup"), 1);
+  gnome_prefs_toggle_new (subsection, _("Enable _early H.245"), H323_KEY "enable_early_h245", _("This 
enables H.245 early in the setup"), 1, 4);
 
-  gnome_prefs_toggle_new (subsection, _("Enable fast _start procedure"), H323_KEY "enable_fast_start", 
_("Connection will be established in Fast Start (Fast Connect) mode. Fast Start is a new way to start calls 
faster that was introduced in H.323v2."), 2);
+  gnome_prefs_toggle_new (subsection, _("Enable fast _start procedure"), H323_KEY "enable_fast_start", 
_("Connection will be established in Fast Start (Fast Connect) mode. Fast Start is a new way to start calls 
faster that was introduced in H.323v2."), 2, 4);
 
-  gnome_prefs_toggle_new (subsection, _("Enable H.239 control"), H323_KEY "enable_h239", _("This enables 
H.239 capability for additional video roles."), 3);
+  gnome_prefs_toggle_new (subsection, _("Enable H.239 control"), H323_KEY "enable_h239", _("This enables 
H.239 capability for additional video roles."), 3, 4);
 
   gnome_prefs_int_option_menu_new (subsection, NULL, roles, H323_KEY "video_role", _("Select the H.239 Video 
Role"), 4);
 
@@ -711,10 +708,10 @@ gm_pw_init_sip_page (GtkWidget *prefs_window,
   subsection = gnome_prefs_subsection_new (prefs_window, container,
                                            _("Misc Settings"), 2, 2);
 
-  gnome_prefs_entry_new (subsection, _("_Outbound proxy:"), SIP_KEY "outbound_proxy_host", _("The SIP 
Outbound Proxy to use for outgoing calls"), 0, false);
+  gnome_prefs_entry_new (subsection, _("_Outbound proxy:"), SIP_KEY "outbound_proxy_host", _("The SIP 
Outbound Proxy to use for outgoing calls"), 0, 2, false);
 
   entry =
-    gnome_prefs_entry_new (subsection, _("Forward _URI:"), SIP_KEY "forward_host", _("The host where calls 
should be forwarded if call forwarding is enabled"), 1, false);
+    gnome_prefs_entry_new (subsection, _("Forward _URI:"), SIP_KEY "forward_host", _("The host where calls 
should be forwarded if call forwarding is enabled"), 1, 2, false);
   if (!g_strcmp0 (gtk_entry_get_text (GTK_ENTRY (entry)), ""))
     gtk_entry_set_text (GTK_ENTRY (entry), "sip:");
 
@@ -896,7 +893,7 @@ gm_pw_init_video_devices_page (GtkWidget *prefs_window,
   g_free (array);
 
   /* Video Channel */
-  gnome_prefs_spin_new (subsection, _("Channel:"), VIDEO_DEVICES_KEY "channel", _("The video channel number 
to use (to select camera, tv or other sources)"), 0.0, 10.0, 1.0, 3, NULL, false);
+  gnome_prefs_spin_new (subsection, _("Channel:"), VIDEO_DEVICES_KEY "channel", _("The video channel number 
to use (to select camera, tv or other sources)"), 0.0, 10.0, 1.0, 3, 3, NULL, false);
 
   gnome_prefs_int_option_menu_new (subsection, _("Size:"), (const gchar**)video_size, VIDEO_DEVICES_KEY 
"size", _("Select the transmitted video size"), 1);
 
@@ -922,12 +919,7 @@ gm_pw_init_audio_codecs_page (GtkWidget *prefs_window,
                                _("Codecs"), 1, 1);
 
   codecs_list = codecs_box_new_with_type (Ekiga::Call::Audio);
-  gtk_table_attach (GTK_TABLE (subsection),
-                    codecs_list,
-                    0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_SHRINK),
-                    (GtkAttachOptions) (GTK_SHRINK),
-                    0, 0);
+  gtk_grid_attach (GTK_GRID (subsection), codecs_list, 0, 0, 1, 1);
 
   /* Here we add the audio codecs options */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
@@ -935,11 +927,11 @@ gm_pw_init_audio_codecs_page (GtkWidget *prefs_window,
 
   /* Translators: the full sentence is Automatically adjust jitter buffer
      between X and Y ms */
-  gnome_prefs_toggle_new (subsection, _("Enable silence _detection"), AUDIO_CODECS_KEY 
"enable_silence_detection", _("If enabled, use silence detection with the codecs supporting it"), 0);
+  gnome_prefs_toggle_new (subsection, _("Enable silence _detection"), AUDIO_CODECS_KEY 
"enable_silence_detection", _("If enabled, use silence detection with the codecs supporting it"), 0, 1);
 
-  gnome_prefs_toggle_new (subsection, _("Enable echo can_celation"), AUDIO_CODECS_KEY 
"enable_echo_cancellation", _("If enabled, use echo cancellation"), 1);
+  gnome_prefs_toggle_new (subsection, _("Enable echo can_celation"), AUDIO_CODECS_KEY 
"enable_echo_cancellation", _("If enabled, use echo cancellation"), 1, 1);
 
-  gnome_prefs_spin_new (subsection, _("Maximum _jitter buffer (in ms):"), AUDIO_CODECS_KEY 
"maximum_jitter_buffer", _("The maximum jitter buffer size for audio reception (in ms)"), 20.0, 2000.0, 50.0, 
2, NULL, true);
+  gnome_prefs_spin_new (subsection, _("Maximum _jitter buffer (in ms):"), AUDIO_CODECS_KEY 
"maximum_jitter_buffer", _("The maximum jitter buffer size for audio reception (in ms)"), 20.0, 2000.0, 50.0, 
2, 1, NULL, true);
 }
 
 
@@ -955,12 +947,7 @@ gm_pw_init_video_codecs_page (GtkWidget *prefs_window,
                                _("Codecs"), 1, 1);
 
   codecs_list = codecs_box_new_with_type (Ekiga::Call::Video);
-  gtk_table_attach (GTK_TABLE (subsection),
-                    codecs_list,
-                    0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_SHRINK),
-                    (GtkAttachOptions) (GTK_SHRINK),
-                    0, 0);
+  gtk_grid_attach (GTK_GRID (subsection), codecs_list, 0, 0, 1, 1);
 
   /* Here we add the video codecs options */
   subsection = gnome_prefs_subsection_new (prefs_window, container,
@@ -969,7 +956,7 @@ gm_pw_init_video_codecs_page (GtkWidget *prefs_window,
   /* Translators: the full sentence is Keep a minimum video quality of X % */
   gnome_prefs_scale_new (subsection, _("Picture quality"), _("Frame rate"), VIDEO_CODECS_KEY 
"temporal_spatial_tradeoff", _("Choose if you want to guarantee a minimum image quality (possibly leading to 
dropped frames in order not to surpass the bitrate limit) or if you prefer to keep the frame rate"), 0.0, 
32.0, 1.0, 2);
 
-  gnome_prefs_spin_new (subsection, _("Maximum video _bitrate (in kbits/s):"), VIDEO_CODECS_KEY 
"maximum_video_tx_bitrate", _("The maximum video bitrate in kbits/s. The video quality and the effective 
frame rate will be dynamically adjusted to keep the bitrate at the given value."), 16.0, 10240.0, 1.0, 1, 
NULL, true);
+  gnome_prefs_spin_new (subsection, _("Maximum video _bitrate (in kbits/s):"), VIDEO_CODECS_KEY 
"maximum_video_tx_bitrate", _("The maximum video bitrate in kbits/s. The video quality and the effective 
frame rate will be dynamically adjusted to keep the bitrate at the given value."), 16.0, 10240.0, 1.0, 1, 1, 
NULL, true);
 }
 
 
diff --git a/lib/gui/gmpreferences.c b/lib/gui/gmpreferences.c
index 16ca471..62fe482 100644
--- a/lib/gui/gmpreferences.c
+++ b/lib/gui/gmpreferences.c
@@ -27,7 +27,7 @@
 
 
 /*
- *                         gnome_prefs_window.c  -  description 
+ *                         gnome_prefs_window.c  -  description
  *                         ------------------------------------
  *   begin                : Mon Oct 15 2003, but based on older code
  *   copyright            : (C) 2000-2006 by Damien Sandras
@@ -59,7 +59,7 @@ typedef struct _GnomePrefsWindow {
   GtkWidget *sections_tree_view;
   GtkTreeIter iter;
   int last_page;
-  
+
 } GnomePrefsWindow;
 
 static void
@@ -91,11 +91,11 @@ tree_selection_changed_cb (GtkTreeSelection *selection,
 
   if (!data)
     return;
-  
+
   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
 
     gpw = (GnomePrefsWindow *) data;
-    
+
     gtk_tree_model_get (GTK_TREE_MODEL (model),
                        &iter, 1, &page, -1);
 
@@ -111,48 +111,43 @@ tree_selection_changed_cb (GtkTreeSelection *selection,
 
 /* The public functions */
 GtkWidget *
-gnome_prefs_entry_new (GtkWidget *table,
+gnome_prefs_entry_new (GtkWidget* grid,
                       const gchar *label_txt,
                       const gchar *conf_key,
                       const gchar *tooltip,
                       int row,
+                      int width,
                       gboolean box)
 {
   GnomePrefsWindow *gpw = NULL;
-  GValue value = { 0, {{0}, {0}}};
-  int cols = 0;
   GtkWidget *entry = NULL;
   GtkWidget *label = NULL;
   GtkWidget *hbox = NULL;
-  
+
   gchar *conf_string = NULL;
   gboolean writable = FALSE;
 
   gpointer notifier;
-  
+
   writable = gm_conf_is_key_writable (conf_key);
-  
+
   if (box) {
-    
+
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-    g_value_init (&value, G_TYPE_INT);
-    g_object_get_property (G_OBJECT (table), "n-columns", &value);
-    cols = g_value_get_int (&value);
-    g_value_unset (&value);
   }
-  
+
   label = gtk_label_new_with_mnemonic (label_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
-  
+
   if (box)
     gtk_box_pack_start (GTK_BOX (hbox), label,
                        FALSE, FALSE, 1 * 2);
-  else
-    gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,
-                     (GtkAttachOptions) (GTK_FILL),
-                     (GtkAttachOptions) (GTK_FILL),
-                     0, 0);
+  else {
+
+    g_object_set (G_OBJECT (grid), "expand", TRUE, NULL);
+    gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
+  }
 
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
@@ -161,18 +156,14 @@ gnome_prefs_entry_new (GtkWidget *table,
   gtk_label_set_mnemonic_widget (GTK_LABEL(label), entry);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (entry), FALSE);
-  
+
   if (box)
     gtk_box_pack_start (GTK_BOX (hbox), entry,
                        FALSE, FALSE, 1 * 2);
   else
-    gtk_table_attach (GTK_TABLE (table), entry, 1, 2, row, row+1,
-                     (GtkAttachOptions) (NULL),
-                     (GtkAttachOptions) (NULL),
-                     0, 0);
-  
-  conf_string =
-    gm_conf_get_string (conf_key);
+    gtk_grid_attach (GTK_GRID (grid), entry, 1, row, 1, 1);
+
+  conf_string = gm_conf_get_string (conf_key);
 
   if (conf_string != NULL)
     gtk_entry_set_text (GTK_ENTRY (entry), conf_string);
@@ -189,79 +180,68 @@ gnome_prefs_entry_new (GtkWidget *table,
 
   notifier = gm_conf_notifier_add (conf_key, entry_changed_nt, (gpointer) entry);
 
-  g_object_weak_ref (G_OBJECT (entry), gobject_gm_conf_notifier_remove, notifier);
+  g_object_weak_ref (G_OBJECT (entry),
+                    gobject_gm_conf_notifier_remove, notifier);
 
   if (box)
-    gtk_table_attach (GTK_TABLE (table), hbox, 0, cols, row, row+1,
-                     (GtkAttachOptions) (NULL),
-                     (GtkAttachOptions) (NULL),
-                     0, 0);
+    gtk_grid_attach (GTK_GRID (grid), hbox, 0, row, width, 1);
 
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (entry, tooltip);
 
-  gtk_widget_show_all (table);
-  
+  gtk_widget_show_all (grid);
+
   return entry;
-}                                                                              
-                                                                               
-                                                                               
+}
+
 GtkWidget *
-gnome_prefs_toggle_new (GtkWidget *table,
+gnome_prefs_toggle_new (GtkWidget* grid,
                        const gchar *label_txt,
                        const gchar *conf_key,
                        const gchar *tooltip,
-                       int row)
+                       int row,
+                       int width)
 {
   GnomePrefsWindow *gpw = NULL;
-  GValue value = { 0, {{0}, {0}}};
   GtkWidget *toggle = NULL;
   gboolean writable = FALSE;
-  int cols = 0;
   gpointer notifier;
-  
+
   writable = gm_conf_is_key_writable (conf_key);
-  
-  g_value_init (&value, G_TYPE_INT);
-  g_object_get_property (G_OBJECT (table), "n-columns", &value);
-  cols = g_value_get_int (&value);
-  g_value_unset (&value);
-  
+
   toggle = gtk_check_button_new_with_mnemonic (label_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (toggle), FALSE);
-  
-  gtk_table_attach (GTK_TABLE (table), toggle, 0, cols, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
-                                                                               
+
+  g_object_set (G_OBJECT (toggle), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), toggle, 0, row, width, 1);
+
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
                                gm_conf_get_bool (conf_key));
 
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (toggle, tooltip);
 
   g_signal_connect (toggle, "toggled",
                    G_CALLBACK (toggle_changed), (gpointer) conf_key);
-  
+
   notifier = gm_conf_notifier_add (conf_key, toggle_changed_nt, (gpointer) toggle);
 
   g_object_weak_ref (G_OBJECT (toggle), gobject_gm_conf_notifier_remove, notifier);
 
-  gtk_widget_show_all (table);
-  
+  gtk_widget_show_all (grid);
+
   return toggle;
-}                                                                              
+}
 
 
 GtkWidget *
-gnome_prefs_scale_new (GtkWidget *table,       
+gnome_prefs_scale_new (GtkWidget* grid,
                       const gchar *down_label_txt,
                       const gchar *up_label_txt,
-                      const gchar *conf_key,       
+                      const gchar *conf_key,
                       const gchar *tooltip,
                       double min,
                       double max,
@@ -286,11 +266,11 @@ gnome_prefs_scale_new (GtkWidget *table,
 
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                      1 * 2);
-  
+
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
-  adj = (GtkAdjustment *) 
+  adj = (GtkAdjustment *)
     gtk_adjustment_new (gm_conf_get_int (conf_key),
                        min, max, step,
                        2.0, 1.0);
@@ -312,12 +292,10 @@ gnome_prefs_scale_new (GtkWidget *table,
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                      1 * 2);
 
-  gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, row, row+1,
-                   (GtkAttachOptions) (GTK_FILL),
-                   (GtkAttachOptions) (GTK_FILL),
-                   0, 0);
+  g_object_set (G_OBJECT (hbox), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), hbox, 0, row, 1, 1);
 
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (hscale, tooltip);
 
@@ -329,21 +307,22 @@ gnome_prefs_scale_new (GtkWidget *table,
                                   (gpointer) adj);
   g_object_weak_ref (G_OBJECT (adj), gobject_gm_conf_notifier_remove, notifier);
 
-  gtk_widget_show_all (table);
+  gtk_widget_show_all (grid);
 
   return hscale;
 }
 
 
 GtkWidget *
-gnome_prefs_spin_new (GtkWidget *table,       
+gnome_prefs_spin_new (GtkWidget* grid,
                      const gchar *label_txt,
-                     const gchar *conf_key,       
+                     const gchar *conf_key,
                      const gchar *tooltip,
                      double min,
                      double max,
                      double step,
                      int row,
+                     int width,
                      const gchar *label_txt2,
                      gboolean box)
 {
@@ -354,69 +333,64 @@ gnome_prefs_spin_new (GtkWidget *table,
   GtkWidget *spin_button = NULL;
   gpointer notifier;
   gboolean writable = FALSE;
-  
+
   writable = gm_conf_is_key_writable (conf_key);
 
-  
+
   if (box)
     hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  
+
   label = gtk_label_new_with_mnemonic (label_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
-  
+
   if (box)
     gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                        1 * 2);
-  else
-    gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,
-                     (GtkAttachOptions) (GTK_FILL),
-                     (GtkAttachOptions) (GTK_FILL),
-                     0, 0);
+  else {
+
+    g_object_set (G_OBJECT (label), "expand", TRUE, NULL);
+    gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
+  }
 
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-  
-  adj = (GtkAdjustment *) 
+
+  adj = (GtkAdjustment *)
     gtk_adjustment_new (gm_conf_get_int (conf_key),
                        min, max, step,
                        10.0, 0.0);
-  
+
   spin_button = gtk_spin_button_new (adj, 1.0, 0);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (spin_button), FALSE);
-  
+
   if (box)
     gtk_box_pack_start (GTK_BOX (hbox), spin_button, FALSE, FALSE,
                        1 * 2);
-  else
-    gtk_table_attach (GTK_TABLE (table), spin_button, 1, 2, row, row+1,
-                     (GtkAttachOptions) (GTK_FILL),
-                     (GtkAttachOptions) (GTK_FILL),
-                     0, 0);
+  else {
+
+    g_object_set (G_OBJECT (spin_button), "expand", TRUE, NULL);
+    gtk_grid_attach (GTK_GRID (grid), spin_button, 1, row, 1, 1);
+  }
 
   if (box && label_txt2) {
-    
+
     label = gtk_label_new_with_mnemonic (label_txt2);
     if (!writable)
       gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
-    
+
     gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                        1 * 2);
   }
 
   if (box) {
-   
-    guint ncols;
-    g_object_get (G_OBJECT (table), "n-columns", &ncols, NULL);
-    gtk_table_attach (GTK_TABLE (table), hbox, 
-                     0, ncols, row, row+1,
-                     (GtkAttachOptions) (GTK_FILL),
-                     (GtkAttachOptions) (GTK_FILL),
-                     0, 0);
+
+    g_object_set (G_OBJECT (hbox), "expand", TRUE, NULL);
+    gtk_grid_attach (GTK_GRID (grid), hbox, 0, row, width, 1);
   }
 
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (spin_button, tooltip);
 
@@ -428,14 +402,14 @@ gnome_prefs_spin_new (GtkWidget *table,
                                   (gpointer) adj);
   g_object_weak_ref (G_OBJECT (adj), gobject_gm_conf_notifier_remove, notifier);
 
-  gtk_widget_show_all (table);
-  
+  gtk_widget_show_all (grid);
+
   return spin_button;
 }
 
 
 void
-gnome_prefs_range_new (GtkWidget *table,
+gnome_prefs_range_new (GtkWidget* grid,
                       const gchar *label1_txt,
                       GtkWidget **spin1,
                       const gchar *label2_txt,
@@ -467,16 +441,16 @@ gnome_prefs_range_new (GtkWidget *table,
     (gm_conf_is_key_writable (spin1_conf_key)
      &&
      gm_conf_is_key_writable (spin2_conf_key));
-  
+
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   label = gtk_label_new_with_mnemonic (label1_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                      1 * 2);
-  
+
   val1 = gm_conf_get_int (spin1_conf_key);
-  adj1 = (GtkAdjustment *) 
+  adj1 = (GtkAdjustment *)
     gtk_adjustment_new (val1, spin1_min, spin1_max, spins_step, 2.0, 1.0);
   spin_button1 = gtk_spin_button_new (adj1, 1.0, 0);
   if (!writable)
@@ -491,31 +465,28 @@ gnome_prefs_range_new (GtkWidget *table,
                      1 * 2);
 
   val2 = gm_conf_get_int (spin2_conf_key);
-  adj2 = (GtkAdjustment *) 
+  adj2 = (GtkAdjustment *)
     gtk_adjustment_new (val2, spin2_min, spin2_max, spins_step, 2.0, 1.0);
   spin_button2 = gtk_spin_button_new (adj2, 1.0, 0);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (spin_button2), FALSE);
   gtk_box_pack_start (GTK_BOX (hbox), spin_button2, FALSE, FALSE,
                      1 * 2);
-  
+
   label = gtk_label_new_with_mnemonic (label3_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE,
                      1 * 2);
 
-  gtk_table_attach (GTK_TABLE (table), hbox, 0, 1, row, row+1,
-                    (GtkAttachOptions) (NULL),
-                   (GtkAttachOptions) (NULL),
-                   0, 0);
+  gtk_grid_attach (GTK_GRID (grid), hbox, 0, row, 1, 1);
 
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && spin1_tooltip && spin2_tooltip) {
     gtk_widget_set_tooltip_text (spin_button1, spin1_tooltip);
     gtk_widget_set_tooltip_text (spin_button2, spin2_tooltip);
   }
-  
+
 
   g_signal_connect (adj1, "value-changed",
                    G_CALLBACK (adjustment_changed),
@@ -523,7 +494,7 @@ gnome_prefs_range_new (GtkWidget *table,
   notifier = gm_conf_notifier_add (spin1_conf_key, adjustment_changed_nt,
                                   (gpointer) adj1);
   g_object_weak_ref (G_OBJECT (adj1), gobject_gm_conf_notifier_remove, notifier);
- 
+
   g_signal_connect (adj2, "value-changed",
                    G_CALLBACK (adjustment_changed),
                    (gpointer) spin2_conf_key);
@@ -536,11 +507,11 @@ gnome_prefs_range_new (GtkWidget *table,
 
   if (spin2)
     *spin2 = spin_button2;
-}                                                                              
+}
 
 
 GtkWidget *
-gnome_prefs_int_option_menu_new (GtkWidget *table,
+gnome_prefs_int_option_menu_new (GtkWidget* grid,
                                 const gchar *label_txt,
                                 const gchar **options,
                                 const gchar *conf_key,
@@ -548,14 +519,14 @@ gnome_prefs_int_option_menu_new (GtkWidget *table,
                                 int row)
 {
   GnomePrefsWindow *gpw = NULL;
-  
-  GtkWidget *label = NULL;                                                     
+
+  GtkWidget *label = NULL;
   GtkWidget *option_menu = NULL;
-  
+
   GtkListStore *list_store = NULL;
   GtkCellRenderer *renderer = NULL;
   GtkTreeIter iter;
-  
+
   gboolean writable = FALSE;
 
   int history = -1;
@@ -568,13 +539,11 @@ gnome_prefs_int_option_menu_new (GtkWidget *table,
   label = gtk_label_new_with_mnemonic (label_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
-  
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,                
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
-                                                                               
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);                         
+
+  g_object_set (G_OBJECT (label), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
+
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
   list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
@@ -586,9 +555,9 @@ gnome_prefs_int_option_menu_new (GtkWidget *table,
   gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (option_menu), renderer,
                                   "text", COLUMN_STRING_TRANSLATED,
                                   NULL);
-  g_object_set (G_OBJECT (renderer), 
-                "ellipsize-set", TRUE, 
-                "ellipsize", PANGO_ELLIPSIZE_END, 
+  g_object_set (G_OBJECT (renderer),
+                "ellipsize-set", TRUE,
+                "ellipsize", PANGO_ELLIPSIZE_END,
                 "width-chars", 65, NULL);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), option_menu);
 
@@ -604,46 +573,44 @@ gnome_prefs_int_option_menu_new (GtkWidget *table,
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), history);
-  gtk_table_attach (GTK_TABLE (table), option_menu, 1, 2, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),                
-                    (GtkAttachOptions) (GTK_FILL),                
-                    0, 0);           
-                                                                               
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  g_object_set (G_OBJECT (option_menu), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), option_menu, 1, row, 1, 1);
+
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (option_menu, tooltip);
 
   g_signal_connect (option_menu, "changed",
                    G_CALLBACK (int_option_menu_changed),
-                   (gpointer) conf_key);                                   
+                   (gpointer) conf_key);
   notifier = gm_conf_notifier_add (conf_key, int_option_menu_changed_nt,
                                   (gpointer) option_menu);
   g_object_weak_ref (G_OBJECT (option_menu), gobject_gm_conf_notifier_remove, notifier);
 
-  gtk_widget_show_all (table);
-  
+  gtk_widget_show_all (grid);
+
   return option_menu;
 }
 
 
 GtkWidget *
-gnome_prefs_string_option_menu_new (GtkWidget *table,       
-                                   const gchar *label_txt, 
+gnome_prefs_string_option_menu_new (GtkWidget* grid,
+                                   const gchar *label_txt,
                                    const gchar **options,
-                                   const gchar *conf_key,       
-                                   const gchar *tooltip,         
+                                   const gchar *conf_key,
+                                   const gchar *tooltip,
                                    int row,
                                     const gchar *default_value)
 {
   GnomePrefsWindow *gpw = NULL;
-  
-  GtkWidget *label = NULL;                                                     
+
+  GtkWidget *label = NULL;
   GtkWidget *option_menu = NULL;
-  
+
   GtkListStore *list_store = NULL;
   GtkCellRenderer *renderer = NULL;
   GtkTreeIter iter;
-  
+
   gchar *conf_string = NULL;
   gboolean writable = FALSE;
 
@@ -654,21 +621,19 @@ gnome_prefs_string_option_menu_new (GtkWidget *table,
 
   writable = gm_conf_is_key_writable (conf_key);
 
-  label = gtk_label_new (label_txt);                                           
+  label = gtk_label_new (label_txt);
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
-  
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,                
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
-                                                                               
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);                         
+
+  g_object_set (G_OBJECT (label), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
+
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
-  list_store = gtk_list_store_new (3, 
-                                   G_TYPE_STRING, 
-                                   G_TYPE_STRING, 
+  list_store = gtk_list_store_new (3,
+                                   G_TYPE_STRING,
+                                   G_TYPE_STRING,
                                    G_TYPE_BOOLEAN);
   option_menu = gtk_combo_box_new_with_model (GTK_TREE_MODEL (list_store));
   if (!writable)
@@ -679,9 +644,9 @@ gnome_prefs_string_option_menu_new (GtkWidget *table,
                                   "text", COLUMN_STRING_TRANSLATED,
                                   "sensitive", COLUMN_SENSITIVE,
                                   NULL);
-  g_object_set (G_OBJECT (renderer), 
-                "ellipsize-set", TRUE, 
-                "ellipsize", PANGO_ELLIPSIZE_END, 
+  g_object_set (G_OBJECT (renderer),
+                "ellipsize-set", TRUE,
+                "ellipsize", PANGO_ELLIPSIZE_END,
                 "width-chars", 65, NULL);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), option_menu);
 
@@ -710,7 +675,7 @@ gnome_prefs_string_option_menu_new (GtkWidget *table,
       gtk_list_store_set (GTK_LIST_STORE (list_store), &iter,
                           COLUMN_STRING_RAW, conf_string,
                           COLUMN_STRING_TRANSLATED, gettext (conf_string),
-                          COLUMN_SENSITIVE, FALSE, 
+                          COLUMN_SENSITIVE, FALSE,
                           -1);
       history = cpt;
     }
@@ -719,26 +684,24 @@ gnome_prefs_string_option_menu_new (GtkWidget *table,
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), history);
-  gtk_table_attach (GTK_TABLE (table), option_menu, 1, 2, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),                
-                    (GtkAttachOptions) (GTK_FILL),                
-                    0, 0);           
-                                                                               
-  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (table), "gpw");
+  g_object_set (G_OBJECT (option_menu), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), option_menu, 1, row, 1, 1);
+
+  gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (grid), "gpw");
   if (gpw && tooltip)
     gtk_widget_set_tooltip_text (option_menu, tooltip);
 
   g_signal_connect (option_menu, "changed",
                    G_CALLBACK (string_option_menu_changed),
-                   (gpointer) conf_key);                                   
+                   (gpointer) conf_key);
   notifier = gm_conf_notifier_add (conf_key, string_option_menu_changed_nt,
                                   (gpointer) option_menu);
   g_object_weak_ref (G_OBJECT (option_menu), gobject_gm_conf_notifier_remove, notifier);
 
-  g_free (conf_string); 
+  g_free (conf_string);
+
+  gtk_widget_show_all (grid);
 
-  gtk_widget_show_all (table);
-  
   return option_menu;
 }
 
@@ -753,13 +716,13 @@ gnome_prefs_string_option_menu_update (GtkWidget *option_menu,
   GtkTreeIter iter;
 
   gchar *conf_string = NULL;
-  
+
   int history = -1;
   int cpt = 0;
 
   if (!options || !conf_key)
     return;
-  
+
   conf_string = gm_conf_get_string (conf_key);
   if (conf_string == NULL)
     conf_string = g_strdup (default_value);
@@ -771,27 +734,27 @@ gnome_prefs_string_option_menu_update (GtkWidget *option_menu,
   cpt = 0;
   while (options [cpt]) {
 
-    if (conf_string && !g_strcmp0 (options [cpt], conf_string)) 
+    if (conf_string && !g_strcmp0 (options [cpt], conf_string))
       history = cpt;
 
     gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-    gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
+    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                         COLUMN_STRING_RAW, options [cpt],
                         COLUMN_STRING_TRANSLATED, options [cpt],
-                        COLUMN_SENSITIVE, TRUE, 
+                        COLUMN_SENSITIVE, TRUE,
                         -1);
     cpt++;
   }
 
   if (history == -1) {
-    
+
     if (conf_string && g_strcmp0 (conf_string, "")) {
 
       gtk_list_store_append (GTK_LIST_STORE (model), &iter);
       gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                           COLUMN_STRING_RAW, conf_string,
                           COLUMN_STRING_TRANSLATED, gettext (conf_string),
-                          COLUMN_SENSITIVE, FALSE, 
+                          COLUMN_SENSITIVE, FALSE,
                           -1);
       history = cpt;
     }
@@ -800,8 +763,8 @@ gnome_prefs_string_option_menu_update (GtkWidget *option_menu,
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), history);
-  
-  g_free (conf_string); 
+
+  g_free (conf_string);
 }
 
 
@@ -827,7 +790,7 @@ gnome_prefs_string_option_menu_add (GtkWidget *option_menu,
       gtk_tree_model_get_value (GTK_TREE_MODEL (model), &iter, 0, &value);
       value_string = (gchar *) g_value_get_string (&value);
       if (g_ascii_strcasecmp  (value_string, option) == 0) {
-        gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
+        gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                             COLUMN_SENSITIVE, TRUE,
                             -1);
         g_value_unset(&value);
@@ -841,9 +804,9 @@ gnome_prefs_string_option_menu_add (GtkWidget *option_menu,
 
   if (!found) {
     gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-    gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
+    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                         COLUMN_STRING_RAW, option,
-                        COLUMN_STRING_TRANSLATED, option, 
+                        COLUMN_STRING_TRANSLATED, option,
                         COLUMN_SENSITIVE, TRUE,
                         -1);
   }
@@ -879,7 +842,7 @@ gnome_prefs_string_option_menu_remove (GtkWidget *option_menu,
       if (g_ascii_strcasecmp  (value_string, option) == 0) {
 
         if (cpt == active) {
-          gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
+          gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                               COLUMN_SENSITIVE, FALSE,
                               -1);
         }
@@ -899,28 +862,28 @@ gnome_prefs_string_option_menu_remove (GtkWidget *option_menu,
 GtkWidget *
 gnome_prefs_subsection_new (GtkWidget *window,
                            GtkWidget *container,
-                           const gchar *frame_name,       
-                           int rows,
-                           int cols)      
+                           const gchar *frame_name,
+                           G_GNUC_UNUSED int rows,
+                           G_GNUC_UNUSED int cols)
 {
   GnomePrefsWindow *gpw  = NULL;
-  
+
   GtkWidget *hbox = NULL;
   GtkWidget *frame = NULL;
-  GtkWidget *table = NULL;
+  GtkWidget* grid = NULL;
   GtkWidget *label = NULL;
-  
+
   PangoAttrList *attrs = NULL;
   PangoAttribute *attr = NULL;
 
   if (window)
     gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (window), "gpw");
-  
+
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
   frame = gtk_frame_new (frame_name);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
-  
+
   attrs = pango_attr_list_new ();
   attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
   attr->start_index = 0;
@@ -933,34 +896,34 @@ gnome_prefs_subsection_new (GtkWidget *window,
 
   gtk_box_pack_start (GTK_BOX (container), frame,
                       FALSE, FALSE, 0);
-  table = gtk_table_new (rows, cols, FALSE);                                   
-                                                                              
-  gtk_container_add (GTK_CONTAINER (frame), hbox); 
+  grid = gtk_grid_new ();
+
+  gtk_container_add (GTK_CONTAINER (frame), hbox);
 
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 3);
   gtk_container_set_border_width (GTK_CONTAINER (frame), 6);
 
   label = gtk_label_new ("    ");
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0);
-                                                                               
-  gtk_table_set_row_spacings (GTK_TABLE (table), 2);     
-  gtk_table_set_col_spacings (GTK_TABLE (table), 6);     
+  gtk_box_pack_start (GTK_BOX (hbox), grid, FALSE, FALSE, 0);
+
+  gtk_grid_set_row_spacing (GTK_GRID (grid), 2);
+  gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
 
   if (gpw)
-    g_object_set_data (G_OBJECT (table), "gpw", gpw);
+    g_object_set_data (G_OBJECT (grid), "gpw", gpw);
+
+  gtk_widget_show_all (grid);
 
-  gtk_widget_show_all (table);
-  
-  return table;
-}                                                                              
+  return grid;
+}
 
 
 GtkWidget *
 gnome_prefs_window_new (const gchar *logo_name)
 {
   GnomePrefsWindow *gpw = NULL;
-  
+
   GtkTreeSelection *selection = NULL;
   GtkCellRenderer *cell = NULL;
   GtkTreeStore *model = NULL;
@@ -1045,18 +1008,18 @@ gnome_prefs_window_new (const gchar *logo_name)
   gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
                               GTK_SELECTION_BROWSE);
 
-  
+
   /* Some design stuff to put the notebook pages in it */
   frame = gtk_frame_new (NULL);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
   gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
   gtk_widget_show (frame);
-  
+
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
   gtk_container_add (GTK_CONTAINER (frame), vbox);
   gtk_widget_show (vbox);
-  
-  
+
+
   gpw->section_label = gtk_label_new (NULL);
   frame = gtk_frame_new (NULL);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
@@ -1067,8 +1030,8 @@ gnome_prefs_window_new (const gchar *logo_name)
   attrs = pango_attr_list_new ();
   attr = pango_attr_scale_new (PANGO_SCALE_LARGE);
   attr->start_index = 0;
-  attr->end_index = G_MAXUINT; 
-  pango_attr_list_insert (attrs, attr); 
+  attr->end_index = G_MAXUINT;
+  pango_attr_list_insert (attrs, attr);
   attr = pango_attr_weight_new (PANGO_WEIGHT_HEAVY);
   attr->start_index = 0;
   attr->end_index = G_MAXUINT;
@@ -1078,7 +1041,7 @@ gnome_prefs_window_new (const gchar *logo_name)
   gtk_widget_show (gpw->section_label);
 
   hsep = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-  gtk_box_pack_start (GTK_BOX (vbox), hsep, FALSE, FALSE, 0); 
+  gtk_box_pack_start (GTK_BOX (vbox), hsep, FALSE, FALSE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), gpw->notebook, TRUE, TRUE, 0);
 
   gtk_widget_show_all (GTK_WIDGET (dialog_vbox));
@@ -1088,7 +1051,7 @@ gnome_prefs_window_new (const gchar *logo_name)
                    G_CALLBACK (tree_selection_changed_cb),
                    gpw);
 
-  
+
   return window;
 }
 
@@ -1099,7 +1062,7 @@ gnome_prefs_window_section_new (GtkWidget *window,
 {
   GnomePrefsWindow *gpw = NULL;
   GtkTreeModel *model = NULL;
-    
+
   if (!window)
     return;
 
@@ -1125,10 +1088,10 @@ gnome_prefs_window_subsection_new (GtkWidget *window,
   GtkWidget *container = NULL;
   GtkTreeModel *model = NULL;
   GtkTreeIter child_iter;
-    
+
   if (!window)
     return NULL;
-  
+
   gpw = (GnomePrefsWindow *) g_object_get_data (G_OBJECT (window), "gpw");
 
   if (!gpw || !section_name)
@@ -1140,13 +1103,13 @@ gnome_prefs_window_subsection_new (GtkWidget *window,
   gtk_tree_store_set (GTK_TREE_STORE (model), &child_iter, 0, section_name,
                      1, gpw->last_page, -1);
   gtk_tree_view_expand_all (GTK_TREE_VIEW (gpw->sections_tree_view));
-  
+
   gpw->last_page++;
-  
+
   gtk_notebook_append_page (GTK_NOTEBOOK (gpw->notebook),
                            container, NULL);
 
   gtk_widget_show_all (container);
-  
+
   return container;
 }
diff --git a/lib/gui/gmpreferences.h b/lib/gui/gmpreferences.h
index 4324f91..70a6be6 100644
--- a/lib/gui/gmpreferences.h
+++ b/lib/gui/gmpreferences.h
@@ -27,7 +27,7 @@
 
 
 /*
- *                         gnome_prefs_window.c  -  description 
+ *                         gnome_prefs_window.c  -  description
  *                         ------------------------------------
  *   begin                : Mon Oct 15 2003, but based on older code
  *   copyright            : (C) 2000-2006 by Damien Sandras
@@ -40,7 +40,7 @@
 G_BEGIN_DECLS
 
 
-/* Common notice 
+/* Common notice
  *
  * The created widgets are associated to a config key. They have the value
  * of the config key as initial value and they get updated when the config
@@ -58,7 +58,7 @@ G_BEGIN_DECLS
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkEntry associated with a config key and returns
  *                 the result.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkEntry should be attached. The other parameters are
  *                 the text label, the config key, the tooltip, the row where
  *                 to attach it in the section, and if the label and GtkEntry
@@ -66,80 +66,83 @@ G_BEGIN_DECLS
  *                 section they belong to.
  * PRE          :  /
  */
-GtkWidget *gnome_prefs_entry_new (GtkWidget *,
-                                 const gchar *,
-                                 const gchar *,
-                                 const gchar *,
-                                 int,
-                                 gboolean);
+GtkWidget *gnome_prefs_entry_new (GtkWidget* grid,
+                                 const gchar* label_text,
+                                 const gchar* conf_key,
+                                 const gchar* tooltip,
+                                 int row,
+                                 int width,
+                                 gboolean box);
 
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkToggleButton associated with a config key and
  *                 returns the result.
- *                 The first parameter is the section in which the 
+ *                 The first parameter is the section in which the
  *                 GtkToggleButton should be attached. The other parameters are
  *                 the text label, the config key, the tooltip, the row where
  *                 to attach it in the section.
  * PRE          :  /
  */
-GtkWidget *gnome_prefs_toggle_new (GtkWidget *,
-                                  const gchar *,
-                                  const gchar *, 
-                                  const gchar *,
-                                  int);
+GtkWidget *gnome_prefs_toggle_new (GtkWidget* grid,
+                                  const gchar* label_text,
+                                  const gchar* conf_key,
+                                  const gchar* tooltip,
+                                  int row,
+                                  int width);
 
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkHScale associated with a config key and
  *                 returns the result.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkHScale should be attached. The other parameters
  *                 are the text labels, the config key, the tooltip, the
  *                 minimal and maximal values, the incrementation step,
  *                 the row where to attach it in the section.
  * PRE          :  /
  */
-GtkWidget *gnome_prefs_scale_new (GtkWidget *,       
-                                 const gchar *,
-                                 const gchar *,
-                                 const gchar *,       
-                                 const gchar *,
-                                 double,
-                                 double,
-                                 double,
-                                 int);
+GtkWidget *gnome_prefs_scale_new (GtkWidget* grid,
+                                 const gchar* down_label_txt,
+                                 const gchar* up_label_txt,
+                                 const gchar* conf_key,
+                                 const gchar* tooltip,
+                                 double min,
+                                 double max,
+                                 double step,
+                                 int row);
 
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkSpinButton associated with a config key and
  *                 returns the result.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkSpinButton should be attached. The other parameters
  *                 are the text label, the config key, the tooltip, the
  *                 minimal and maximal values, the incrementation step,
- *                 the row where to attach it in the section, 
+ *                 the row where to attach it in the section,
  *                 the rest of the label, if any, and if the label and widget
  *                 should be packed together or aligned with others in the
- *                 section they belong to. 
+ *                 section they belong to.
  * PRE          :  The gboolean must be TRUE if the rest of the label is given.
  */
-GtkWidget *gnome_prefs_spin_new (GtkWidget *,
-                                const gchar *,
-                                const gchar *,
-                                const gchar *,
-                                double,
-                                double,
-                                double,
-                                int,
-                                const gchar *,
-                                gboolean);
+GtkWidget *gnome_prefs_spin_new (GtkWidget* grid,
+                                const gchar* label_text,
+                                const gchar* conf_key,
+                                const gchar* tooltip,
+                                double min,
+                                double max,
+                                double step,
+                                int row,
+                                int width,
+                                const gchar* label_text2,
+                                gboolean box);
 
 
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a range with 2 GtkSpinButtons associated with two
  *                 config keys.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkSpinButton should be attached. The other parameters
  *                 are the first part of the label, a pointer that will be
  *                 updated to point to the first GtkSpinButton, the second
@@ -171,7 +174,7 @@ void gnome_prefs_range_new (GtkWidget *,
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkOptionMenu associated with an integer config
  *                 key and returns the result.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkEntry should be attached. The other parameters are
  *                 the text label, the possible values for the menu, the config
  *                 key, the tooltip, the row where to attach it in the section.
@@ -179,7 +182,7 @@ void gnome_prefs_range_new (GtkWidget *,
  */
 GtkWidget *gnome_prefs_int_option_menu_new (GtkWidget *,
                                            const gchar *,
-                                           const gchar **, 
+                                           const gchar **,
                                            const gchar *,
                                            const gchar *,
                                            int);
@@ -188,12 +191,12 @@ GtkWidget *gnome_prefs_int_option_menu_new (GtkWidget *,
 /* DESCRIPTION  :  /
  * BEHAVIOR     :  Creates a GtkOptionMenu associated with a string config
  *                 key and returns the result.
- *                 The first parameter is the section in which 
+ *                 The first parameter is the section in which
  *                 the GtkEntry should be attached. The other parameters are
  *                 the text label, the possible values for the menu, the config
  *                 key, the tooltip, the row where to attach it in the section and
  *                 the default value if the conf key is associated to a NULL value.
- * PRE          :  The array ends with NULL. 
+ * PRE          :  The array ends with NULL.
  */
 GtkWidget *gnome_prefs_string_option_menu_new (GtkWidget *,
                                               const gchar *,
@@ -209,7 +212,7 @@ GtkWidget *gnome_prefs_string_option_menu_new (GtkWidget *,
  *                 a string config key. The first parameter is the menu,
  *                 the second is the array of possible values, and the
  *                 last one is the config key and the default value if the
- *                 conf key is associated to a NULL value. 
+ *                 conf key is associated to a NULL value.
  * PRE          :  The array ends with NULL.
  */
 void gnome_prefs_string_option_menu_update (GtkWidget *,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]