From 7c796baa9bc08607c1505ba3889c652019e33f6f Mon Sep 17 00:00:00 2001 From: "rafael@riseup.net" Date: Tue, 14 May 2013 14:52:56 +0000 Subject: [PATCH] fix for deprecation of old gtk_combo behavior in gtk --- darkice-gui/trunk/config_files.c | 2 +- darkice-gui/trunk/darksnow.c | 14 ++++++-------- darkice-gui/trunk/interface.c | 7 ++++++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/darkice-gui/trunk/config_files.c b/darkice-gui/trunk/config_files.c index 3433bd9..9fa3bd5 100644 --- a/darkice-gui/trunk/config_files.c +++ b/darkice-gui/trunk/config_files.c @@ -84,7 +84,7 @@ gboolean darksnow_config_store(char opt, char *save_path) { adddate = (char) (gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (checkbutton_adddate) ))? '1': '0'; /* Combo box inputs */ - icecast = (char *) gtk_entry_get_text ( GTK_ENTRY( GTK_COMBO(combo_icecast)->entry)); + icecast = (char *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo_icecast)); format = (char *) gtk_entry_get_text ( GTK_ENTRY(GTK_COMBO (combo_format)->entry )); bitrate = (char *) gtk_entry_get_text ( GTK_ENTRY(GTK_COMBO(combo_bitrate)->entry)); bitratemode = (char *) gtk_entry_get_text ( GTK_ENTRY(GTK_COMBO(combo_bitratemode)->entry)); diff --git a/darkice-gui/trunk/darksnow.c b/darkice-gui/trunk/darksnow.c index 1e72d39..7f7d364 100644 --- a/darkice-gui/trunk/darksnow.c +++ b/darkice-gui/trunk/darksnow.c @@ -3,7 +3,7 @@ * * This source code is free software; you can redistribute it and/or * modify it under the terms of the GNU Public License as published - * by the Free Software Foundation; either version 2 of the License, + * by the Free Software Foundation; either version 3 of the License, * or (at your option) any later version. * * This source code is distributed in the hope that it will be useful, @@ -230,13 +230,11 @@ int main( int argc, char *argv[], char *envp[]) { /* Server Options Widgets */ label_icecast = gtk_label_new ( gettext("Streaming Destination: ")); - combo_icecast = gtk_combo_new (); - glist_icecast = NULL; - glist_icecast = g_list_append (glist_icecast, "Icecast 1"); - glist_icecast = g_list_append (glist_icecast, "Icecast 2"); - glist_icecast = g_list_append (glist_icecast, "Shoutcast"); - gtk_combo_set_popdown_strings (GTK_COMBO (combo_icecast), glist_icecast); - gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_icecast)->entry), "Icecast 2"); + combo_icecast = gtk_combo_box_entry_new_text(); + gchar *txt[] = {"Icecast 1", "Icecast 2", "Shoutcast", NULL }; + gchar **p=txt; + while (*p) gtk_combo_box_append_text(GTK_COMBO_BOX(combo_icecast), *p++); + gtk_combo_box_set_active ( GTK_COMBO_BOX(combo_icecast), 1); label_server = gtk_label_new ( gettext("Server: ")); entry_server = gtk_entry_new (); diff --git a/darkice-gui/trunk/interface.c b/darkice-gui/trunk/interface.c index acd47fb..b26da92 100644 --- a/darkice-gui/trunk/interface.c +++ b/darkice-gui/trunk/interface.c @@ -192,7 +192,12 @@ void dark_put_in_box ( GtkWidget *widget, gpointer data ) { gtk_entry_set_text ( (GtkEntry *) entry_server, server); gtk_entry_set_text ( (GtkEntry *) entry_remotedump, remotedump); gtk_entry_set_text ( (GtkEntry *) entry_localdump, localdump); - gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_icecast)->entry), icecast); + if (strcmp(icecast, "Icecast 1") == 0) + gtk_combo_box_set_active ( GTK_COMBO_BOX(combo_icecast), 0); + if (strcmp(icecast, "Icecast 2") == 0) + gtk_combo_box_set_active ( GTK_COMBO_BOX(combo_icecast), 1); + if (strcmp(icecast, "Shoutcast") == 0) + gtk_combo_box_set_active ( GTK_COMBO_BOX(combo_icecast), 2); gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_format)->entry), format); gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitrate)->entry), bitrate); gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitratemode)->entry), bitratemode);