Project

General

Profile

audacious_infowin_prev.diff

Alex Fedorov, January 14, 2019 16:03

View differences:

audacious-3.10.1/src/libaudgui/infowin.cc 2019-01-13 22:10:01.094931329 +0300
231 231
        ministatus_display_message (_("Save error"));
232 232
}
233 233

  
234
static void infowin_next ()
234
static void infowin_open_for (int entry)
235 235
{
236
    int entry = current_entry + 1;
237

  
238
    if (entry < current_playlist.n_entries ())
236
    if (entry >= 0 && entry < current_playlist.n_entries ())
239 237
    {
240 238
        current_playlist.select_all (false);
241 239
        current_playlist.select_entry (entry, true);
......
246 244
        audgui_infowin_hide ();
247 245
}
248 246

  
247
static void infowin_prev ()
248
{
249
    int entry = current_entry - 1;
250

  
251
    infowin_open_for(entry);
252
}
253

  
254
static void infowin_next ()
255
{
256
    int entry = current_entry + 1;
257

  
258
    infowin_open_for(entry);
259
}
260

  
249 261
static void genre_fill (GtkWidget * combo)
250 262
{
251 263
    GList * list = nullptr;
......
407 419
    GtkWidget * close_button = audgui_button_new (_("_Close"), "window-close",
408 420
     (AudguiCallback) audgui_infowin_hide, nullptr);
409 421

  
422
    GtkWidget * prev_button = audgui_button_new (_("_Prev"), "go-previous",
423
     (AudguiCallback) infowin_prev, nullptr);
424
    
410 425
    GtkWidget * next_button = audgui_button_new (_("_Next"), "go-next",
411 426
     (AudguiCallback) infowin_next, nullptr);
412 427

  
413 428
    gtk_box_pack_end ((GtkBox *) bottom_hbox, close_button, false, false, 0);
414 429
    gtk_box_pack_end ((GtkBox *) bottom_hbox, next_button, false, false, 0);
430
    gtk_box_pack_end ((GtkBox *) bottom_hbox, prev_button, false, false, 0);
415 431
    gtk_box_pack_end ((GtkBox *) bottom_hbox, widgets.apply, false, false, 0);
416 432

  
417 433
    audgui_destroy_on_escape (infowin);