"The Next/Prev buttons should actually play the next/Prev entry, I
would think."

I am thinking that it might be better just leave the "Play" button (remove Next/Prev as it might be confusing).

Thanks

Jorg Schuler <Jorg.Schuler@gmx.de> wrote:
Marcelo Varanda wrote:
> Again... but now with -u option and sent to a file (attached)

I was looking at your 'path_4_buttons' since I didn't want to dissect
the later patch you have sent.

Should be quite nice with the following changes:

1) no '//' for comments
2) get rid of the new static variable selected_tracks_dspl -- it's not
needed. tools_play_tracks() does not require the GList passed after it
returns.
3) Buttons should be on the right side
4) I'm used to having the Play button in the middle -- if that's just
me, leave it as it is.
5) Comments at the beginning of complex functions explaining what it does.
6) The Next/Prev buttons should actually play the next/Prev entry, I
would think.

Cheers,


JCS.


P.S.: Patch attached for reference.
Index: gtkpod/gtkpod.glade
--- gtkpod/gtkpod.glade 24 Jun 2006 15:39:18 -0000 1.212
+++ gtkpod/gtkpod.glade 23 Aug 2006 05:28:08 -0000
@@ -1339,6 +1339,60 @@
True


+
+ True
+ Add Files or Directories
+ Play
+ True
+ gtk-media-play
+ True
+ True
+ False
+
+

+
+ False
+ True
+

+

+
+
+
+ True
+ Add Files or Directories
+ Prev.
+ True
+ gtk-media-rewind
+ True
+ True
+ False
+
+

+
+ False
+ True
+

+

+
+
+
+ True
+ Add Files or Directories
+ Next
+ True
+ gtk-media-forward
+ True
+ True
+ False
+
+

+
+ False
+ True
+

+

+
+

True
Try to load contents of all connected iPods. For each iPod a separate repository must be set up.
Index: gtkpod/gtkpod.gladep
--- gtkpod/gtkpod.gladep 15 Jun 2003 15:39:02 -0000 1.3
+++ gtkpod/gtkpod.gladep 23 Aug 2006 05:28:08 -0000
@@ -4,5 +4,6 @@

Gtkpod
gtkpod
+ src_glade
FALSE

Index: gtkpod/src/display.c
--- gtkpod/src/display.c 24 Jun 2006 15:39:22 -0000 1.149
+++ gtkpod/src/display.c 23 Aug 2006 05:28:09 -0000
@@ -48,6 +48,9 @@

GtkWidget *gtkpod_window = NULL;

+static GList *selected_tracks_dspl = NULL;
+
+
/* used for stopping of display refresh */
gint stop_add = SORT_TAB_MAX;

@@ -2004,3 +2007,34 @@
message_sb_no_itdb_selected ();
}
}
+
+
+void
+play_toolbar_button_event (GtkToolButton *toolbutton,
+ gpointer user_data)
+{
+ if (selected_tracks_dspl) g_list_free (selected_tracks_dspl);
+ selected_tracks_dspl = tm_get_selected_tracks();
+ if(selected_tracks_dspl)
+ {
+ tools_play_tracks (selected_tracks_dspl);
+ }
+
+}
+
+
+void
+rewind_toolbar_button_event (GtkToolButton *toolbutton,
+ gpointer user_data)
+{
+ tm_select_next_row(1);
+}
+
+
+void
+next_toolbat_button_event (GtkToolButton *toolbutton,
+ gpointer user_data)
+{
+ tm_select_next_row(0);
+}
+
Index: gtkpod/src/display.h
--- gtkpod/src/display.h 24 Jun 2006 15:39:22 -0000 1.115
+++ gtkpod/src/display.h 23 Aug 2006 05:28:09 -0000
@@ -339,4 +339,6 @@

void spl_edit (Playlist *spl);
void spl_edit_new (iTunesDB *itdb, gchar *name, gint32 pos);
+void tm_select_next_row (gint Next0_Prev1);
+
#endif
Index: gtkpod/src/display_songs.c
--- gtkpod/src/display_songs.c 23 Jun 2006 16:03:05 -0000 1.111
+++ gtkpod/src/display_songs.c 23 Aug 2006 05:28:14 -0000
@@ -2438,3 +2438,49 @@
C_FREE (buf);
return TRUE;
}
+
+void tm_select_next_row (gint Next0_Prev1)
+{
+ if (track_treeview)
+ {
+ GtkTreePath *path;
+ GdkRectangle rect;
+ GtkTreeSelection *selection;
+ gint delta;
+
+ gtk_tree_view_get_cursor ( track_treeview,
+ &path,
+ NULL);
+
+ if (path == NULL) return;
+
+ gtk_tree_view_get_cell_area (track_treeview,
+ path,
+ NULL,
+ &rect);
+ if (path == NULL) return;
+
+ if (Next0_Prev1) delta = -rect.height/2;
+ else delta = rect.height + rect.height/2;
+
+ gtk_tree_view_get_path_at_pos (track_treeview,
+ 1, rect.y + delta , &path, NULL, NULL, NULL);
+
+ if (path == NULL) return;
+
+ /* deselect current rows */
+ selection = gtk_tree_view_get_selection (track_treeview);
+ gtk_tree_selection_unselect_all(selection);
+
+ gtk_tree_selection_select_path ( selection,
+ path);
+
+ gtk_tree_view_set_cursor ( track_treeview,
+ path,
+ NULL,
+ FALSE );
+
+ gtk_tree_path_free (path);
+
+ }
+}
Index: gtkpod (copy)/src/display.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.h,v
retrieving revision 1.115
diff -u -r1.115 display.h
--- gtkpod (copy)/src/display.h 24 Jun 2006 15:39:22 -0000 1.115
+++ gtkpod (copy)/src/display.h 23 Aug 2006 05:28:22 -0000
Index: gtkpod (copy)/src/display_songs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_songs.c,v
retrieving revision 1.111
diff -u -r1.111 display_songs.c
--- gtkpod (copy)/src/display_songs.c 23 Jun 2006 16:03:05 -0000 1.111
+++ gtkpod (copy)/src/display_songs.c 23 Aug 2006 05:28:22 -0000
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
Gtkpod-devel mailing list
Gtkpod-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-devel