~ubuntu-branches/ubuntu/utopic/gnomeradio/utopic

« back to all changes in this revision

Viewing changes to .pc/gnomeradio-gtk_grid.patch/src/gui.c

  • Committer: Package Import Robot
  • Author(s): POJAR GEORGE
  • Date: 2013-12-24 10:38:24 UTC
  • Revision ID: package-import@ubuntu.com-20131224103824-ud5r2yrtyblv9ew6
Tags: 1.8-2ubuntu26
* debian/patches/gnomeradio-g_object.patch: Removed useless calls to the
  G_OBJECT() macro. (LP: #1267306)
* Updated debian/patches/gnomeradio-about.patch: Update COPYING file with
  latest versions from gnu.org. (LP: #1266203)
* Updated debian/patches/gnomeradio-gtk_stock.patch: UI make it more sleek, 
  remove relief from the UI buttons. (LP: #1265154)
* Updated debian/patches/gnomeradio-gtk_application.patch: Make the main
  window a GtkApplicationWindow.
* Updated debian/patches/gnomeradio-ngettext.patch: Fix localization, use
  g_dngettext instead of ngettext.
* Updated debian/patches/gnomeradio-record_information.patch: Use GDateTime
  instead of time_t.
* Moved changes from debian/patches/gnomeradio-thread_safe.patch to
  debian/patches/gnomeradio-alsa.patch and removed it as result.
* debian/control: Updated to Standards-Version 3.9.5, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        }
107
107
        
108
108
        if (radio_check_station(freq)) {
109
 
                char *text = g_strdup_printf(ngettext("%d station found",
110
 
                                                      "%d stations found",
111
 
                                                      g_list_length(fsd->stations) + 1),
112
 
                                             g_list_length(fsd->stations) + 1);
 
109
                guint num;
 
110
                char *text;
 
111
 
 
112
                num = g_list_length (fsd->stations) + 1;
 
113
                text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
 
114
                                        "%d station found",
 
115
                                        "%d stations found", num), num);
113
116
 
114
117
                gfloat *f = g_malloc(sizeof(gfloat));
115
118
                gtk_label_set_text(GTK_LABEL(fsd->label), text);
169
172
                gtk_widget_destroy(data.dialog);
170
173
        } else {
171
174
                if (g_list_length(data.stations) > 0) {
 
175
                        GtkWidget *dialog;
 
176
                        GList *l;
 
177
                        guint num;
 
178
                        char *text;
 
179
 
172
180
                        gfloat f = *((gfloat*)data.stations->data);
173
181
                        gtk_adjustment_set_value(adj, f*STEPS);
174
182
                        radio_set_freq(f);
175
183
                        
176
 
                        GtkWidget *dialog;
177
 
                        GList *ptr;
178
 
                        
179
 
                        char *text = g_strdup_printf (ngettext ("%d station found.\n"
180
 
                                                                "Do you want to add it as preset?",
181
 
                                                                "%d stations found.\n"
182
 
                                                                "Do you want to add them as presets?", g_list_length (data.stations)),
183
 
                                                      g_list_length (data.stations));
 
184
                        num = g_list_length (data.stations);
 
185
                        text = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
 
186
                                                "%d station found.\nDo you want to add it as preset?",
 
187
                                                "%d stations found.\nDo you want to add them as presets?", num), num);
184
188
                        
185
189
                        dialog = gtk_message_dialog_new(GTK_WINDOW(app), DIALOG_FLAGS, GTK_MESSAGE_QUESTION,
186
190
                                        GTK_BUTTONS_YES_NO, "%s", text);
189
193
                        int response = gtk_dialog_run(GTK_DIALOG(dialog));
190
194
                        gtk_widget_destroy(dialog);
191
195
 
192
 
                        for (ptr = data.stations; ptr; ptr = ptr->next) {
 
196
                        for (l = data.stations; l; l = l->next) {
193
197
                                if (response == GTK_RESPONSE_YES) {
194
198
                                        preset *ps = g_malloc0(sizeof(preset));
195
199
                                        ps->title = g_strdup(_("unnamed"));
196
 
                                        ps->freq = *((gfloat*)ptr->data);
 
200
                                        ps->freq = *((gfloat*)l->data);
197
201
                                        settings.presets = g_list_append(settings.presets, ps);
198
202
                                }
199
 
                                g_free(ptr->data);
 
203
                                g_free(l->data);
200
204
                        }       
201
205
                }
202
206
        }       
823
827
        char *translators = _("TRANSLATORS");
824
828
        char *license = get_license_text ();
825
829
 
826
 
        if (about)
827
 
        {
 
830
        if (about) {
828
831
                gtk_window_present (GTK_WINDOW (about));
829
832
                return;
830
833
        }