[gnome-packagekit] Do not set gnome-settings-daemon schema in the prefs program



commit 6c0b919b633d77c625a248a72140b524170871fa
Author: Richard Hughes <richard hughsie com>
Date:   Mon Nov 4 15:50:37 2013 +0000

    Do not set gnome-settings-daemon schema in the prefs program

 data/gpk-prefs.ui |  346 ++++++++++-------------------------------------------
 src/gpk-prefs.c   |  246 +-------------------------------------
 2 files changed, 65 insertions(+), 527 deletions(-)
---
diff --git a/data/gpk-prefs.ui b/data/gpk-prefs.ui
index 7114d9c..0cff5c4 100644
--- a/data/gpk-prefs.ui
+++ b/data/gpk-prefs.ui
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Mon Nov  4 15:48:56 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="dialog_prefs">
@@ -59,212 +60,82 @@
           </packing>
         </child>
         <child>
-          <object class="GtkNotebook" id="notebook_preferences">
+          <object class="GtkBox" id="box1">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="border_width">6</property>
+            <property name="can_focus">False</property>
+            <property name="margin_left">6</property>
+            <property name="margin_right">6</property>
+            <property name="margin_top">6</property>
+            <property name="margin_bottom">6</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">12</property>
             <child>
-              <object class="GtkVBox" id="vbox8">
+              <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="border_width">15</property>
-                <property name="spacing">12</property>
-                <child>
-                  <object class="GtkTable" id="table1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
-                    <property name="column_spacing">20</property>
-                    <property name="row_spacing">9</property>
-                    <child>
-                      <object class="GtkComboBoxText" id="combobox_check">
-                        <property name="width_request">200</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="entry_text_column">0</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label_check1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">C_heck for updates:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">combobox_check</property>
-                      </object>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label_upgrade">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Check for major _upgrades:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">combobox_check</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBoxText" id="combobox_upgrade">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="entry_text_column">0</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">A software source contains packages that can be 
installed on this computer.</property>
+                <attributes>
+                  <attribute name="style" value="normal"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow_repo">
+                <property name="can_focus">True</property>
+                <property name="hscrollbar_policy">never</property>
+                <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkBox" id="box1">
+                  <object class="GtkTreeView" id="treeview_repo">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">3</property>
-                    <child>
-                      <object class="GtkCheckButton" id="checkbutton_mobile_broadband">
-                        <property name="label" translatable="yes">Check for updates when using mobile 
broadband</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="xalign">0</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkCheckButton" id="checkbutton_battery_power">
-                        <property name="label" translatable="yes">Check for updates on battery 
power</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="xalign">0</property>
-                        <property name="draw_indicator">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="hbox_mobile_broadband">
-                    <property name="can_focus">False</property>
-                    <property name="spacing">9</property>
-                    <child>
-                      <object class="GtkImage" id="image1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="stock">gtk-dialog-info</property>
-                        <property name="icon-size">5</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Currently using mobile broadband</property>
-                        <attributes>
-                          <attribute name="style" value="italic"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
+                    <property name="can_focus">True</property>
+                    <property name="headers_visible">False</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection"/>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">3</property>
-                  </packing>
                 </child>
               </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
             </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label_tab_settings">
+            <child>
+              <object class="GtkCheckButton" id="checkbutton_detail">
+                <property name="label" translatable="yes" comments="shows extra -source, -debuginfo, and 
-devel software sources">_Show debug and development software sources</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Update Settings</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
               </object>
               <packing>
-                <property name="tab_fill">False</property>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox3">
+              <object class="GtkBox" id="box_status">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="border_width">15</property>
+                <property name="halign">center</property>
                 <property name="spacing">12</property>
                 <child>
-                  <object class="GtkHBox" id="hbox1">
+                  <object class="GtkImage" id="image_status">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <child>
-                      <object class="GtkLabel" id="label2">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0.49000000953674316</property>
-                        <property name="label" translatable="yes">A software source contains packages that 
can be installed on this computer.</property>
-                        <attributes>
-                          <attribute name="style" value="normal"/>
-                        </attributes>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
+                    <property name="stock">gtk-execute</property>
+                    <property name="icon_size">6</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -273,116 +144,25 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkScrolledWindow" id="scrolledwindow_repo">
-                    <property name="can_focus">True</property>
-                    <property name="hscrollbar_policy">never</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <object class="GtkTreeView" id="treeview_repo">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="headers_visible">False</property>
-                        <child internal-child="selection">
-                          <object class="GtkTreeSelection" id="treeview-selection"/>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkViewport" id="viewport_status">
+                  <object class="GtkLabel" id="label_status">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="resize_mode">queue</property>
-                    <child>
-                      <object class="GtkHBox" id="hbox_status">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <child>
-                          <object class="GtkHBox" id="hbox_status2">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">12</property>
-                            <child>
-                              <object class="GtkImage" id="image_status">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="stock">gtk-execute</property>
-                                <property name="icon-size">6</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label_status">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label">Another action is in progress.</property>
-                                <attributes>
-                                  <attribute name="weight" value="bold"/>
-                                </attributes>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="checkbutton_detail">
-                    <property name="label" translatable="yes" comments="shows extra -source, -debuginfo, and 
-devel software sources">_Show debug and development software sources</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="label">Another action is in progress.</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">True</property>
-                    <property name="position">3</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label_tab_battery">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Software Sources</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">3</property>
               </packing>
             </child>
           </object>
diff --git a/src/gpk-prefs.c b/src/gpk-prefs.c
index 27db239..ff242cf 100644
--- a/src/gpk-prefs.c
+++ b/src/gpk-prefs.c
@@ -37,7 +37,6 @@
 typedef struct {
        const gchar             *id_tmp;
        GCancellable            *cancellable;
-       GSettings               *settings_gsd;
        GSettings               *settings_gpk;
        GtkApplication          *application;
        GtkBuilder              *builder;
@@ -58,27 +57,6 @@ enum {
        GPK_COLUMN_LAST
 };
 
-/* TRANSLATORS: check once an hour */
-#define PK_FREQ_HOURLY_TEXT            _("Hourly")
-/* TRANSLATORS: check once a day */
-#define PK_FREQ_DAILY_TEXT             _("Daily")
-/* TRANSLATORS: check once a week */
-#define PK_FREQ_WEEKLY_TEXT            _("Weekly")
-/* TRANSLATORS: never check for updates/upgrades */
-#define PK_FREQ_NEVER_TEXT             _("Never")
-
-/* TRANSLATORS: update everything */
-#define PK_UPDATE_ALL_TEXT             _("All updates")
-/* TRANSLATORS: update just security updates */
-#define PK_UPDATE_SECURITY_TEXT                _("Only security updates")
-/* TRANSLATORS: don't update anything */
-#define PK_UPDATE_NONE_TEXT            _("Nothing")
-
-#define GPK_PREFS_VALUE_NEVER          (0)
-#define GPK_PREFS_VALUE_HOURLY         (60*60)
-#define GPK_PREFS_VALUE_DAILY          (60*60*24)
-#define GPK_PREFS_VALUE_WEEKLY         (60*60*24*7)
-
 /**
  * gpk_prefs_help_cb:
  **/
@@ -89,151 +67,6 @@ gpk_prefs_help_cb (GtkWidget *widget, GpkPrefsPrivate *priv)
 }
 
 /**
- * gpk_prefs_update_freq_combo_changed:
- **/
-static void
-gpk_prefs_update_freq_combo_changed (GtkWidget *widget, GpkPrefsPrivate *priv)
-{
-       gchar *value;
-       guint freq = 0;
-
-       value = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget));
-       if (strcmp (value, PK_FREQ_HOURLY_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_HOURLY;
-       else if (strcmp (value, PK_FREQ_DAILY_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_DAILY;
-       else if (strcmp (value, PK_FREQ_WEEKLY_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_WEEKLY;
-       else if (strcmp (value, PK_FREQ_NEVER_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_NEVER;
-       else
-               g_assert (FALSE);
-
-       g_debug ("Changing %s to %i", GSD_SETTINGS_FREQUENCY_GET_UPDATES, freq);
-       g_settings_set_int (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPDATES, freq);
-       g_free (value);
-}
-
-/**
- * gpk_prefs_upgrade_freq_combo_changed:
- **/
-static void
-gpk_prefs_upgrade_freq_combo_changed (GtkWidget *widget, GpkPrefsPrivate *priv)
-{
-       gchar *value;
-       guint freq = 0;
-
-       value = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (widget));
-       if (strcmp (value, PK_FREQ_DAILY_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_DAILY;
-       else if (strcmp (value, PK_FREQ_WEEKLY_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_WEEKLY;
-       else if (strcmp (value, PK_FREQ_NEVER_TEXT) == 0)
-               freq = GPK_PREFS_VALUE_NEVER;
-       else
-               g_assert (FALSE);
-
-       g_debug ("Changing %s to %i", GSD_SETTINGS_FREQUENCY_GET_UPGRADES, freq);
-       g_settings_set_int (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPGRADES, freq);
-       g_free (value);
-}
-
-/**
- * gpk_prefs_update_freq_combo_setup:
- **/
-static void
-gpk_prefs_update_freq_combo_setup (GpkPrefsPrivate *priv)
-{
-       gboolean is_writable;
-       GtkWidget *widget;
-       guint value;
-
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "combobox_check"));
-       is_writable = g_settings_is_writable (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPDATES);
-       value = g_settings_get_int (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPDATES);
-       g_debug ("value from settings %i", value);
-
-       /* do we have permission to write? */
-       gtk_widget_set_sensitive (widget, is_writable);
-
-       /* use a simple text model */
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_HOURLY_TEXT);
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_DAILY_TEXT);
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_WEEKLY_TEXT);
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_NEVER_TEXT);
-
-       /* select the correct entry */
-       if (value == GPK_PREFS_VALUE_HOURLY)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-       else if (value == GPK_PREFS_VALUE_DAILY)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
-       else if (value == GPK_PREFS_VALUE_WEEKLY)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2);
-       else if (value == GPK_PREFS_VALUE_NEVER)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 3);
-
-       /* only do this after else we redraw the window */
-       g_signal_connect (G_OBJECT (widget), "changed",
-                         G_CALLBACK (gpk_prefs_update_freq_combo_changed), priv);
-}
-
-/**
- * gpk_prefs_upgrade_freq_combo_setup:
- **/
-static void
-gpk_prefs_upgrade_freq_combo_setup (GpkPrefsPrivate *priv)
-{
-       gboolean is_writable;
-       GtkWidget *widget;
-       guint value;
-
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "combobox_upgrade"));
-       is_writable = g_settings_is_writable (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPGRADES);
-       value = g_settings_get_int (priv->settings_gsd, GSD_SETTINGS_FREQUENCY_GET_UPGRADES);
-       g_debug ("value from settings %i", value);
-
-       /* do we have permission to write? */
-       gtk_widget_set_sensitive (widget, is_writable);
-
-       /* use a simple text model */
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_DAILY_TEXT);
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_WEEKLY_TEXT);
-       gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_FREQ_NEVER_TEXT);
-
-       /* select the correct entry */
-       if (value == GPK_PREFS_VALUE_DAILY)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-       else if (value == GPK_PREFS_VALUE_WEEKLY)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
-       else if (value == GPK_PREFS_VALUE_NEVER)
-               gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2);
-
-       /* only do this after else we redraw the window */
-       g_signal_connect (G_OBJECT (widget), "changed",
-                         G_CALLBACK (gpk_prefs_upgrade_freq_combo_changed), priv);
-}
-
-/**
- * gpk_prefs_notify_network_state_cb:
- **/
-static void
-gpk_prefs_notify_network_state_cb (PkControl *control, GParamSpec *pspec, GpkPrefsPrivate *priv)
-{
-       GtkWidget *widget;
-       PkNetworkEnum state;
-
-       /* only show label on mobile broadband */
-       g_object_get (control,
-                     "network-state", &state,
-                     NULL);
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "hbox_mobile_broadband"));
-       if (state == PK_NETWORK_ENUM_MOBILE)
-               gtk_widget_show (widget);
-       else
-               gtk_widget_hide (widget);
-}
-
-/**
  * gpk_prefs_find_iter_model_cb:
  **/
 static gboolean
@@ -328,23 +161,13 @@ gpk_prefs_remove_nonactive (GtkTreeModel *model)
 static gboolean
 gpk_prefs_status_changed_timeout_cb (GpkPrefsPrivate *priv)
 {
-       const gchar *text;
        GtkWidget *widget;
 
        /* set the text and show */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_repo"));
        gtk_widget_hide (widget);
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "viewport_status"));
+       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "box_status"));
        gtk_widget_show (widget);
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_status"));
-       text = gpk_status_enum_to_localised_text (priv->status);
-       gtk_label_set_label (GTK_LABEL (widget), text);
-
-       /* set icon */
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "image_status"));
-       gtk_image_set_from_icon_name (GTK_IMAGE (widget),
-                                     gpk_status_enum_to_icon_name (priv->status),
-                                     GTK_ICON_SIZE_DIALOG);
 
        /* never repeat */
        priv->status_id = 0;
@@ -374,7 +197,7 @@ gpk_prefs_progress_cb (PkProgress *progress, PkProgressType type, GpkPrefsPrivat
                        g_source_remove (priv->status_id);
                        priv->status_id = 0;
                }
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "viewport_status"));
+               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "box_status"));
                gtk_widget_hide (widget);
                widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_repo"));
                gtk_widget_show (widget);
@@ -692,7 +515,6 @@ gpk_prefs_get_properties_cb (GObject *object, GAsyncResult *res, GpkPrefsPrivate
        GError *error = NULL;
        GtkWidget *widget;
        PkControl *control = PK_CONTROL(object);
-       PkNetworkEnum state;
 
        /* get the result */
        ret = pk_control_get_properties_finish (control, res, &error);
@@ -706,21 +528,8 @@ gpk_prefs_get_properties_cb (GObject *object, GAsyncResult *res, GpkPrefsPrivate
        /* get values */
        g_object_get (control,
                      "roles", &priv->roles,
-                     "network-state", &state,
                      NULL);
 
-       /* only show label on mobile broadband */
-       widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "hbox_mobile_broadband"));
-       gtk_widget_set_visible (widget, (state == PK_NETWORK_ENUM_MOBILE));
-
-       /* hide if not supported */
-       if (!pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_GET_DISTRO_UPGRADES)) {
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "label_upgrade"));
-               gtk_widget_hide (widget);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "combobox_upgrade"));
-               gtk_widget_hide (widget);
-       }
-
        /* setup sources GUI elements */
        if (pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_GET_REPO_LIST)) {
                gpk_prefs_repo_list_refresh (priv);
@@ -775,8 +584,6 @@ gpk_pack_startup_cb (GtkApplication *application, GpkPrefsPrivate *priv)
 
        /* get actions */
        control = pk_control_new ();
-       g_signal_connect (control, "notify::network-state",
-                         G_CALLBACK (gpk_prefs_notify_network_state_cb), priv);
        g_signal_connect (control, "repo-list-changed",
                          G_CALLBACK (gpk_prefs_repo_list_changed_cb), priv);
 
@@ -788,20 +595,6 @@ gpk_pack_startup_cb (GtkApplication *application, GpkPrefsPrivate *priv)
                goto out;
        }
 
-       /* bind the mobile broadband and battery checkbox */
-       if (priv->settings_gsd != NULL) {
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "checkbutton_mobile_broadband"));
-               g_settings_bind (priv->settings_gsd,
-                                GSD_SETTINGS_CONNECTION_USE_MOBILE,
-                                widget, "active",
-                                G_SETTINGS_BIND_DEFAULT);
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "checkbutton_battery_power"));
-               g_settings_bind (priv->settings_gsd,
-                                GSD_SETTINGS_UPDATE_BATTERY,
-                                widget, "active",
-                                G_SETTINGS_BIND_DEFAULT);
-       }
-
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_close"));
        g_signal_connect (widget, "clicked",
                          G_CALLBACK (gpk_prefs_close_cb), priv);
@@ -809,15 +602,6 @@ gpk_pack_startup_cb (GtkApplication *application, GpkPrefsPrivate *priv)
        g_signal_connect (widget, "clicked",
                          G_CALLBACK (gpk_prefs_help_cb), priv);
 
-       /* update the combo boxes */
-       if (priv->settings_gsd != NULL) {
-               gpk_prefs_update_freq_combo_setup (priv);
-               gpk_prefs_upgrade_freq_combo_setup (priv);
-       } else {
-               widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "notebook_preferences"));
-               gtk_notebook_remove_page (GTK_NOTEBOOK (widget), 0);
-       }
-
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "checkbutton_detail"));
        g_settings_bind (priv->settings_gpk,
                         GPK_SETTINGS_REPO_SHOW_DETAILS,
@@ -901,30 +685,11 @@ out:
 }
 
 /**
- * gpk_prefs_has_gsd_schema:
- **/
-static gboolean
-gpk_prefs_has_gsd_schema (GpkPrefsPrivate *priv)
-{
-       const char * const *schemas;
-       guint i;
-
-       /* find the schema in the global list */
-       schemas = g_settings_list_schemas ();
-       for (i = 0; schemas[i] != NULL; i++) {
-               if (g_strcmp0 (schemas[i], GSD_SETTINGS_SCHEMA) == 0)
-                       return TRUE;
-       }
-       return FALSE;
-}
-
-/**
  * main:
  **/
 int
 main (int argc, char *argv[])
 {
-       gboolean ret;
        gint status = 0;
        GpkPrefsPrivate *priv = NULL;
 
@@ -948,11 +713,6 @@ main (int argc, char *argv[])
                      "background", FALSE,
                      NULL);
 
-       /* have we got a GSD with update schema */
-       ret = gpk_prefs_has_gsd_schema (priv);
-       if (ret)
-               priv->settings_gsd = g_settings_new (GSD_SETTINGS_SCHEMA);
-
        /* are we already activated? */
        priv->application = gtk_application_new ("org.freedesktop.PackageKit.Prefs",
                                                 G_APPLICATION_HANDLES_COMMAND_LINE);
@@ -971,8 +731,6 @@ main (int argc, char *argv[])
                g_object_unref (priv->settings_gpk);
                g_object_unref (priv->list_store);
                g_object_unref (priv->client);
-               if (priv->settings_gsd != NULL)
-                       g_object_unref (priv->settings_gsd);
                g_free (priv);
        }
        return status;


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