Commit 1fa786db authored by Jean-Paul Saman's avatar Jean-Paul Saman

PDA interface:

* cleanup code
* cleanup interface
parent c986d970
......@@ -2076,36 +2076,31 @@
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="labelCopyright">
<property name="width_request">0</property>
<property name="height_request">0</property>
<widget class="GtkImage" id="aboutImage">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="label" translatable="yes">(c) 1996-2003 the VideoLAN team</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="pixbuf">vlc48x48.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">16</property>
<property name="y">48</property>
<property name="x">0</property>
<property name="y">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="labelProgramName">
<property name="width_request">0</property>
<property name="height_request">0</property>
<widget class="GtkLabel" id="labelDescription">
<property name="width_request">200</property>
<property name="height_request">112</property>
<property name="visible">True</property>
<property name="label" translatable="yes">VLC media player</property>
<property name="label" translatable="yes">The VideoLAN Client is a MPEG, MPEG 2, MP3, DivX player, that accepts input from local or network sources and is licensed under the GPL (http://www.gnu.org/copyleft/gpl.html).</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
......@@ -2114,8 +2109,8 @@
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">64</property>
<property name="y">16</property>
<property name="x">16</property>
<property name="y">112</property>
</packing>
</child>
......@@ -2124,7 +2119,7 @@
<property name="width_request">208</property>
<property name="height_request">32</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Authors: The VideoLAN Team, http://www.videolan.org</property>
<property name="label" translatable="yes">Authors: The VideoLAN Team, http://www.videolan.org/team/</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
......@@ -2142,14 +2137,14 @@
</child>
<child>
<widget class="GtkLabel" id="labelDescription">
<property name="width_request">208</property>
<property name="height_request">72</property>
<widget class="GtkLabel" id="labelProgramName">
<property name="width_request">152</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="label" translatable="yes">The VideoLAN Client is a MPEG, MPEG 2, MP3, DivX player, that accepts input from local or network sources.</property>
<property name="label" translatable="yes">VLC media player</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
......@@ -2158,17 +2153,17 @@
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">16</property>
<property name="y">112</property>
<property name="x">48</property>
<property name="y">16</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="labelWebSite">
<widget class="GtkLabel" id="labelCopyright">
<property name="width_request">208</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="label" translatable="yes">http://www.videolan.org</property>
<property name="label" translatable="yes">(C) 1996-2003 the VideoLAN team</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
......@@ -2181,24 +2176,7 @@
</widget>
<packing>
<property name="x">16</property>
<property name="y">192</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="aboutImage">
<property name="width_request">48</property>
<property name="height_request">48</property>
<property name="visible">True</property>
<property name="pixbuf">vlc48x48.png</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">0</property>
<property name="y">0</property>
<property name="y">48</property>
</packing>
</child>
</widget>
......
......@@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.5 2003/11/07 13:01:51 jpsaman Exp $
* $Id: pda_callbacks.c,v 1.6 2003/11/07 14:15:23 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -324,68 +324,6 @@ onPDADeleteEvent (GtkWidget *widget,
}
void
onFileOpen (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( button );
GtkListStore *p_list;
if (p_intf->p_sys->p_notebook)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gtk_notebook_set_page(p_intf->p_sys->p_notebook,0);
}
gdk_window_raise( p_intf->p_sys->p_window->window );
if (p_intf->p_sys->p_tvfile)
{
/* Get new directory listing */
p_list = gtk_list_store_new (5,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_UINT64,
G_TYPE_STRING,
G_TYPE_STRING);
ReadDirectory(p_list, ".");
/* Update TreeView */
gtk_tree_view_set_model(p_intf->p_sys->p_tvfile, (GtkTreeModel*) p_list);
g_object_unref(p_list);
}
}
void
onPlaylist (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET(button) );
// Toggle notebook
if (p_intf->p_sys->p_notebook)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gtk_notebook_set_page(p_intf->p_sys->p_notebook,1);
}
gdk_window_raise( p_intf->p_sys->p_window->window );
}
void
onPreferences (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) );
if (p_intf->p_sys->p_notebook)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gtk_notebook_set_page(p_intf->p_sys->p_notebook,2);
}
gdk_window_raise( p_intf->p_sys->p_window->window );
}
void
onRewind (GtkButton *button,
gpointer user_data)
......@@ -416,30 +354,22 @@ void
onPlay (GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET( button ) );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
/* Display open page */
onFileOpen(button,user_data);
}
/* If the playlist is empty, open a file requester instead */
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
gdk_window_lower( p_intf->p_sys->p_window->window );
}
else
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
/* Display open page */
onFileOpen(button,user_data);
intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET( button ) );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
}
else
{
vlc_mutex_unlock( &p_playlist->object_lock );
}
vlc_object_release( p_playlist );
}
}
......@@ -455,7 +385,6 @@ onStop (GtkButton *button,
{
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
gdk_window_raise( p_intf->p_sys->p_window->window );
}
}
......@@ -483,9 +412,8 @@ onAbout (GtkButton *button,
if (p_intf->p_sys->p_notebook)
{
gtk_widget_show( GTK_WIDGET(p_intf->p_sys->p_notebook) );
gtk_notebook_set_page(p_intf->p_sys->p_notebook,3);
gtk_notebook_set_page(p_intf->p_sys->p_notebook,6);
}
gdk_window_raise( p_intf->p_sys->p_window->window );
}
......@@ -536,13 +464,13 @@ void addSelectedToPlaylist(GtkTreeModel *model,
GtkTreeIter p_play_iter;
p_play_model = gtk_tree_view_get_model(p_tvplaylist);
/* Add a new row to the playlist treeview model */
gtk_list_store_append (GTK_LIST_STORE(p_play_model), &p_play_iter);
gtk_list_store_set (GTK_LIST_STORE(p_play_model), &p_play_iter,
0, filename, /* Add path to it !!! */
1, "00:00:00",
1, "no info",
-1 );
/* do we need to unref ?? */
}
else
g_print("Error obtaining pointer to Play List");
......
......@@ -2,7 +2,7 @@
* callbacks.h : pda plugin for vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: pda_callbacks.h,v 1.3 2003/11/07 13:01:51 jpsaman Exp $
* $Id: pda_callbacks.h,v 1.4 2003/11/07 14:15:23 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -35,18 +35,6 @@ onPDADeleteEvent (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
onFileOpen (GtkButton *button,
gpointer user_data);
void
onPlaylist (GtkButton *button,
gpointer user_data);
void
onPreferences (GtkButton *button,
gpointer user_data);
void
onRewind (GtkButton *button,
gpointer user_data);
......
......@@ -34,9 +34,6 @@ create_pda (void)
GtkWidget *vbox;
GtkWidget *toolbar;
GtkWidget *tmp_toolbar_icon;
GtkWidget *tbOpen;
GtkWidget *tbPlaylist;
GtkWidget *tbPreferences;
GtkWidget *tbRewind;
GtkWidget *tbPause;
GtkWidget *tbPlay;
......@@ -144,12 +141,11 @@ create_pda (void)
GtkWidget *scrolledwindow3;
GtkWidget *viewport1;
GtkWidget *fixed2;
GtkWidget *labelCopyright;
GtkWidget *labelProgramName;
GtkWidget *labelAuthors;
GtkWidget *labelDescription;
GtkWidget *labelWebSite;
GtkWidget *aboutImage;
GtkWidget *labelDescription;
GtkWidget *labelAuthors;
GtkWidget *labelProgramName;
GtkWidget *labelCopyright;
GtkWidget *about;
pda = gtk_window_new (GTK_WINDOW_TOPLEVEL);
......@@ -175,42 +171,6 @@ create_pda (void)
gtk_widget_set_size_request (toolbar, 240, 22);
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
tmp_toolbar_icon = create_pixmap (pda, "pda-openb16x16.xpm");
tbOpen = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Open"),
_("File"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar)->children)->data))->label), TRUE);
gtk_widget_set_name (tbOpen, "tbOpen");
gtk_widget_show (tbOpen);
gtk_widget_set_size_request (tbOpen, 22, 22);
tmp_toolbar_icon = create_pixmap (pda, "pda-playlistb16x16.xpm");
tbPlaylist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Playlist"),
_("Playlist"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar)->children)->data))->label), TRUE);
gtk_widget_set_name (tbPlaylist, "tbPlaylist");
gtk_widget_show (tbPlaylist);
gtk_widget_set_size_request (tbPlaylist, 22, 22);
tmp_toolbar_icon = create_pixmap (pda, "pda-preferencesb16x16.xpm");
tbPreferences = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON,
NULL,
_("Preferences"),
_("Preferences"), NULL,
tmp_toolbar_icon, NULL, NULL);
gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar)->children)->data))->label), TRUE);
gtk_widget_set_name (tbPreferences, "tbPreferences");
gtk_widget_show (tbPreferences);
gtk_widget_set_size_request (tbPreferences, 22, 22);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
tmp_toolbar_icon = create_pixmap (pda, "pda-rewindb16x16.xpm");
......@@ -287,7 +247,7 @@ create_pda (void)
gtk_widget_show (tbAbout);
gtk_widget_set_size_request (tbAbout, 22, 22);
timeLabel = gtk_label_new (_("0:00:00"));
timeLabel = gtk_label_new (_("00:00:00"));
gtk_widget_set_name (timeLabel, "timeLabel");
gtk_widget_show (timeLabel);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
......@@ -911,20 +871,21 @@ create_pda (void)
gtk_widget_show (fixed2);
gtk_container_add (GTK_CONTAINER (viewport1), fixed2);
labelCopyright = gtk_label_new (_("(c) 1996-2003 the VideoLAN team"));
gtk_widget_set_name (labelCopyright, "labelCopyright");
gtk_widget_show (labelCopyright);
gtk_fixed_put (GTK_FIXED (fixed2), labelCopyright, 16, 48);
gtk_widget_set_size_request (labelCopyright, 0, 0);
aboutImage = create_pixmap (pda, "vlc48x48.png");
gtk_widget_set_name (aboutImage, "aboutImage");
gtk_widget_show (aboutImage);
gtk_fixed_put (GTK_FIXED (fixed2), aboutImage, 0, 0);
gtk_widget_set_size_request (aboutImage, 48, 48);
labelProgramName = gtk_label_new (_("VLC media player"));
gtk_widget_set_name (labelProgramName, "labelProgramName");
gtk_widget_show (labelProgramName);
gtk_fixed_put (GTK_FIXED (fixed2), labelProgramName, 64, 16);
gtk_widget_set_size_request (labelProgramName, 0, 0);
gtk_label_set_line_wrap (GTK_LABEL (labelProgramName), TRUE);
labelDescription = gtk_label_new (_("The VideoLAN Client is a MPEG, MPEG 2, MP3, DivX player, that accepts input from local or network sources and is licensed under the GPL (http://www.gnu.org/copyleft/gpl.html)."));
gtk_widget_set_name (labelDescription, "labelDescription");
gtk_widget_show (labelDescription);
gtk_fixed_put (GTK_FIXED (fixed2), labelDescription, 16, 112);
gtk_widget_set_size_request (labelDescription, 200, 112);
gtk_label_set_justify (GTK_LABEL (labelDescription), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (labelDescription), TRUE);
labelAuthors = gtk_label_new (_("Authors: The VideoLAN Team, http://www.videolan.org"));
labelAuthors = gtk_label_new (_("Authors: The VideoLAN Team, http://www.videolan.org/team/"));
gtk_widget_set_name (labelAuthors, "labelAuthors");
gtk_widget_show (labelAuthors);
gtk_fixed_put (GTK_FIXED (fixed2), labelAuthors, 16, 72);
......@@ -932,25 +893,18 @@ create_pda (void)
gtk_label_set_justify (GTK_LABEL (labelAuthors), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (labelAuthors), TRUE);
labelDescription = gtk_label_new (_("The VideoLAN Client is a MPEG, MPEG 2, MP3, DivX player, that accepts input from local or network sources."));
gtk_widget_set_name (labelDescription, "labelDescription");
gtk_widget_show (labelDescription);
gtk_fixed_put (GTK_FIXED (fixed2), labelDescription, 16, 112);
gtk_widget_set_size_request (labelDescription, 208, 72);
gtk_label_set_justify (GTK_LABEL (labelDescription), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (labelDescription), TRUE);
labelWebSite = gtk_label_new (_("http://www.videolan.org"));
gtk_widget_set_name (labelWebSite, "labelWebSite");
gtk_widget_show (labelWebSite);
gtk_fixed_put (GTK_FIXED (fixed2), labelWebSite, 16, 192);
gtk_widget_set_size_request (labelWebSite, 208, 16);
labelProgramName = gtk_label_new (_("VLC media player"));
gtk_widget_set_name (labelProgramName, "labelProgramName");
gtk_widget_show (labelProgramName);
gtk_fixed_put (GTK_FIXED (fixed2), labelProgramName, 48, 16);
gtk_widget_set_size_request (labelProgramName, 152, 16);
gtk_label_set_line_wrap (GTK_LABEL (labelProgramName), TRUE);
aboutImage = create_pixmap (pda, "vlc48x48.png");
gtk_widget_set_name (aboutImage, "aboutImage");
gtk_widget_show (aboutImage);
gtk_fixed_put (GTK_FIXED (fixed2), aboutImage, 0, 0);
gtk_widget_set_size_request (aboutImage, 48, 48);
labelCopyright = gtk_label_new (_("(C) 1996-2003 the VideoLAN team"));
gtk_widget_set_name (labelCopyright, "labelCopyright");
gtk_widget_show (labelCopyright);
gtk_fixed_put (GTK_FIXED (fixed2), labelCopyright, 16, 48);
gtk_widget_set_size_request (labelCopyright, 208, 16);
about = gtk_label_new (_("About"));
gtk_widget_set_name (about, "about");
......@@ -960,15 +914,6 @@ create_pda (void)
g_signal_connect ((gpointer) pda, "delete_event",
G_CALLBACK (onPDADeleteEvent),
NULL);
g_signal_connect ((gpointer) tbOpen, "clicked",
G_CALLBACK (onFileOpen),
NULL);
g_signal_connect ((gpointer) tbPlaylist, "clicked",
G_CALLBACK (onPlaylist),
NULL);
g_signal_connect ((gpointer) tbPreferences, "clicked",
G_CALLBACK (onPreferences),
NULL);
g_signal_connect ((gpointer) tbRewind, "clicked",
G_CALLBACK (onRewind),
NULL);
......@@ -1136,9 +1081,6 @@ create_pda (void)
GLADE_HOOKUP_OBJECT_NO_REF (pda, pda, "pda");
GLADE_HOOKUP_OBJECT (pda, vbox, "vbox");
GLADE_HOOKUP_OBJECT (pda, toolbar, "toolbar");
GLADE_HOOKUP_OBJECT (pda, tbOpen, "tbOpen");
GLADE_HOOKUP_OBJECT (pda, tbPlaylist, "tbPlaylist");
GLADE_HOOKUP_OBJECT (pda, tbPreferences, "tbPreferences");
GLADE_HOOKUP_OBJECT (pda, tbRewind, "tbRewind");
GLADE_HOOKUP_OBJECT (pda, tbPause, "tbPause");
GLADE_HOOKUP_OBJECT (pda, tbPlay, "tbPlay");
......@@ -1238,12 +1180,11 @@ create_pda (void)
GLADE_HOOKUP_OBJECT (pda, scrolledwindow3, "scrolledwindow3");
GLADE_HOOKUP_OBJECT (pda, viewport1, "viewport1");
GLADE_HOOKUP_OBJECT (pda, fixed2, "fixed2");
GLADE_HOOKUP_OBJECT (pda, labelCopyright, "labelCopyright");
GLADE_HOOKUP_OBJECT (pda, labelProgramName, "labelProgramName");
GLADE_HOOKUP_OBJECT (pda, labelAuthors, "labelAuthors");
GLADE_HOOKUP_OBJECT (pda, labelDescription, "labelDescription");
GLADE_HOOKUP_OBJECT (pda, labelWebSite, "labelWebSite");
GLADE_HOOKUP_OBJECT (pda, aboutImage, "aboutImage");
GLADE_HOOKUP_OBJECT (pda, labelDescription, "labelDescription");
GLADE_HOOKUP_OBJECT (pda, labelAuthors, "labelAuthors");
GLADE_HOOKUP_OBJECT (pda, labelProgramName, "labelProgramName");
GLADE_HOOKUP_OBJECT (pda, labelCopyright, "labelCopyright");
GLADE_HOOKUP_OBJECT (pda, about, "about");
return pda;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment