fix for deprecation of old gtk_combo behavior in gtk

This commit is contained in:
rafael@riseup.net 2013-05-14 14:52:56 +00:00
parent c70968d825
commit 7c796baa9b
3 changed files with 13 additions and 10 deletions

View File

@ -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'; adddate = (char) (gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (checkbutton_adddate) ))? '1': '0';
/* Combo box inputs */ /* 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 )); 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)); 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)); bitratemode = (char *) gtk_entry_get_text ( GTK_ENTRY(GTK_COMBO(combo_bitratemode)->entry));

View File

@ -3,7 +3,7 @@
* *
* This source code is free software; you can redistribute it and/or * This source code is free software; you can redistribute it and/or
* modify it under the terms of the GNU Public License as published * 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. * or (at your option) any later version.
* *
* This source code is distributed in the hope that it will be useful, * 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 */ /* Server Options Widgets */
label_icecast = gtk_label_new ( gettext("Streaming Destination: ")); label_icecast = gtk_label_new ( gettext("Streaming Destination: "));
combo_icecast = gtk_combo_new (); combo_icecast = gtk_combo_box_entry_new_text();
glist_icecast = NULL; gchar *txt[] = {"Icecast 1", "Icecast 2", "Shoutcast", NULL };
glist_icecast = g_list_append (glist_icecast, "Icecast 1"); gchar **p=txt;
glist_icecast = g_list_append (glist_icecast, "Icecast 2"); while (*p) gtk_combo_box_append_text(GTK_COMBO_BOX(combo_icecast), *p++);
glist_icecast = g_list_append (glist_icecast, "Shoutcast"); gtk_combo_box_set_active ( GTK_COMBO_BOX(combo_icecast), 1);
gtk_combo_set_popdown_strings (GTK_COMBO (combo_icecast), glist_icecast);
gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_icecast)->entry), "Icecast 2");
label_server = gtk_label_new ( gettext("Server: ")); label_server = gtk_label_new ( gettext("Server: "));
entry_server = gtk_entry_new (); entry_server = gtk_entry_new ();

View File

@ -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_server, server);
gtk_entry_set_text ( (GtkEntry *) entry_remotedump, remotedump); gtk_entry_set_text ( (GtkEntry *) entry_remotedump, remotedump);
gtk_entry_set_text ( (GtkEntry *) entry_localdump, localdump); 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_format)->entry), format);
gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitrate)->entry), bitrate); gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitrate)->entry), bitrate);
gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitratemode)->entry), bitratemode); gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo_bitratemode)->entry), bitratemode);