[epiphany] prefs-dialog: Port the Sync prefs page to list boxes



commit 6a4ba580b9dc0c23eb60d7919669489623799968
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue Dec 18 10:15:02 2018 +0100

    prefs-dialog: Port the Sync prefs page to list boxes

 src/prefs-dialog.c                | 175 ++++++++----------
 src/resources/gtk/prefs-dialog.ui | 374 ++++++++++++--------------------------
 2 files changed, 199 insertions(+), 350 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 5cd58da3c..03a554b2f 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -139,25 +139,20 @@ struct _PrefsDialog {
   GtkWidget *sync_firefox_iframe_box;
   GtkWidget *sync_firefox_iframe_label;
   GtkWidget *sync_firefox_account_box;
-  GtkWidget *sync_firefox_account_label;
+  GtkWidget *sync_firefox_account_row;
   GtkWidget *sync_sign_out_button;
   GtkWidget *sync_options_box;
   GtkWidget *sync_bookmarks_checkbutton;
   GtkWidget *sync_passwords_checkbutton;
   GtkWidget *sync_history_checkbutton;
   GtkWidget *sync_open_tabs_checkbutton;
-  GtkWidget *sync_frequency_5_min_radiobutton;
-  GtkWidget *sync_frequency_15_min_radiobutton;
-  GtkWidget *sync_frequency_30_min_radiobutton;
-  GtkWidget *sync_frequency_60_min_radiobutton;
+  GtkWidget *sync_frequency_row;
   GtkWidget *sync_now_button;
   GtkWidget *synced_tabs_button;
   GtkWidget *sync_device_name_entry;
   GtkWidget *sync_device_name_change_button;
   GtkWidget *sync_device_name_save_button;
   GtkWidget *sync_device_name_cancel_button;
-  GtkWidget *sync_last_sync_time_box;
-  GtkWidget *sync_last_sync_time_label;
 
   WebKitWebView *fxa_web_view;
   WebKitUserContentManager *fxa_manager;
@@ -172,6 +167,8 @@ enum {
 
 G_DEFINE_TYPE (PrefsDialog, prefs_dialog, GTK_TYPE_DIALOG)
 
+static const guint sync_frequency_minutes[] = { 5, 15, 30, 60 };
+
 static void
 prefs_dialog_finalize (GObject *object)
 {
@@ -240,8 +237,7 @@ sync_set_last_sync_time (PrefsDialog *dialog)
      */
     char *text = g_strdup_printf (_("Last synchronized: %s"), time);
 
-    gtk_label_set_text (GTK_LABEL (dialog->sync_last_sync_time_label), text);
-    gtk_widget_set_visible (dialog->sync_last_sync_time_box, TRUE);
+    hdy_action_row_set_subtitle (HDY_ACTION_ROW (dialog->sync_firefox_account_row), text);
 
     g_free (text);
     g_free (time);
@@ -296,23 +292,11 @@ sync_secrets_store_finished_cb (EphySyncService *service,
   g_assert (EPHY_IS_PREFS_DIALOG (dialog));
 
   if (!error) {
-    /* Show sync options panel. */
-    char *user = g_strdup_printf ("<b>%s</b>", ephy_sync_utils_get_sync_user ());
-    /* Translators: the %s refers to the email of the currently logged in user. */
-    char *text = g_strdup_printf (_("Logged in as %s"), user);
-
-    gtk_label_set_markup (GTK_LABEL (dialog->sync_firefox_account_label), text);
-    gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                          dialog->sync_firefox_iframe_box);
-    gtk_box_pack_start (GTK_BOX (dialog->sync_page_box),
-                        dialog->sync_firefox_account_box,
-                        FALSE, FALSE, 0);
-    gtk_box_pack_start (GTK_BOX (dialog->sync_page_box),
-                        dialog->sync_options_box,
-                        FALSE, FALSE, 0);
-
-    g_free (text);
-    g_free (user);
+    hdy_action_row_set_title (HDY_ACTION_ROW (dialog->sync_firefox_account_row),
+                              ephy_sync_utils_get_sync_user ());
+    gtk_widget_hide (dialog->sync_page_box);
+    gtk_widget_show (dialog->sync_firefox_account_box);
+    gtk_widget_show (dialog->sync_options_box);
   } else {
     /* Display the error message and reload the iframe. */
     sync_sign_in_details_show (dialog, error->message);
@@ -577,6 +561,7 @@ sync_setup_firefox_iframe (PrefsDialog *dialog)
   WebKitWebsiteDataManager *manager;
   WebKitWebContext *embed_context;
   WebKitWebContext *sync_context;
+  GtkWidget *frame;
   const char *script;
 
   if (!dialog->fxa_web_view) {
@@ -626,12 +611,16 @@ sync_setup_firefox_iframe (PrefsDialog *dialog)
                                                           "user-content-manager", dialog->fxa_manager,
                                                           "settings", ephy_embed_prefs_get_settings (),
                                                           "web-context", sync_context,
+                                                          "height-request", 450,
                                                           NULL));
     gtk_widget_set_visible (GTK_WIDGET (dialog->fxa_web_view), TRUE);
-    gtk_widget_set_size_request (GTK_WIDGET (dialog->fxa_web_view), 450, 450);
+    frame = gtk_frame_new (NULL);
+    gtk_widget_set_visible (frame, TRUE);
+    gtk_container_add (GTK_CONTAINER (frame),
+                       GTK_WIDGET (dialog->fxa_web_view));
     gtk_box_pack_start (GTK_BOX (dialog->sync_firefox_iframe_box),
-                      GTK_WIDGET (dialog->fxa_web_view),
-                      FALSE, FALSE, 0);
+                        frame,
+                        FALSE, FALSE, 0);
 
     g_object_unref (sync_context);
   }
@@ -650,14 +639,10 @@ on_sync_sign_out_button_clicked (GtkWidget   *button,
 
   /* Show Firefox Accounts iframe. */
   sync_setup_firefox_iframe (dialog);
-  gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                        dialog->sync_firefox_account_box);
-  gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                        dialog->sync_options_box);
-  gtk_box_pack_start (GTK_BOX (dialog->sync_page_box),
-                      dialog->sync_firefox_iframe_box,
-                      FALSE, FALSE, 0);
-  gtk_widget_set_visible (dialog->sync_last_sync_time_box, FALSE);
+  gtk_widget_hide (dialog->sync_firefox_account_box);
+  gtk_widget_hide (dialog->sync_options_box);
+  gtk_widget_show (dialog->sync_page_box);
+  hdy_action_row_set_subtitle (HDY_ACTION_ROW (dialog->sync_firefox_account_row), NULL);
 }
 
 static void
@@ -998,8 +983,6 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, start_in_incognito_mode_switch);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_folder_row);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, download_box);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, ask_on_download_switch);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, start_in_incognito_mode_switch);
 
   /* fonts & style */
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, use_gnome_fonts_row);
@@ -1035,25 +1018,20 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_firefox_iframe_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_firefox_iframe_label);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_firefox_account_box);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_firefox_account_label);
+  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_firefox_account_row);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_sign_out_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_options_box);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_bookmarks_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_passwords_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_history_checkbutton);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_open_tabs_checkbutton);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_frequency_5_min_radiobutton);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_frequency_15_min_radiobutton);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_frequency_30_min_radiobutton);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_frequency_60_min_radiobutton);
+  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_frequency_row);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_now_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, synced_tabs_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_device_name_entry);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_device_name_change_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_device_name_save_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_device_name_cancel_button);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_last_sync_time_box);
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, sync_last_sync_time_label);
 
   gtk_widget_class_bind_template_callback (widget_class, on_webapp_icon_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, on_webapp_entry_changed);
@@ -1728,10 +1706,18 @@ sync_frequency_get_mapping (GValue   *value,
                             GVariant *variant,
                             gpointer  user_data)
 {
-  if (GPOINTER_TO_UINT (user_data) == g_variant_get_uint32 (variant))
-    g_value_set_boolean (value, TRUE);
+  uint minutes = g_variant_get_uint32 (variant);
 
-  return TRUE;
+  for (gint i = 0; i < (gint) G_N_ELEMENTS (sync_frequency_minutes); i++) {
+    if (sync_frequency_minutes[i] != minutes)
+      continue;
+
+    g_value_set_int (value, i);
+
+    return TRUE;
+  }
+
+  return FALSE;
 }
 
 static GVariant *
@@ -1739,10 +1725,12 @@ sync_frequency_set_mapping (const GValue       *value,
                             const GVariantType *expected_type,
                             gpointer            user_data)
 {
-  if (!g_value_get_boolean (value))
+  gint i = g_value_get_int (value);
+
+  if (i >= (gint) G_N_ELEMENTS (sync_frequency_minutes))
     return NULL;
 
-  return g_variant_new_uint32 (GPOINTER_TO_UINT (user_data));
+  return g_variant_new_uint32 (sync_frequency_minutes[i]);
 }
 
 static gboolean
@@ -2286,6 +2274,32 @@ setup_language_page (PrefsDialog *dialog)
   create_language_section (dialog);
 }
 
+static GListModel *
+create_sync_frequency_minutes_model ()
+{
+  GListStore *list_store = g_list_store_new (HDY_TYPE_VALUE_OBJECT);
+  HdyValueObject *obj;
+  g_auto(GValue) value = G_VALUE_INIT;
+  guint i;
+
+  g_value_init (&value, G_TYPE_UINT);
+
+  for (i = 0; i < G_N_ELEMENTS (sync_frequency_minutes); i++) {
+    g_value_set_uint (&value, sync_frequency_minutes[i]);
+    obj = hdy_value_object_new (&value);
+    g_list_store_insert (list_store, i, obj);
+    g_clear_object (&obj);
+  }
+
+  return G_LIST_MODEL (list_store);
+}
+
+static gchar *
+get_sync_frequency_minutes_name (HdyValueObject *value)
+{
+  return g_strdup_printf ("%u min", g_value_get_uint (hdy_value_object_get_value (value)));
+}
+
 static void
 setup_sync_page (PrefsDialog *dialog)
 {
@@ -2293,27 +2307,18 @@ setup_sync_page (PrefsDialog *dialog)
   GSettings *sync_settings = ephy_settings_get (EPHY_PREFS_SYNC_SCHEMA);
   char *user = ephy_sync_utils_get_sync_user ();
   char *name = ephy_sync_utils_get_device_name ();
+  g_autoptr(GListModel) sync_frequency_minutes_model = create_sync_frequency_minutes_model ();
 
   gtk_entry_set_text (GTK_ENTRY (dialog->sync_device_name_entry), name);
 
   if (!user) {
     sync_setup_firefox_iframe (dialog);
-    gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                          dialog->sync_firefox_account_box);
-    gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                          dialog->sync_options_box);
+    gtk_widget_hide (dialog->sync_firefox_account_box);
+    gtk_widget_hide (dialog->sync_options_box);
   } else {
-    char *email = g_strdup_printf ("<b>%s</b>", user);
-    /* Translators: the %s refers to the email of the currently logged in user. */
-    char *text = g_strdup_printf (_("Logged in as %s"), email);
-
     sync_set_last_sync_time (dialog);
-    gtk_label_set_markup (GTK_LABEL (dialog->sync_firefox_account_label), text);
-    gtk_container_remove (GTK_CONTAINER (dialog->sync_page_box),
-                          dialog->sync_firefox_iframe_box);
-
-    g_free (email);
-    g_free (text);
+    hdy_action_row_set_title (HDY_ACTION_ROW (dialog->sync_firefox_account_row), user);
+    gtk_widget_hide (dialog->sync_page_box);
   }
 
   g_settings_bind (sync_settings,
@@ -2336,42 +2341,20 @@ setup_sync_page (PrefsDialog *dialog)
                    dialog->sync_open_tabs_checkbutton,
                    "active",
                    G_SETTINGS_BIND_DEFAULT);
+
+  hdy_combo_row_bind_name_model (HDY_COMBO_ROW (dialog->sync_frequency_row),
+                                 sync_frequency_minutes_model,
+                                 (HdyComboRowGetNameFunc) get_sync_frequency_minutes_name,
+                                 NULL,
+                                 NULL);
   g_settings_bind_with_mapping (sync_settings,
                                 EPHY_PREFS_SYNC_FREQUENCY,
-                                dialog->sync_frequency_5_min_radiobutton,
-                                "active",
-                                G_SETTINGS_BIND_DEFAULT,
-                                sync_frequency_get_mapping,
-                                sync_frequency_set_mapping,
-                                GINT_TO_POINTER (5),
-                                NULL);
-  g_settings_bind_with_mapping (sync_settings,
-                                EPHY_PREFS_SYNC_FREQUENCY,
-                                dialog->sync_frequency_15_min_radiobutton,
-                                "active",
-                                G_SETTINGS_BIND_DEFAULT,
-                                sync_frequency_get_mapping,
-                                sync_frequency_set_mapping,
-                                GINT_TO_POINTER (15),
-                                NULL);
-  g_settings_bind_with_mapping (sync_settings,
-                                EPHY_PREFS_SYNC_FREQUENCY,
-                                dialog->sync_frequency_30_min_radiobutton,
-                                "active",
-                                G_SETTINGS_BIND_DEFAULT,
-                                sync_frequency_get_mapping,
-                                sync_frequency_set_mapping,
-                                GINT_TO_POINTER (30),
-                                NULL);
-  g_settings_bind_with_mapping (sync_settings,
-                                EPHY_PREFS_SYNC_FREQUENCY,
-                                dialog->sync_frequency_60_min_radiobutton,
-                                "active",
+                                dialog->sync_frequency_row,
+                                "selected-index",
                                 G_SETTINGS_BIND_DEFAULT,
                                 sync_frequency_get_mapping,
                                 sync_frequency_set_mapping,
-                                GINT_TO_POINTER (60),
-                                NULL);
+                                NULL, NULL);
 
   g_object_bind_property (dialog->sync_open_tabs_checkbutton, "active",
                           dialog->synced_tabs_button, "sensitive",
diff --git a/src/resources/gtk/prefs-dialog.ui b/src/resources/gtk/prefs-dialog.ui
index f35d236ae..990291e90 100644
--- a/src/resources/gtk/prefs-dialog.ui
+++ b/src/resources/gtk/prefs-dialog.ui
@@ -923,39 +923,24 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox" id="sync_page_box">
+              <object class="HdyPreferencesPage" id="sync_page">
+                <property name="icon_name">emblem-synchronizing-symbolic</property>
+                <property name="title" translatable="yes">Sync</property>
                 <property name="visible">True</property>
-                <property name="border-width">12</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">12</property>
                 <child>
-                  <object class="GtkBox">
+                  <object class="HdyPreferencesGroup" id="sync_page_box">
+                    <property name="description" translatable="yes">Sign in with your Firefox account to 
sync your data with Web and Firefox on other computers. Web is not Firefox and is not produced or endorsed by 
Mozilla.</property>
+                    <property name="title" translatable="yes">Firefox Sync</property>
                     <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="halign">start</property>
-                        <property name="label" translatable="yes">Firefox Sync</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkBox">
+                      <object class="GtkBox" id="sync_firefox_iframe_box">
                         <property name="visible">True</property>
                         <property name="orientation">vertical</property>
                         <property name="spacing">6</property>
-                        <property name="margin-start">12</property>
                         <child>
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
+                          <object class="GtkLabel" id="sync_firefox_iframe_label">
+                            <property name="visible">False</property>
                             <property name="halign">start</property>
-                            <property name="max-width-chars">48</property>
-                            <property name="wrap">True</property>
-                            <property name="label" translatable="yes">Sign in with your Firefox account to 
sync your data with Web and Firefox on other computers. Web is not Firefox and is not produced or endorsed by 
Mozilla.</property>
                           </object>
                         </child>
                       </object>
@@ -963,282 +948,163 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkBox" id="sync_firefox_iframe_box">
+                  <object class="HdyPreferencesGroup" id="sync_firefox_account_box">
+                    <property name="title" translatable="yes">Firefox Account</property>
                     <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <property name="halign">center</property>
                     <child>
-                      <object class="GtkLabel" id="sync_firefox_iframe_label">
-                        <property name="visible">False</property>
-                        <property name="halign">start</property>
+                      <object class="HdyActionRow" id="sync_firefox_account_row">
+                        <property name="subtitle" translatable="yes">Logged in</property>
+                        <property name="use_underline">True</property>
+                        <property name="visible">True</property>
+                        <child type="action">
+                          <object class="GtkButton" id="sync_sign_out_button">
+                            <property name="label" translatable="yes">Sign _out</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
+                            <property name="visible">True</property>
+                            <signal name="clicked" handler="on_sync_sign_out_button_clicked"/>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
                 </child>
                 <child>
-                  <object class="GtkBox" id="sync_firefox_account_box">
+                  <object class="HdyPreferencesGroup" id="sync_options_box">
+                    <property name="title" translatable="yes">Sync Options</property>
                     <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkBox">
+                      <object class="HdyActionRow">
+                        <property name="activatable_widget">sync_bookmarks_checkbutton</property>
+                        <property name="title" translatable="yes">Sync _Bookmarks</property>
+                        <property name="use_underline">True</property>
                         <property name="visible">True</property>
-                        <child>
-                          <object class="GtkLabel">
+                        <child type="prefix">
+                          <object class="GtkCheckButton" id="sync_bookmarks_checkbutton">
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
                             <property name="visible">True</property>
-                            <property name="halign">start</property>
-                            <property name="hexpand">True</property>
-                            <property name="label" translatable="yes">Firefox Account</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
                           </object>
                         </child>
-                        <child>
-                          <object class="GtkButton" id="sync_sign_out_button">
-                            <property name="label" translatable="yes">Sign _out</property>
-                            <property name="visible">True</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="HdyActionRow">
+                        <property name="activatable_widget">sync_passwords_checkbutton</property>
+                        <property name="title" translatable="yes">Sync _Passwords</property>
+                        <property name="use_underline">True</property>
+                        <property name="visible">True</property>
+                        <child type="prefix">
+                          <object class="GtkCheckButton" id="sync_passwords_checkbutton">
                             <property name="use-underline">True</property>
-                            <signal name="clicked" handler="on_sync_sign_out_button_clicked"/>
+                            <property name="valign">center</property>
+                            <property name="visible">True</property>
                           </object>
                         </child>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkBox">
+                      <object class="HdyActionRow">
+                        <property name="activatable_widget">sync_history_checkbutton</property>
+                        <property name="title" translatable="yes">Sync _History</property>
+                        <property name="use_underline">True</property>
                         <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">6</property>
-                        <property name="margin-start">12</property>
-                        <child>
-                          <object class="GtkLabel" id="sync_firefox_account_label">
+                        <child type="prefix">
+                          <object class="GtkCheckButton" id="sync_history_checkbutton">
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
                             <property name="visible">True</property>
-                            <property name="halign">start</property>
-                            <property name="label" translatable="yes"/>
                           </object>
                         </child>
                       </object>
                     </child>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkBox" id="sync_options_box">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkLabel">
+                      <object class="HdyActionRow">
+                        <property name="activatable_widget">sync_open_tabs_checkbutton</property>
+                        <property name="title" translatable="yes">Sync Open _Tabs</property>
+                        <property name="use_underline">True</property>
                         <property name="visible">True</property>
-                        <property name="halign">start</property>
-                        <property name="label" translatable="yes">Sync Options</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
+                        <child type="prefix">
+                          <object class="GtkCheckButton" id="sync_open_tabs_checkbutton">
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
+                            <property name="visible">True</property>
+                          </object>
+                        </child>
+                        <child type="action">
+                          <object class="GtkButton" id="synced_tabs_button">
+                            <property name="label" translatable="yes">S_ynced tabs</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
+                            <property name="visible">True</property>
+                            <signal name="clicked" handler="on_sync_synced_tabs_button_clicked"/>
+                          </object>
+                        </child>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkBox">
+                      <object class="HdyComboRow" id="sync_frequency_row">
+                        <property name="title" translatable="yes">Frequency</property>
                         <property name="visible">True</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">4</property>
-                        <property name="margin-start">12</property>
-                        <child>
-                          <object class="GtkBox">
+                        <child type="action">
+                          <object class="GtkSeparator">
+                            <property name="margin_bottom">8</property>
+                            <property name="margin_top">8</property>
                             <property name="visible">True</property>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <property name="halign">start</property>
-                                <property name="hexpand">True</property>
-                                <property name="label" translatable="yes">Collections</property>
-                                <attributes>
-                                  <attribute name="weight" value="bold"/>
-                                </attributes>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="synced_tabs_button">
-                                <property name="label" translatable="yes">S_ynced tabs</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                                <signal name="clicked" handler="on_sync_synced_tabs_button_clicked"/>
-                              </object>
-                            </child>
                           </object>
                         </child>
-                        <child>
-                          <object class="GtkBox">
+                        <child type="action">
+                          <object class="GtkButton" id="sync_now_button">
+                            <property name="label" translatable="yes">Sync _now</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
                             <property name="visible">True</property>
-                            <property name="orientation">horizontal</property>
-                            <property name="spacing">6</property>
-                            <property name="margin-start">12</property>
-                            <child>
-                              <object class="GtkCheckButton" id="sync_bookmarks_checkbutton">
-                                <property name="label" translatable="yes">_Bookmarks</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckButton" id="sync_passwords_checkbutton">
-                                <property name="label" translatable="yes">_Passwords</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckButton" id="sync_history_checkbutton">
-                                <property name="label" translatable="yes">_History</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckButton" id="sync_open_tabs_checkbutton">
-                                <property name="label" translatable="yes">Open _Tabs</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                              </object>
-                            </child>
+                            <signal name="clicked" handler="on_sync_sync_now_button_clicked"/>
                           </object>
                         </child>
-                        <child>
-                          <object class="GtkBox">
+                      </object>
+                    </child>
+                    <child>
+                      <object class="HdyActionRow">
+                        <property name="activatable">False</property>
+                        <property name="title" translatable="yes">Device name</property>
+                        <property name="use_underline">True</property>
+                        <property name="visible">True</property>
+                        <child type="action">
+                          <object class="GtkButton" id="sync_device_name_change_button">
+                            <property name="label" translatable="yes">_Change</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
                             <property name="visible">True</property>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <property name="halign">start</property>
-                                <property name="hexpand">True</property>
-                                <property name="label" translatable="yes">Frequency</property>
-                                <attributes>
-                                  <attribute name="weight" value="bold"/>
-                                </attributes>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="sync_now_button">
-                                <property name="label" translatable="yes">Sync _now</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                                <signal name="clicked" handler="on_sync_sync_now_button_clicked"/>
-                              </object>
-                            </child>
+                            <signal name="clicked" handler="on_sync_device_name_change_button_clicked"/>
                           </object>
                         </child>
-                        <child>
-                          <object class="GtkBox">
-                            <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">6</property>
-                            <property name="margin-start">12</property>
-                            <child>
-                              <object class="GtkBox">
-                                <property name="visible">True</property>
-                                <child>
-                                  <object class="GtkRadioButton" id="sync_frequency_5_min_radiobutton">
-                                    <property name="label" translatable="yes">_5 min</property>
-                                    <property name="visible">True</property>
-                                    <property name="use-underline">True</property>
-                                  </object>
-                                </child>
-                                <child>
-                                  <object class="GtkRadioButton" id="sync_frequency_15_min_radiobutton">
-                                    <property name="label" translatable="yes">_15 min</property>
-                                    <property name="visible">True</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="group">sync_frequency_5_min_radiobutton</property>
-                                  </object>
-                                </child>
-                                <child>
-                                  <object class="GtkRadioButton" id="sync_frequency_30_min_radiobutton">
-                                    <property name="label" translatable="yes">_30 min</property>
-                                    <property name="visible">True</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="group">sync_frequency_5_min_radiobutton</property>
-                                  </object>
-                                </child>
-                                <child>
-                                  <object class="GtkRadioButton" id="sync_frequency_60_min_radiobutton">
-                                    <property name="label" translatable="yes">_60 min</property>
-                                    <property name="visible">True</property>
-                                    <property name="use-underline">True</property>
-                                    <property name="group">sync_frequency_5_min_radiobutton</property>
-                                  </object>
-                                </child>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkBox" id="sync_last_sync_time_box">
-                                <property name="visible">True</property>
-                                <child>
-                                  <object class="GtkLabel" id="sync_last_sync_time_label">
-                                    <property name="visible">True</property>
-                                    <property name="halign">start</property>
-                                    <property name="hexpand">True</property>
-                                  </object>
-                                </child>
-                              </object>
-                            </child>
+                        <child type="action">
+                          <object class="GtkButton" id="sync_device_name_save_button">
+                            <property name="label" translatable="yes">_Save</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
+                            <property name="visible">False</property>
+                            <signal name="clicked" handler="on_sync_device_name_save_button_clicked"/>
                           </object>
                         </child>
-                        <child>
-                          <object class="GtkBox">
-                            <property name="visible">True</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <property name="halign">start</property>
-                                <property name="hexpand">True</property>
-                                <property name="label" translatable="yes">Device name</property>
-                                <attributes>
-                                  <attribute name="weight" value="bold"/>
-                                </attributes>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="sync_device_name_change_button">
-                                <property name="label" translatable="yes">_Change</property>
-                                <property name="visible">True</property>
-                                <property name="use-underline">True</property>
-                                <signal name="clicked" handler="on_sync_device_name_change_button_clicked"/>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="sync_device_name_save_button">
-                                <property name="label" translatable="yes">_Save</property>
-                                <property name="visible">False</property>
-                                <property name="use-underline">True</property>
-                                <signal name="clicked" handler="on_sync_device_name_save_button_clicked"/>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkButton" id="sync_device_name_cancel_button">
-                                <property name="label" translatable="yes">_Cancel</property>
-                                <property name="visible">False</property>
-                                <property name="use-underline">True</property>
-                                <signal name="clicked" handler="on_sync_device_name_cancel_button_clicked"/>
-                              </object>
-                            </child>
+                        <child type="action">
+                          <object class="GtkButton" id="sync_device_name_cancel_button">
+                            <property name="label" translatable="yes">_Cancel</property>
+                            <property name="use-underline">True</property>
+                            <property name="valign">center</property>
+                            <property name="visible">False</property>
+                            <signal name="clicked" handler="on_sync_device_name_cancel_button_clicked"/>
                           </object>
                         </child>
                         <child>
-                          <object class="GtkBox">
-                            <property name="visible">True</property>
-                            <property name="orientation">horizontal</property>
-                            <property name="spacing">6</property>
+                          <object class="GtkEntry" id="sync_device_name_entry">
+                            <property name="sensitive">False</property>
                             <property name="margin-start">12</property>
-                            <child>
-                              <object class="GtkEntry" id="sync_device_name_entry">
-                                <property name="visible">True</property>
-                                <property name="hexpand">True</property>
-                                <property name="halign">start</property>
-                                <property name="width-request">250</property>
-                                <property name="sensitive">False</property>
-                              </object>
-                            </child>
+                            <property name="margin-end">12</property>
+                            <property name="margin-top">8</property>
+                            <property name="margin-bottom">8</property>
+                            <property name="visible">True</property>
                           </object>
                         </child>
                       </object>



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