commit c3a62ba09503e5778e348ce0eae3bdd33f2bbfcc
Author: phantomjinx <p.g.richard...@phantomjinx.co.uk>
Date: Fri Apr 29 21:36:31 2011 +0000
Migrate combo boxes due to changes with combo box and combo box text
* combo_box_append_text can no longer be used with combo_box but only with
combo_box_text. Replace these with appending iters to the combo box models
plugins/core_preferences/core_prefs.c | 12 ++-
plugins/details_editor/details.c | 10 +-
plugins/playlist_display/playlist_display.xml | 126 +++++++++++++++------
plugins/playlist_display/playlist_display_spl.c | 33 +++---
plugins/repository_editor/repository.c | 2 +-
plugins/repository_editor/repository_init.c | 4 +-
plugins/sorttab_display/display_sorttabs.c | 6 +-
plugins/track_display/display_tracks.c | 1 -
plugins/track_display/track_display_preferences.c | 9 +-
9 files changed, 141 insertions(+), 62 deletions(-)
---
diff --git a/plugins/core_preferences/core_prefs.c
b/plugins/core_preferences/core_prefs.c
index f7ec7a9..e1a0303 100644
--- a/plugins/core_preferences/core_prefs.c
+++ b/plugins/core_preferences/core_prefs.c
@@ -267,7 +267,17 @@ G_MODULE_EXPORT void open_encoding_dialog(GtkButton
*sender, gpointer e) {
glade callback
*/
G_MODULE_EXPORT void on_encoding_combo_changed(GtkComboBox *sender, gpointer
e) {
- gchar *description = gtk_combo_box_get_active_text(sender);
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+
+ if (!gtk_combo_box_get_active_iter(sender, &iter))
+ return;
+
+ model = gtk_combo_box_get_model(sender);
+
+ gchar *description;
+ gtk_tree_model_get(model, &iter, 0, &description, -1);
+
gchar *charset = charset_from_description(description);
prefs_set_string("charset", charset);
diff --git a/plugins/details_editor/details.c b/plugins/details_editor/details.c
index 07ace3e..364582d 100644
--- a/plugins/details_editor/details.c
+++ b/plugins/details_editor/details.c
@@ -528,10 +528,11 @@ static gint comboentry_index_from_id(const ComboEntry
centries[], guint32 id) {
}
/* initialize a combobox with the corresponding entry strings */
-static void details_setup_combobox(GtkWidget *cb, const ComboEntry centries[])
{
+static void details_setup_combo_box(GtkWidget *cb, const ComboEntry
centries[]) {
const ComboEntry *ce = centries;
GtkCellRenderer *cell;
GtkListStore *store;
+ GtkTreeIter iter;
g_return_if_fail (cb);
g_return_if_fail (centries);
@@ -548,7 +549,10 @@ static void details_setup_combobox(GtkWidget *cb, const
ComboEntry centries[]) {
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT (cb), cell, "text", 0,
NULL);
while (ce->str != NULL) {
- gtk_combo_box_append_text(GTK_COMBO_BOX (cb), _(ce->str));
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _(ce->str),
+ -1);
++ce;
}
}
@@ -669,7 +673,7 @@ static void details_setup_widget(T_item item) {
case T_MEDIA_TYPE:
buf = g_strdup_printf("details_combobox_%d", item);
w = gtkpod_builder_xml_get_widget(details_view->xml, buf);
- details_setup_combobox(w, mediatype_comboentries);
+ details_setup_combo_box(w, mediatype_comboentries);
g_signal_connect (w, "changed",
G_CALLBACK (details_combobox_changed),
details_view);
diff --git a/plugins/playlist_display/playlist_display.xml
b/plugins/playlist_display/playlist_display.xml
index 42d62c5..326ad2a 100644
--- a/plugins/playlist_display/playlist_display.xml
+++ b/plugins/playlist_display/playlist_display.xml
@@ -1,8 +1,25 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy project-wide -->
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkListStore" id="match_rules_model">
+ <columns>
+ <!-- column-name gchararray -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Any rules</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">All rules</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Ignore rules</col>
+ </row>
+ </data>
+ </object>
<object class="GtkWindow" id="prefs_window">
+ <property name="can_focus">False</property>
<child>
<object class="GtkNotebook" id="playlist_settings_notebook">
<property name="visible">True</property>
@@ -10,30 +27,34 @@
<child>
<object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">12</property>
- <property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
<object class="GtkFrame" id="frame4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment14">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="hbox30">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="n_rows">2</property>
<property name="n_columns">3</property>
@@ -68,13 +89,15 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property name="active">True</property>
<property
name="draw_indicator">True</property>
<property name="group">pm_none</property>
- <signal name="toggled"
handler="on_pm_ascend_toggled"/>
+ <signal name="toggled"
handler="on_pm_ascend_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="image1928">
<property
name="visible">True</property>
+ <property
name="can_focus">False</property>
<property
name="stock">gtk-sort-ascending</property>
</object>
</child>
@@ -92,12 +115,14 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property
name="draw_indicator">True</property>
<property name="group">pm_none</property>
- <signal name="toggled"
handler="on_pm_descend_toggled"/>
+ <signal name="toggled"
handler="on_pm_descend_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="image1929">
<property
name="visible">True</property>
+ <property
name="can_focus">False</property>
<property
name="stock">gtk-sort-descending</property>
</object>
</child>
@@ -126,11 +151,13 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property
name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_pm_none_toggled"/>
+ <signal name="toggled"
handler="on_pm_none_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="image1930">
<property
name="visible">True</property>
+ <property
name="can_focus">False</property>
<property
name="stock">gtk-undo</property>
</object>
</child>
@@ -143,11 +170,15 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -159,9 +190,10 @@
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text"
translatable="yes">If checked, sorting will be case sensitive. Please note that
case sensitive sorting will not work well with most charsets.</property>
+ <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_pm_sort_case_sensitive_toggled"/>
+ <signal name="toggled"
handler="on_pm_sort_case_sensitive_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -176,6 +208,7 @@
<child type="label">
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label"
translatable="yes"><b>Playlist Sort Order</b></property>
<property name="use_markup">True</property>
</object>
@@ -192,6 +225,7 @@
<child type="tab">
<object class="GtkLabel" id="display_page_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Playlist
Display</property>
</object>
<packing>
@@ -202,33 +236,37 @@
</child>
</object>
<object class="GtkWindow" id="spl_window">
+ <property name="can_focus">False</property>
<property name="title" translatable="yes">Smart Playlist</property>
<property name="window_position">center-on-parent</property>
<child>
<object class="GtkVBox" id="vbox28">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
- <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkVBox" id="vbox63">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">7</property>
- <property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
<object class="GtkFrame" id="frame17">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment35">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkTable" id="table3">
<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">12</property>
@@ -236,11 +274,13 @@
<child>
<object class="GtkHBox" id="hbox40">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="spl_match_rules">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property
name="model">match_rules_model</property>
- <signal name="changed"
handler="spl_match_rules_changed"/>
+ <signal name="changed"
handler="spl_match_rules_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText"
id="renderer1"/>
<attributes>
@@ -266,9 +306,11 @@
<child>
<object class="GtkHBox" id="hbox39">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label34">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label"
translatable="yes">Match:</property>
</object>
<packing>
@@ -288,9 +330,11 @@
<child>
<object class="GtkHBox" id="hbox38">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label175">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label"
translatable="yes">Playlist name:</property>
</object>
<packing>
@@ -309,7 +353,7 @@
<object class="GtkEntry" id="spl_name_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -324,43 +368,50 @@
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes"><b>General
Options</b></property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="spl_rules_frame">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment34">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox30">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow"
id="scrolledwindow16">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
- <property
name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport10">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="resize_mode">queue</property>
+ <property
name="vscroll_policy">natural</property>
<child>
<object class="GtkAlignment"
id="spl_rules_table_align">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
@@ -370,6 +421,8 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -388,27 +441,32 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame18">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment33">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkHBox" id="hbox62">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkCheckButton"
id="spl_checklimits_button">
@@ -416,6 +474,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -430,7 +489,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">12</property>
- <property
name="invisible_char">●</property>
+ <property name="invisible_char">â</property>
<property name="width_chars">6</property>
</object>
<packing>
@@ -442,29 +501,35 @@
<child>
<object class="GtkComboBox"
id="spl_limittype_combobox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment32">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="hbox63">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel"
id="spl_limitsort_label">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label"
translatable="yes">Sort by:</property>
</object>
<packing>
@@ -476,9 +541,11 @@
<child>
<object class="GtkComboBox"
id="spl_limitsort_combobox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
@@ -497,6 +564,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -512,6 +580,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
@@ -528,6 +597,7 @@
<child type="label">
<object class="GtkLabel" id="label35">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label"
translatable="yes"><b>Advanced Options</b></property>
<property name="use_markup">True</property>
</object>
@@ -541,12 +611,15 @@
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox11">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
@@ -556,6 +629,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -571,6 +645,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -589,21 +664,4 @@
</object>
</child>
</object>
- <object class="GtkListStore" id="match_rules_model">
- <columns>
- <!-- column-name gchararray -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Any rules</col>
- </row>
- <row>
- <col id="0" translatable="yes">All rules</col>
- </row>
- <row>
- <col id="0" translatable="yes">Ignore rules</col>
- </row>
- </data>
- </object>
</interface>
diff --git a/plugins/playlist_display/playlist_display_spl.c
b/plugins/playlist_display/playlist_display_spl.c
index 69df9e9..17a6c20 100644
--- a/plugins/playlist_display/playlist_display_spl.c
+++ b/plugins/playlist_display/playlist_display_spl.c
@@ -290,22 +290,27 @@ static void spl_setup_combobox(GtkComboBox *cb, const
ComboEntry centries[], gin
const ComboEntry *ce = centries;
GtkCellRenderer *cell;
GtkListStore *store;
+ GtkTreeIter iter;
/* Set the model -- that is you cannot do a
gtk_combo_box_new_text()! This gives us the flexibility to
expand this function to set some graphic next to the text. */
store = gtk_list_store_new(1, G_TYPE_STRING);
gtk_combo_box_set_model(cb, GTK_TREE_MODEL (store));
- g_object_unref(store);
cell = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (cb), cell, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT (cb), cell, "text", 0,
NULL);
while (ce->str != NULL) {
- gtk_combo_box_append_text(cb, _(ce->str));
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _(ce->str),
+ -1);
++ce;
}
+
+ g_object_unref(store);
g_object_set_data(G_OBJECT (cb), "spl_centries", (gpointer) centries);
g_object_set_data(G_OBJECT (cb), "combo_set", "set");
if (cb_func)
@@ -954,7 +959,7 @@ static void spl_pl_ids_destroy(GArray *array) {
static GtkWidget *spl_create_hbox(GtkWidget *spl_window, Itdb_SPLRule *splr) {
GtkWidget *hbox = NULL;
ItdbSPLActionType at;
- GtkWidget *entry, *label, *combobox;
+ GtkWidget *label, *combobox;
gint index;
GArray *pl_ids = NULL;
Playlist *spl_orig;
@@ -980,10 +985,10 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
switch (at) {
case ITDB_SPLAT_STRING:
- entry = hbox_add_entry(hbox, splr, spl_ET_STRING);
+ hbox_add_entry(hbox, splr, spl_ET_STRING);
break;
case ITDB_SPLAT_INT:
- entry = hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
+ hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
/* check for unit */
index = comboentry_index_from_id(splfield_units, splr->field);
if (index != -1) {
@@ -993,14 +998,14 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
}
break;
case ITDB_SPLAT_DATE:
- entry = hbox_add_entry(hbox, splr, spl_ET_FROMVALUE_DATE);
+ hbox_add_entry(hbox, splr, spl_ET_FROMVALUE_DATE);
break;
case ITDB_SPLAT_RANGE_INT:
- entry = hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
+ hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
label = gtk_label_new(_("to"));
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX (hbox), label, FALSE, FALSE, 0);
- entry = hbox_add_entry(hbox, splr, spl_ET_TOVALUE),
+ hbox_add_entry(hbox, splr, spl_ET_TOVALUE),
/* check for unit */
index = comboentry_index_from_id(splfield_units, splr->field);
if (index != -1) {
@@ -1010,11 +1015,11 @@ static GtkWidget *spl_create_hbox(GtkWidget
*spl_window, Itdb_SPLRule *splr) {
}
break;
case ITDB_SPLAT_RANGE_DATE:
- entry = hbox_add_entry(hbox, splr, spl_ET_FROMVALUE_DATE);
+ hbox_add_entry(hbox, splr, spl_ET_FROMVALUE_DATE);
label = gtk_label_new(_("to"));
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX (hbox), label, FALSE, FALSE, 0);
- entry = hbox_add_entry(hbox, splr, spl_ET_TOVALUE_DATE);
+ hbox_add_entry(hbox, splr, spl_ET_TOVALUE_DATE);
/* check for unit */
index = comboentry_index_from_id(splfield_units, splr->field);
if (index != -1) {
@@ -1030,7 +1035,7 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
splr->fromunits = splat_inthelast_units_comboentries[0].id;
splr->fromvalue *= ((double) units) / splr->fromunits;
}
- entry = hbox_add_entry(hbox, splr, spl_ET_INTHELAST);
+ hbox_add_entry(hbox, splr, spl_ET_INTHELAST);
combobox = gtk_combo_box_new();
gtk_widget_show(combobox);
gtk_box_pack_start(GTK_BOX (hbox), combobox, TRUE, TRUE, 0);
@@ -1038,7 +1043,7 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
spl_set_combobox(GTK_COMBO_BOX (combobox),
splat_inthelast_units_comboentries, splr->fromunits, G_CALLBACK
(spl_fromunits_changed), spl_window);
break;
case ITDB_SPLAT_PLAYLIST:
- combobox = gtk_combo_box_new_text();
+ combobox = gtk_combo_box_text_new();
gtk_widget_show(combobox);
gtk_box_pack_start(GTK_BOX (hbox), combobox, TRUE, TRUE, 0);
pl_ids = g_array_sized_new(TRUE, TRUE, sizeof(guint64),
itdb_playlists_number(itdb));
@@ -1047,7 +1052,7 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
Playlist *pl = gl->next->data;
g_return_val_if_fail (pl, NULL);
if (pl != spl_orig) {
- gtk_combo_box_append_text(GTK_COMBO_BOX (combobox), pl->name);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (combobox),
pl->name);
g_array_append_val (pl_ids, pl->id);
}
gl = gl->next;
@@ -1078,7 +1083,7 @@ static GtkWidget *spl_create_hbox(GtkWidget *spl_window,
Itdb_SPLRule *splr) {
spl_set_combobox(GTK_COMBO_BOX (combobox), use_centries,
splr->fromvalue, G_CALLBACK (spl_videokind_comboentry_changed), spl_window);
}
else { /* not supported: display as standard INT */
- entry = hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
+ hbox_add_entry(hbox, splr, spl_ET_FROMVALUE);
}
break;
case ITDB_SPLAT_NONE:
diff --git a/plugins/repository_editor/repository.c
b/plugins/repository_editor/repository.c
index 12b2c98..79a5c34 100644
--- a/plugins/repository_editor/repository.c
+++ b/plugins/repository_editor/repository.c
@@ -180,7 +180,7 @@ void repository_init_model_number_combo(GtkComboBox *cb) {
messes up the entire layout) */
gtk_combo_box_set_model(cb, GTK_TREE_MODEL (store));
g_object_unref(store);
- gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY (cb), COL_STRING);
+ gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX (cb), COL_STRING);
gtk_cell_layout_clear(GTK_CELL_LAYOUT (cb));
renderer = gtk_cell_renderer_text_new();
diff --git a/plugins/repository_editor/repository_init.c
b/plugins/repository_editor/repository_init.c
index ed69c89..329a5eb 100644
--- a/plugins/repository_editor/repository_init.c
+++ b/plugins/repository_editor/repository_init.c
@@ -174,7 +174,7 @@ gboolean repository_ipod_init(iTunesDB *itdb) {
g_free(new_mount);
new_mount = NULL;
}
- model = gtk_combo_box_get_active_text(GTK_COMBO_BOX (GET_WIDGET
(ii->builder, IID_MODEL_COMBO)));
+ model = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT
(GET_WIDGET (ii->builder, IID_MODEL_COMBO)));
if ((strcmp(model, gettext(SELECT_OR_ENTER_YOUR_MODEL)) == 0) ||
(strlen(model) == 0)) { /* User didn't choose a model */
g_free(model);
model = NULL;
@@ -275,7 +275,7 @@ void repository_ipod_init_set_model(iTunesDB *itdb, const
gchar *old_model) {
switch (response) {
case GTK_RESPONSE_OK:
- model = gtk_combo_box_get_active_text(GTK_COMBO_BOX (GET_WIDGET
(builder, SIMD_MODEL_COMBO)));
+ model = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT
(GET_WIDGET (builder, SIMD_MODEL_COMBO)));
if (!model) {
gtkpod_warning(_("Could not determine the model you selected --
this could be a bug or incompatibilty in the GTK+ or glade library.\n\n"));
}
diff --git a/plugins/sorttab_display/display_sorttabs.c
b/plugins/sorttab_display/display_sorttabs.c
index 2b7397f..9d6ed15 100644
--- a/plugins/sorttab_display/display_sorttabs.c
+++ b/plugins/sorttab_display/display_sorttabs.c
@@ -3236,7 +3236,7 @@ gint st_get_sort_tab_number(gchar *text) {
dialog = GTK_DIALOG (mdialog);
- combo = gtk_combo_box_new_text();
+ combo = gtk_combo_box_text_new();
gtk_widget_show(combo);
gtk_container_add(GTK_CONTAINER
(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), combo);
@@ -3244,7 +3244,7 @@ gint st_get_sort_tab_number(gchar *text) {
/* Create list */
for (i = 1; i <= stn; ++i) {
sprintf(buf, "%d", i);
- gtk_combo_box_append_text(GTK_COMBO_BOX (combo), buf);
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (combo), buf);
}
result = gtk_dialog_run(GTK_DIALOG (mdialog));
@@ -3254,7 +3254,7 @@ gint st_get_sort_tab_number(gchar *text) {
nr = -1; /* no selection */
}
else {
- bufp = gtk_combo_box_get_active_text(GTK_COMBO_BOX (combo));
+ bufp = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT (combo));
nr = atoi(bufp) - 1;
last_nr = nr + 1;
}
diff --git a/plugins/track_display/display_tracks.c
b/plugins/track_display/display_tracks.c
index 15cabea..29f2383 100644
--- a/plugins/track_display/display_tracks.c
+++ b/plugins/track_display/display_tracks.c
@@ -621,7 +621,6 @@ void tm_add_track_to_track_model(Track *track, GtkTreeIter
*into_iter) {
}
gtk_list_store_set(get_model_as_store(model), &iter, READOUT_COL, track,
-1);
- /* update_model_view (model); -- not needed */
}
/* Used by remove_track() to remove track from model by calling
diff --git a/plugins/track_display/track_display_preferences.c
b/plugins/track_display/track_display_preferences.c
index 52a88e1..63abaae 100644
--- a/plugins/track_display/track_display_preferences.c
+++ b/plugins/track_display/track_display_preferences.c
@@ -378,6 +378,7 @@ static void trkcmd_combobox_changed(GtkComboBox *combo) {
static void populate_track_cmd_combo(GtkComboBox *combo) {
GtkListStore *store;
+ GtkTreeIter iter;
GtkCellRenderer *cell;
GList *trkcmds = gtkpod_get_registered_track_commands();
gint i = 0, activeindex = -1;
@@ -386,7 +387,6 @@ static void populate_track_cmd_combo(GtkComboBox *combo) {
store = gtk_list_store_new(1, G_TYPE_STRING);
gtk_combo_box_set_model(combo, GTK_TREE_MODEL (store));
- g_object_unref(store);
cell = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo), cell, TRUE);
@@ -397,13 +397,16 @@ static void populate_track_cmd_combo(GtkComboBox *combo) {
for (i = 0; i < g_list_length(trkcmds); ++i) {
TrackCommand *cmd = g_list_nth_data(trkcmds, i);
- gtk_combo_box_append_text(combo, _(track_command_get_text(cmd)));
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _(track_command_get_text(cmd)),
+ -1);
if (cmdpref && g_str_equal(cmdpref, track_command_get_id(cmd)))
activeindex = i;
}
if (activeindex > -1)
- gtk_combo_box_set_active(combo, activeindex);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), activeindex);
g_signal_connect (combo, "changed",
G_CALLBACK (trkcmd_combobox_changed),
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2