El vie, 08-08-2003 a las 20:00, Bastien Nocera escribió: [...] > > Don't blame me, I didn't look at anything but the patch ;) > So I guess it's alright. Could you still refactor > rb_song_info_backward_*_cb ? Done. > > Cheers -- Carlos Perelló Marín Debian GNU/Linux Sid (PowerPC) Linux Registered User #121232 mailto:carlos@pemas.net || mailto:carlos@gnome.org http://carlos.pemas.net Valencia - Spain
Index: ChangeLog =================================================================== RCS file: /cvs/gnome/rhythmbox/ChangeLog,v retrieving revision 1.563 diff -u -w -r1.563 ChangeLog --- ChangeLog 8 Aug 2003 06:46:08 -0000 1.563 +++ ChangeLog 8 Aug 2003 18:12:47 -0000 @@ -1,3 +1,10 @@ +2003-08-08 Carlos Perelló MarÃn <carlos@gnome.org> + + * lib/widgets/rb-song-info.c (rb_song_info_backward_clicked_cb), + (rb_song_info_init), (rb_song_info_update_buttons): + + Added support for the back button. + 2003-08-08 Colin Walters <walters@verbum.org> * lib/widgets/rb-node-view.c: (rb_node_view_set_property), Index: lib/widgets/rb-song-info.c =================================================================== RCS file: /cvs/gnome/rhythmbox/lib/widgets/rb-song-info.c,v retrieving revision 1.30 diff -u -w -r1.30 rb-song-info.c --- lib/widgets/rb-song-info.c 28 Jul 2003 02:19:24 -0000 1.30 +++ lib/widgets/rb-song-info.c 8 Aug 2003 18:12:48 -0000 @@ -79,6 +79,10 @@ static void rb_song_info_update_rating (RBSongInfo *song_info); static gboolean rb_song_info_update_current_values (RBSongInfo *song_info); +static void rb_song_info_navigation_move (RBSongInfo *song_info, RBDirection direction); + +static void rb_song_info_backward_clicked_cb (GtkWidget *button, + RBSongInfo *song_info); static void rb_song_info_forward_clicked_cb (GtkWidget *button, RBSongInfo *song_info); static void rb_song_info_view_changed_cb (RBNodeView *node_view, @@ -92,11 +96,12 @@ { RBNodeView *node_view; - /* infrmation on the displayed song */ + /* information on the displayed song */ RBNode *current_node; MonkeyMediaStreamInfo *current_info; /* the dialog widgets */ + GtkWidget *backward; GtkWidget *forward; GtkWidget *title; @@ -181,7 +186,7 @@ GladeXML *xml; GtkWidget *close, *label, *image, *hbox, *align, *cont; - /* create the dialog and some buttons forward - close */ + /* create the dialog and some buttons backward - forward - close */ song_info->priv = g_new0 (RBSongInfoPrivate, 1); g_signal_connect (G_OBJECT (song_info), @@ -191,9 +196,34 @@ gtk_dialog_set_has_separator (GTK_DIALOG (song_info), FALSE); + song_info->priv->backward = gtk_button_new (); + label = gtk_label_new_with_mnemonic (_("_Previous")); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), song_info->priv->backward); + image = gtk_image_new_from_stock (GTK_STOCK_GO_BACK, GTK_ICON_SIZE_BUTTON); + + hbox = gtk_hbox_new (FALSE, 2); + + align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); + + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + gtk_container_add (GTK_CONTAINER (song_info->priv->backward), align); + gtk_container_add (GTK_CONTAINER (align), hbox); + + gtk_widget_show_all (song_info->priv->backward); + + gtk_dialog_add_action_widget (GTK_DIALOG (song_info), + song_info->priv->backward, + GTK_RESPONSE_NONE); + g_signal_connect (G_OBJECT (song_info->priv->backward), + "clicked", + G_CALLBACK (rb_song_info_backward_clicked_cb), + song_info); + song_info->priv->forward = gtk_button_new (); - label = gtk_label_new_with_mnemonic (_("_Next Song")); + label = gtk_label_new_with_mnemonic (_("_Next")); gtk_label_set_mnemonic_widget (GTK_LABEL (label), song_info->priv->forward); image = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_BUTTON); @@ -782,12 +812,11 @@ } static void -rb_song_info_forward_clicked_cb (GtkWidget *button, - RBSongInfo *song_info) +rb_song_info_navigation_move (RBSongInfo *song_info, RBDirection direction) { RBNode *node = rb_node_view_get_node (song_info->priv->node_view, song_info->priv->current_node, - TRUE); + direction); g_return_if_fail (node != NULL); @@ -799,6 +828,21 @@ if (rb_song_info_update_current_values (song_info) == TRUE) rb_song_info_populate_dialog (song_info); + +} + +static void +rb_song_info_backward_clicked_cb (GtkWidget *button, + RBSongInfo *song_info) +{ + rb_song_info_navigation_move (song_info, RB_DIRECTION_UP); +} + +static void +rb_song_info_forward_clicked_cb (GtkWidget *button, + RBSongInfo *song_info) +{ + rb_song_info_navigation_move (song_info, RB_DIRECTION_DOWN); } /* @@ -813,10 +857,17 @@ g_return_if_fail (song_info->priv->node_view != NULL); g_return_if_fail (song_info->priv->current_node != NULL); + /* backward */ + node = rb_node_view_get_node (song_info->priv->node_view, + song_info->priv->current_node, + RB_DIRECTION_UP); + + gtk_widget_set_sensitive (song_info->priv->backward, + node != NULL); /* forward */ node = rb_node_view_get_node (song_info->priv->node_view, song_info->priv->current_node, - TRUE); + RB_DIRECTION_DOWN); gtk_widget_set_sensitive (song_info->priv->forward, node != NULL);
Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente