[gnome-packagekit] Port to GtkComboBoxText
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Port to GtkComboBoxText
- Date: Tue, 26 Oct 2010 12:34:41 +0000 (UTC)
commit a4b5a2d653762aa3fe82cf0fbdfca47d7f024ad6
Author: Richard Hughes <richard hughsie com>
Date: Tue Oct 26 11:47:02 2010 +0100
Port to GtkComboBoxText
data/gpk-prefs.ui | 9 ++++++---
src/cc-update-panel.c | 24 ++++++++++++------------
2 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/data/gpk-prefs.ui b/data/gpk-prefs.ui
index 49b4ef0..baecd2e 100644
--- a/data/gpk-prefs.ui
+++ b/data/gpk-prefs.ui
@@ -30,7 +30,8 @@
<property name="column_spacing">20</property>
<property name="row_spacing">9</property>
<child>
- <object class="GtkComboBox" id="combobox_check">
+ <object class="GtkComboBoxText" id="combobox_check">
+ <property name="entry-text-column">0</property>
<property name="visible">True</property>
</object>
<packing>
@@ -41,7 +42,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="combobox_install">
+ <object class="GtkComboBoxText" id="combobox_install">
+ <property name="entry-text-column">0</property>
<property name="visible">True</property>
</object>
<packing>
@@ -96,7 +98,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="combobox_upgrade">
+ <object class="GtkComboBoxText" id="combobox_upgrade">
+ <property name="entry-text-column">0</property>
<property name="visible">True</property>
</object>
<packing>
diff --git a/src/cc-update-panel.c b/src/cc-update-panel.c
index 512b140..3c4c091 100644
--- a/src/cc-update-panel.c
+++ b/src/cc-update-panel.c
@@ -123,7 +123,7 @@ cc_update_panel_update_freq_combo_changed (GtkWidget *widget, CcUpdatePanel *pan
gchar *value;
guint freq = 0;
- value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
+ 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)
@@ -149,7 +149,7 @@ cc_update_panel_upgrade_freq_combo_changed (GtkWidget *widget, CcUpdatePanel *pa
gchar *value;
guint freq = 0;
- value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
+ 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)
@@ -218,10 +218,10 @@ cc_update_panel_update_freq_combo_setup (CcUpdatePanel *panel)
/* set a simple text model */
cc_update_panel_update_freq_combo_simple_text (widget);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_HOURLY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_DAILY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_WEEKLY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_NEVER_TEXT);
+ 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)
@@ -258,9 +258,9 @@ cc_update_panel_upgrade_freq_combo_setup (CcUpdatePanel *panel)
/* set a simple text model */
cc_update_panel_update_freq_combo_simple_text (widget);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_DAILY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_WEEKLY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_FREQ_NEVER_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_DAILY)
@@ -294,9 +294,9 @@ cc_update_panel_auto_update_combo_setup (CcUpdatePanel *panel)
/* set a simple text model */
cc_update_panel_update_freq_combo_simple_text (widget);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_UPDATE_ALL_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_UPDATE_SECURITY_TEXT);
- gtk_combo_box_append_text (GTK_COMBO_BOX (widget), PK_UPDATE_NONE_TEXT);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_UPDATE_ALL_TEXT);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_UPDATE_SECURITY_TEXT);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), PK_UPDATE_NONE_TEXT);
/* we can do this as it's the same order */
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), update);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]