Commit d377635a authored by Jean-Paul Saman's avatar Jean-Paul Saman

- File and directory listing show unix permissions.

parent a444052d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin. * callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.5 2002/08/17 13:33:00 jpsaman Exp $ * $Id: callbacks.c,v 1.6 2002/08/18 20:36:04 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -51,8 +51,7 @@ ...@@ -51,8 +51,7 @@
/*#include "netutils.h"*/ /*#include "netutils.h"*/
static void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url ); static void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url );
static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data ); static char* get_file_perm(const char *path);
static char* get_file_type(const char *path);
/***************************************************************************** /*****************************************************************************
* Useful function to retrieve p_intf * Useful function to retrieve p_intf
...@@ -112,27 +111,18 @@ static void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url ) ...@@ -112,27 +111,18 @@ static void MediaURLOpenChanged( GtkWidget *widget, gchar *psz_url )
} }
} }
static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data )
{
gchar * p_url;
p_url = gtk_entry_get_text(GTK_ENTRY(editable) );
g_print( "%s\n",p_url );
}
/***************************************************************** /*****************************************************************
* Read directory helper function. * Read directory helper function.
****************************************************************/ ****************************************************************/
void ReadDirectory( GtkCList *clist, char *psz_dir) void ReadDirectory( GtkCList *clist, char *psz_dir )
{ {
intf_thread_t *p_intf = GtkGetIntf( clist ); intf_thread_t *p_intf = GtkGetIntf( clist );
struct dirent **namelist; struct dirent **namelist;
int n,i; int n,i;
if (psz_dir) if (psz_dir)
n = scandir(psz_dir, &namelist, 0, NULL); chdir(psz_dir);
else n = scandir(".", &namelist, 0, NULL);
n = scandir(".", &namelist, 0, NULL);
if (n<0) if (n<0)
perror("scandir"); perror("scandir");
...@@ -147,7 +137,7 @@ void ReadDirectory( GtkCList *clist, char *psz_dir) ...@@ -147,7 +137,7 @@ void ReadDirectory( GtkCList *clist, char *psz_dir)
{ {
/* This is a list of strings. */ /* This is a list of strings. */
ppsz_text[0] = namelist[i]->d_name; ppsz_text[0] = namelist[i]->d_name;
ppsz_text[1] = get_file_type(namelist[i]->d_name); ppsz_text[1] = get_file_perm(namelist[i]->d_name);
if (strcmp(ppsz_text[1],"") == 0) if (strcmp(ppsz_text[1],"") == 0)
msg_Err( p_intf->p_sys->p_input, "File system error unknown filetype encountered."); msg_Err( p_intf->p_sys->p_input, "File system error unknown filetype encountered.");
gtk_clist_insert( clist, i, ppsz_text ); gtk_clist_insert( clist, i, ppsz_text );
...@@ -158,30 +148,77 @@ void ReadDirectory( GtkCList *clist, char *psz_dir) ...@@ -158,30 +148,77 @@ void ReadDirectory( GtkCList *clist, char *psz_dir)
} }
} }
static char* get_file_type(const char *path) static char* get_file_perm(const char *path)
{ {
struct stat st; struct stat st;
char *perm;
perm = (char *) malloc(sizeof(char)*10);
strncpy( perm, "----------", sizeof("----------"));
if (lstat(path, &st)==0) if (lstat(path, &st)==0)
{ {
if (S_ISLNK(st.st_mode)) if (S_ISLNK(st.st_mode))
return "link"; perm[0]= 'l';
else if (S_ISDIR(st.st_mode)) else if (S_ISDIR(st.st_mode))
return "dir"; perm[0]= 'd';
else if (S_ISCHR(st.st_mode)) else if (S_ISCHR(st.st_mode))
return "char device"; perm[0]= 'c';
else if (S_ISBLK(st.st_mode)) else if (S_ISBLK(st.st_mode))
return "block device"; perm[0]= 'b';
else if (S_ISFIFO(st.st_mode)) else if (S_ISFIFO(st.st_mode))
return "fifo"; perm[0]= 'f';
else if (S_ISSOCK(st.st_mode)) else if (S_ISSOCK(st.st_mode))
return "socket"; perm[0]= 's';
else if (S_ISREG(st.st_mode)) else if (S_ISREG(st.st_mode))
return "file"; perm[0]= '-';
else /* Unknown type is an error */ else /* Unknown type is an error */
return ""; perm[0]= '?';
/* Get file permissions */
/* User */
if (st.st_mode & S_IRUSR)
perm[1]= 'r';
if (st.st_mode & S_IWUSR)
perm[2]= 'w';
if (st.st_mode & S_IXUSR)
{
if (st.st_mode & S_ISUID)
perm[3] = 's';
else
perm[3]= 'x';
}
else if (st.st_mode & S_ISUID)
perm[3] = 'S';
/* Group */
if (st.st_mode & S_IRGRP)
perm[4]= 'r';
if (st.st_mode & S_IWGRP)
perm[5]= 'w';
if (st.st_mode & S_IXGRP)
{
if (st.st_mode & S_ISGID)
perm[6] = 's';
else
perm[6]= 'x';
}
else if (st.st_mode & S_ISGID)
perm[6] = 'S';
/* Other */
if (st.st_mode & S_IROTH)
perm[7]= 'r';
if (st.st_mode & S_IWOTH)
perm[8]= 'w';
if (st.st_mode & S_IXOTH)
{
// 'sticky' bit
if (st.st_mode &S_ISVTX)
perm[9] = 't';
else
perm[9]= 'x';
}
else if (st.st_mode &S_ISVTX)
perm[9]= 'T';
} }
return ""; return perm;
} }
/* /*
...@@ -371,25 +408,14 @@ on_comboURL_entry_changed (GtkEditable *editable, ...@@ -371,25 +408,14 @@ on_comboURL_entry_changed (GtkEditable *editable,
if (p_intf) if (p_intf)
{ {
psz_url = gtk_entry_get_text(GTK_ENTRY(editable)); if (p_intf->p_sys->b_autoplayfile == 1)
MediaURLOpenChanged( GTK_WIDGET(editable), psz_url ); {
} psz_url = gtk_entry_get_text(GTK_ENTRY(editable));
} MediaURLOpenChanged( GTK_WIDGET(editable), psz_url );
}
void
on_comboPrefs_entry_changed (GtkEditable *editable,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( editable );
if (p_intf)
{
PreferencesURLOpenChanged( editable, NULL );
} }
} }
void void
on_clistmedia_click_column (GtkCList *clist, on_clistmedia_click_column (GtkCList *clist,
gint column, gint column,
...@@ -397,6 +423,7 @@ on_clistmedia_click_column (GtkCList *clist, ...@@ -397,6 +423,7 @@ on_clistmedia_click_column (GtkCList *clist,
{ {
static GtkSortType sort_type = GTK_SORT_ASCENDING; static GtkSortType sort_type = GTK_SORT_ASCENDING;
// Should sort on column
switch(sort_type) switch(sort_type)
{ {
case GTK_SORT_ASCENDING: case GTK_SORT_ASCENDING:
...@@ -422,35 +449,34 @@ on_clistmedia_select_row (GtkCList *clist, ...@@ -422,35 +449,34 @@ on_clistmedia_select_row (GtkCList *clist,
{ {
gchar *text[2]; gchar *text[2];
gint ret; gint ret;
struct stat st;
ret = gtk_clist_get_text (clist, row, 0, text); ret = gtk_clist_get_text (clist, row, 0, text);
if (ret) if (ret)
{ {
MediaURLOpenChanged( GTK_WIDGET(clist), text[0] ); if (lstat((char*)text[0], &st)==0)
{
// /* DO NOT TRY THIS CODE IT SEGFAULTS */ if (S_ISDIR(st.st_mode))
// g_print( "dir\n"); ReadDirectory(clist, text[0]);
// /* should be a gchar compare function */ else
// if (strlen(text[1])>0) MediaURLOpenChanged(GTK_WIDGET(clist), text[0]);
// { }
// g_print( "checking dir\n"); }
// /* should be a gchar compare function */ }
// if (strncmp(text[1],"dir",3)==0)
// {
// g_print( "dir: %s\n", text[0]); void
// ReadDirectory(clist, text[0]); on_cbautoplay_toggled (GtkToggleButton *togglebutton,
// } gpointer user_data)
// else {
// { intf_thread_t * p_intf = GtkGetIntf( togglebutton );
// g_print( "playing file\n");
// MediaURLOpenChanged( GTK_WIDGET(clist), text[0] ); if (p_intf)
// } {
// } if (p_intf->p_sys->b_autoplayfile == 1)
// else p_intf->p_sys->b_autoplayfile = 0;
// { else
// g_print( "playing filer\n"); p_intf->p_sys->b_autoplayfile = 1;
// MediaURLOpenChanged( GTK_WIDGET(clist), text[0] );
// }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.h : familiar plugin for vlc * callbacks.h : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: callbacks.h,v 1.4 2002/08/14 21:50:01 jpsaman Exp $ * $Id: callbacks.h,v 1.5 2002/08/18 20:36:04 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -68,10 +68,6 @@ void ...@@ -68,10 +68,6 @@ void
on_comboURL_entry_changed (GtkEditable *editable, on_comboURL_entry_changed (GtkEditable *editable,
gpointer user_data); gpointer user_data);
void
on_comboPrefs_entry_changed (GtkEditable *editable,
gpointer user_data);
void void
on_clistmedia_click_column (GtkCList *clist, on_clistmedia_click_column (GtkCList *clist,
...@@ -84,3 +80,8 @@ on_clistmedia_select_row (GtkCList *clist, ...@@ -84,3 +80,8 @@ on_clistmedia_select_row (GtkCList *clist,
gint column, gint column,
GdkEvent *event, GdkEvent *event,
gpointer user_data); gpointer user_data);
void
on_cbautoplay_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.3 2002/08/14 21:50:01 jpsaman Exp $ * $Id: familiar.c,v 1.4 2002/08/18 20:36:04 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -122,6 +122,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -122,6 +122,8 @@ static int Open( vlc_object_t *p_this )
/* Initialize Gtk+ thread */ /* Initialize Gtk+ thread */
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
p_intf->p_sys->b_autoplayfile = 1;
p_intf->pf_run = Run; p_intf->pf_run = Run;
return( 0 ); return( 0 );
...@@ -183,11 +185,17 @@ static void Run( intf_thread_t *p_intf ) ...@@ -183,11 +185,17 @@ static void Run( intf_thread_t *p_intf )
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window), gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
VOUT_TITLE " (Familiar Linux interface)"); VOUT_TITLE " (Familiar Linux interface)");
/* Get the slider object */
p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data( p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) );
// gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_notebook) ); // gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_notebook) );
p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "clistmedia" ) );
gtk_clist_set_column_visibility (GTK_CLIST (p_intf->p_sys->p_clist), 2, FALSE);
gtk_clist_set_column_visibility (GTK_CLIST (p_intf->p_sys->p_clist), 3, FALSE);
gtk_clist_set_column_visibility (GTK_CLIST (p_intf->p_sys->p_clist), 4, FALSE);
gtk_clist_column_titles_show (GTK_CLIST (p_intf->p_sys->p_clist));
/* Store p_intf to keep an eye on it */ /* Store p_intf to keep an eye on it */
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
"p_intf", p_intf ); "p_intf", p_intf );
......
...@@ -237,6 +237,42 @@ ...@@ -237,6 +237,42 @@
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkCombo</class>
<name>comboURL</name>
<x>40</x>
<y>4</y>
<width>185</width>
<height>24</height>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items>file://
ftp://
http://
udp://:1234
udpstream://@:1234
</items>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>comboURL-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboURL-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 19:37:06 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>file://</text>
</widget>
</widget>
<widget> <widget>
<class>GtkScrolledWindow</class> <class>GtkScrolledWindow</class>
<name>scrolledwindow1</name> <name>scrolledwindow1</name>
...@@ -252,22 +288,19 @@ ...@@ -252,22 +288,19 @@
<widget> <widget>
<class>GtkCList</class> <class>GtkCList</class>
<name>clistmedia</name> <name>clistmedia</name>
<width>216</width>
<height>208</height>
<tooltip>Select files to play</tooltip>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal>
<name>click_column</name>
<handler>on_clistmedia_click_column</handler>
<last_modification_time>Wed, 14 Aug 2002 20:26:18 GMT</last_modification_time>
</signal>
<signal> <signal>
<name>select_row</name> <name>select_row</name>
<handler>on_clistmedia_select_row</handler> <handler>on_clistmedia_select_row</handler>
<last_modification_time>Wed, 14 Aug 2002 20:30:36 GMT</last_modification_time> <last_modification_time>Sun, 18 Aug 2002 19:40:44 GMT</last_modification_time>
</signal> </signal>
<columns>2</columns> <signal>
<column_widths>145,54</column_widths> <name>click_column</name>
<handler>on_clistmedia_click_column</handler>
<last_modification_time>Sun, 18 Aug 2002 19:41:06 GMT</last_modification_time>
</signal>
<columns>5</columns>
<column_widths>123,80,80,80,80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode> <selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>True</show_titles> <show_titles>True</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type> <shadow_type>GTK_SHADOW_IN</shadow_type>
...@@ -277,7 +310,7 @@ ...@@ -277,7 +310,7 @@
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>labelname</name> <name>labelname</name>
<label>Name</label> <label>Name</label>
<justify>GTK_JUSTIFY_LEFT</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
<yalign>0.5</yalign> <yalign>0.5</yalign>
...@@ -290,49 +323,52 @@ ...@@ -290,49 +323,52 @@
<child_name>CList:title</child_name> <child_name>CList:title</child_name>
<name>labeltype</name> <name>labeltype</name>
<label>Type</label> <label>Type</label>
<justify>GTK_JUSTIFY_LEFT</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
<xalign>0.5</xalign> <xalign>0.5</xalign>
<yalign>0.5</yalign> <yalign>0.5</yalign>
<xpad>0</xpad> <xpad>0</xpad>
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
</widget>
</widget>
<widget> <widget>
<class>GtkCombo</class> <class>GtkLabel</class>
<name>comboURL</name> <child_name>CList:title</child_name>
<x>40</x> <name>labelsize</name>
<y>4</y> <label>Size</label>
<width>185</width> <justify>GTK_JUSTIFY_CENTER</justify>
<height>24</height> <wrap>False</wrap>
<value_in_list>False</value_in_list> <xalign>0.5</xalign>
<ok_if_empty>True</ok_if_empty> <yalign>0.5</yalign>
<case_sensitive>False</case_sensitive> <xpad>0</xpad>
<use_arrows>True</use_arrows> <ypad>0</ypad>
<use_arrows_always>False</use_arrows_always> </widget>
<items>file://
ftp://
http://
udp://:1234
udpstream://@:1234
</items>
<widget> <widget>
<class>GtkEntry</class> <class>GtkLabel</class>
<child_name>GtkCombo:entry</child_name> <child_name>CList:title</child_name>
<name>comboURL-entry</name> <name>labeluid</name>
<can_focus>True</can_focus> <label>User</label>
<signal> <justify>GTK_JUSTIFY_CENTER</justify>
<name>changed</name> <wrap>False</wrap>
<handler>on_comboURL-entry_changed</handler> <xalign>0.5</xalign>
<last_modification_time>Thu, 01 Aug 2002 19:37:06 GMT</last_modification_time> <yalign>0.5</yalign>
</signal> <xpad>0</xpad>
<editable>True</editable> <ypad>0</ypad>
<text_visible>True</text_visible> </widget>
<text_max_length>0</text_max_length>
<text>file://</text> <widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>labelgid</name>
<label>Group</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>
...@@ -391,99 +427,21 @@ udpstream://@:1234 ...@@ -391,99 +427,21 @@ udpstream://@:1234
</widget> </widget>
<widget> <widget>
<class>GtkFrame</class> <class>GtkCheckButton</class>
<name>frameDefaultURL</name> <name>cbautoplay</name>
<x>8</x> <x>8</x>
<y>8</y> <y>8</y>
<width>220</width> <width>216</width>
<height>60</height> <height>24</height>
<label>Default URL:</label> <can_focus>True</can_focus>
<label_xalign>0</label_xalign> <signal>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <name>toggled</name>
<handler>on_cbautoplay_toggled</handler>
<widget> <last_modification_time>Sun, 18 Aug 2002 20:00:52 GMT</last_modification_time>
<class>GtkFixed</class> </signal>
<name>fixed3</name> <label>Automatically play file.</label>
<active>True</active>
<widget> <draw_indicator>True</draw_indicator>
<class>GtkCombo</class>
<name>comboDefaultURL</name>
<x>8</x>
<y>8</y>
<width>200</width>
<height>24</height>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items>file://
ftp://
http://
udpstream://@:1234
udp://:1234
</items>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>comboPrefs-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboPrefs-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 20:11:46 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>file://</text>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GtkFrame</class>
<name>frameIP</name>
<x>8</x>
<y>72</y>
<width>220</width>
<height>60</height>
<label>IP version:</label>
<label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<widget>
<class>GtkFixed</class>
<name>fixed2</name>
<widget>
<class>GtkRadioButton</class>
<name>rbIPv4</name>
<x>8</x>
<y>8</y>
<width>104</width>
<height>26</height>
<can_focus>True</can_focus>
<label>IPv4</label>
<active>True</active>
<draw_indicator>True</draw_indicator>
</widget>
<widget>
<class>GtkRadioButton</class>
<name>rbIPv6</name>
<x>112</x>
<y>8</y>
<width>104</width>
<height>26</height>
<can_focus>True</can_focus>
<label>IPv6</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.h: private Gtk+ interface description * familiar.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: familiar.h,v 1.3 2002/08/14 21:50:01 jpsaman Exp $ * $Id: familiar.h,v 1.4 2002/08/18 20:36:04 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -34,7 +34,9 @@ struct intf_sys_t ...@@ -34,7 +34,9 @@ struct intf_sys_t
// GtkWidget * p_notebook_about; // GtkWidget * p_notebook_about;
// GtkWidget * p_notebook_open; // GtkWidget * p_notebook_open;
// GtkWidget * p_notebook_preferences; // GtkWidget * p_notebook_preferences;
GtkCList * p_clist;
vlc_bool_t b_autoplayfile;
/* The input thread */ /* The input thread */
input_thread_t * p_input; input_thread_t * p_input;
......
...@@ -37,28 +37,22 @@ create_familiar (void) ...@@ -37,28 +37,22 @@ create_familiar (void)
GtkWidget *notebook; GtkWidget *notebook;
GtkWidget *fixedMedia; GtkWidget *fixedMedia;
GtkWidget *labelUrl; GtkWidget *labelUrl;
GtkWidget *comboURL;
GList *comboURL_items = NULL;
GtkWidget *comboURL_entry;
GtkWidget *scrolledwindow1; GtkWidget *scrolledwindow1;
GtkWidget *clistmedia; GtkWidget *clistmedia;
GtkWidget *labelname; GtkWidget *labelname;
GtkWidget *labeltype; GtkWidget *labeltype;
GtkWidget *comboURL; GtkWidget *labelsize;
GList *comboURL_items = NULL; GtkWidget *labeluid;
GtkWidget *comboURL_entry; GtkWidget *labelgid;
GtkWidget *media; GtkWidget *media;
GtkWidget *fixedPreferences; GtkWidget *fixedPreferences;
GtkWidget *buttonSave; GtkWidget *buttonSave;
GtkWidget *buttonApply; GtkWidget *buttonApply;
GtkWidget *buttonCancel; GtkWidget *buttonCancel;
GtkWidget *frameDefaultURL; GtkWidget *cbautoplay;
GtkWidget *fixed3;
GtkWidget *comboDefaultURL;
GList *comboDefaultURL_items = NULL;
GtkWidget *comboPrefs_entry;
GtkWidget *frameIP;
GtkWidget *fixed2;
GSList *fixed2_group = NULL;
GtkWidget *rbIPv4;
GtkWidget *rbIPv6;
GtkWidget *preferences; GtkWidget *preferences;
GtkWidget *fixedAbout; GtkWidget *fixedAbout;
GtkWidget *logo; GtkWidget *logo;
...@@ -67,9 +61,6 @@ create_familiar (void) ...@@ -67,9 +61,6 @@ create_familiar (void)
GtkWidget *labelAuthors; GtkWidget *labelAuthors;
GtkWidget *labelAbout; GtkWidget *labelAbout;
GtkWidget *about; GtkWidget *about;
GtkTooltips *tooltips;
tooltips = gtk_tooltips_new ();
familiar = gtk_window_new (GTK_WINDOW_TOPLEVEL); familiar = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name (familiar, "familiar"); gtk_widget_set_name (familiar, "familiar");
...@@ -238,6 +229,31 @@ create_familiar (void) ...@@ -238,6 +229,31 @@ create_familiar (void)
gtk_widget_set_uposition (labelUrl, 4, 8); gtk_widget_set_uposition (labelUrl, 4, 8);
gtk_widget_set_usize (labelUrl, 38, 18); gtk_widget_set_usize (labelUrl, 38, 18);
comboURL = gtk_combo_new ();
gtk_widget_set_name (comboURL, "comboURL");
gtk_widget_ref (comboURL);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL", comboURL,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL);
gtk_fixed_put (GTK_FIXED (fixedMedia), comboURL, 40, 4);
gtk_widget_set_uposition (comboURL, 40, 4);
gtk_widget_set_usize (comboURL, 185, 24);
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udpstream://@:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
comboURL_entry = GTK_COMBO (comboURL)->entry;
gtk_widget_set_name (comboURL_entry, "comboURL_entry");
gtk_widget_ref (comboURL_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL_entry);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://"));
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); gtk_widget_set_name (scrolledwindow1, "scrolledwindow1");
gtk_widget_ref (scrolledwindow1); gtk_widget_ref (scrolledwindow1);
...@@ -248,17 +264,18 @@ create_familiar (void) ...@@ -248,17 +264,18 @@ create_familiar (void)
gtk_widget_set_uposition (scrolledwindow1, 0, 32); gtk_widget_set_uposition (scrolledwindow1, 0, 32);
gtk_widget_set_usize (scrolledwindow1, 240, 208); gtk_widget_set_usize (scrolledwindow1, 240, 208);
clistmedia = gtk_clist_new (2); clistmedia = gtk_clist_new (5);
gtk_widget_set_name (clistmedia, "clistmedia"); gtk_widget_set_name (clistmedia, "clistmedia");
gtk_widget_ref (clistmedia); gtk_widget_ref (clistmedia);
gtk_object_set_data_full (GTK_OBJECT (familiar), "clistmedia", clistmedia, gtk_object_set_data_full (GTK_OBJECT (familiar), "clistmedia", clistmedia,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (clistmedia); gtk_widget_show (clistmedia);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), clistmedia); gtk_container_add (GTK_CONTAINER (scrolledwindow1), clistmedia);
gtk_widget_set_usize (clistmedia, 216, 208); gtk_clist_set_column_width (GTK_CLIST (clistmedia), 0, 123);
gtk_tooltips_set_tip (tooltips, clistmedia, _("Select files to play"), NULL); gtk_clist_set_column_width (GTK_CLIST (clistmedia), 1, 80);
gtk_clist_set_column_width (GTK_CLIST (clistmedia), 0, 145); gtk_clist_set_column_width (GTK_CLIST (clistmedia), 2, 80);
gtk_clist_set_column_width (GTK_CLIST (clistmedia), 1, 54); gtk_clist_set_column_width (GTK_CLIST (clistmedia), 3, 80);
gtk_clist_set_column_width (GTK_CLIST (clistmedia), 4, 80);
gtk_clist_column_titles_show (GTK_CLIST (clistmedia)); gtk_clist_column_titles_show (GTK_CLIST (clistmedia));
labelname = gtk_label_new (_("Name")); labelname = gtk_label_new (_("Name"));
...@@ -268,7 +285,6 @@ create_familiar (void) ...@@ -268,7 +285,6 @@ create_familiar (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labelname); gtk_widget_show (labelname);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 0, labelname); gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 0, labelname);
gtk_label_set_justify (GTK_LABEL (labelname), GTK_JUSTIFY_LEFT);
labeltype = gtk_label_new (_("Type")); labeltype = gtk_label_new (_("Type"));
gtk_widget_set_name (labeltype, "labeltype"); gtk_widget_set_name (labeltype, "labeltype");
...@@ -277,32 +293,30 @@ create_familiar (void) ...@@ -277,32 +293,30 @@ create_familiar (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labeltype); gtk_widget_show (labeltype);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 1, labeltype); gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 1, labeltype);
gtk_label_set_justify (GTK_LABEL (labeltype), GTK_JUSTIFY_LEFT);
comboURL = gtk_combo_new (); labelsize = gtk_label_new (_("Size"));
gtk_widget_set_name (comboURL, "comboURL"); gtk_widget_set_name (labelsize, "labelsize");
gtk_widget_ref (comboURL); gtk_widget_ref (labelsize);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL", comboURL, gtk_object_set_data_full (GTK_OBJECT (familiar), "labelsize", labelsize,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL); gtk_widget_show (labelsize);
gtk_fixed_put (GTK_FIXED (fixedMedia), comboURL, 40, 4); gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 2, labelsize);
gtk_widget_set_uposition (comboURL, 40, 4);
gtk_widget_set_usize (comboURL, 185, 24);
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udpstream://@:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
comboURL_entry = GTK_COMBO (comboURL)->entry; labeluid = gtk_label_new (_("User"));
gtk_widget_set_name (comboURL_entry, "comboURL_entry"); gtk_widget_set_name (labeluid, "labeluid");
gtk_widget_ref (comboURL_entry); gtk_widget_ref (labeluid);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry, gtk_object_set_data_full (GTK_OBJECT (familiar), "labeluid", labeluid,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL_entry); gtk_widget_show (labeluid);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://")); gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 3, labeluid);
labelgid = gtk_label_new (_("Group"));
gtk_widget_set_name (labelgid, "labelgid");
gtk_widget_ref (labelgid);
gtk_object_set_data_full (GTK_OBJECT (familiar), "labelgid", labelgid,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (labelgid);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 4, labelgid);
media = gtk_label_new (_("Media")); media = gtk_label_new (_("Media"));
gtk_widget_set_name (media, "media"); gtk_widget_set_name (media, "media");
...@@ -350,89 +364,16 @@ create_familiar (void) ...@@ -350,89 +364,16 @@ create_familiar (void)
gtk_widget_set_uposition (buttonCancel, 176, 216); gtk_widget_set_uposition (buttonCancel, 176, 216);
gtk_widget_set_usize (buttonCancel, 54, 24); gtk_widget_set_usize (buttonCancel, 54, 24);
frameDefaultURL = gtk_frame_new (_("Default URL:")); cbautoplay = gtk_check_button_new_with_label (_("Automatically play file."));
gtk_widget_set_name (frameDefaultURL, "frameDefaultURL"); gtk_widget_set_name (cbautoplay, "cbautoplay");
gtk_widget_ref (frameDefaultURL); gtk_widget_ref (cbautoplay);
gtk_object_set_data_full (GTK_OBJECT (familiar), "frameDefaultURL", frameDefaultURL, gtk_object_set_data_full (GTK_OBJECT (familiar), "cbautoplay", cbautoplay,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frameDefaultURL); gtk_widget_show (cbautoplay);
gtk_fixed_put (GTK_FIXED (fixedPreferences), frameDefaultURL, 8, 8); gtk_fixed_put (GTK_FIXED (fixedPreferences), cbautoplay, 8, 8);
gtk_widget_set_uposition (frameDefaultURL, 8, 8); gtk_widget_set_uposition (cbautoplay, 8, 8);
gtk_widget_set_usize (frameDefaultURL, 220, 60); gtk_widget_set_usize (cbautoplay, 216, 24);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cbautoplay), TRUE);
fixed3 = gtk_fixed_new ();
gtk_widget_set_name (fixed3, "fixed3");
gtk_widget_ref (fixed3);
gtk_object_set_data_full (GTK_OBJECT (familiar), "fixed3", fixed3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (fixed3);
gtk_container_add (GTK_CONTAINER (frameDefaultURL), fixed3);
comboDefaultURL = gtk_combo_new ();
gtk_widget_set_name (comboDefaultURL, "comboDefaultURL");
gtk_widget_ref (comboDefaultURL);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboDefaultURL", comboDefaultURL,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboDefaultURL);
gtk_fixed_put (GTK_FIXED (fixed3), comboDefaultURL, 8, 8);
gtk_widget_set_uposition (comboDefaultURL, 8, 8);
gtk_widget_set_usize (comboDefaultURL, 200, 24);
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("file://"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("ftp://"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("http://"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("udpstream://@:1234"));
comboDefaultURL_items = g_list_append (comboDefaultURL_items, (gpointer) _("udp://:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboDefaultURL), comboDefaultURL_items);
g_list_free (comboDefaultURL_items);
comboPrefs_entry = GTK_COMBO (comboDefaultURL)->entry;
gtk_widget_set_name (comboPrefs_entry, "comboPrefs_entry");
gtk_widget_ref (comboPrefs_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboPrefs_entry", comboPrefs_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboPrefs_entry);
gtk_entry_set_text (GTK_ENTRY (comboPrefs_entry), _("file://"));
frameIP = gtk_frame_new (_("IP version:"));
gtk_widget_set_name (frameIP, "frameIP");
gtk_widget_ref (frameIP);
gtk_object_set_data_full (GTK_OBJECT (familiar), "frameIP", frameIP,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frameIP);
gtk_fixed_put (GTK_FIXED (fixedPreferences), frameIP, 8, 72);
gtk_widget_set_uposition (frameIP, 8, 72);
gtk_widget_set_usize (frameIP, 220, 60);
fixed2 = gtk_fixed_new ();
gtk_widget_set_name (fixed2, "fixed2");
gtk_widget_ref (fixed2);
gtk_object_set_data_full (GTK_OBJECT (familiar), "fixed2", fixed2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (fixed2);
gtk_container_add (GTK_CONTAINER (frameIP), fixed2);
rbIPv4 = gtk_radio_button_new_with_label (fixed2_group, _("IPv4"));
fixed2_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rbIPv4));
gtk_widget_set_name (rbIPv4, "rbIPv4");
gtk_widget_ref (rbIPv4);
gtk_object_set_data_full (GTK_OBJECT (familiar), "rbIPv4", rbIPv4,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (rbIPv4);
gtk_fixed_put (GTK_FIXED (fixed2), rbIPv4, 8, 8);
gtk_widget_set_uposition (rbIPv4, 8, 8);
gtk_widget_set_usize (rbIPv4, 104, 26);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rbIPv4), TRUE);
rbIPv6 = gtk_radio_button_new_with_label (fixed2_group, _("IPv6"));
fixed2_group = gtk_radio_button_group (GTK_RADIO_BUTTON (rbIPv6));
gtk_widget_set_name (rbIPv6, "rbIPv6");
gtk_widget_ref (rbIPv6);
gtk_object_set_data_full (GTK_OBJECT (familiar), "rbIPv6", rbIPv6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (rbIPv6);
gtk_fixed_put (GTK_FIXED (fixed2), rbIPv6, 112, 8);
gtk_widget_set_uposition (rbIPv6, 112, 8);
gtk_widget_set_usize (rbIPv6, 104, 26);
preferences = gtk_label_new (_("Preference")); preferences = gtk_label_new (_("Preference"));
gtk_widget_set_name (preferences, "preferences"); gtk_widget_set_name (preferences, "preferences");
...@@ -542,21 +483,19 @@ create_familiar (void) ...@@ -542,21 +483,19 @@ create_familiar (void)
gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked", gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_about_clicked), GTK_SIGNAL_FUNC (on_toolbar_about_clicked),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (clistmedia), "click_column", gtk_signal_connect (GTK_OBJECT (comboURL_entry), "changed",
GTK_SIGNAL_FUNC (on_clistmedia_click_column), GTK_SIGNAL_FUNC (on_comboURL_entry_changed),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (clistmedia), "select_row", gtk_signal_connect (GTK_OBJECT (clistmedia), "select_row",
GTK_SIGNAL_FUNC (on_clistmedia_select_row), GTK_SIGNAL_FUNC (on_clistmedia_select_row),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (comboURL_entry), "changed", gtk_signal_connect (GTK_OBJECT (clistmedia), "click_column",
GTK_SIGNAL_FUNC (on_comboURL_entry_changed), GTK_SIGNAL_FUNC (on_clistmedia_click_column),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (comboPrefs_entry), "changed", gtk_signal_connect (GTK_OBJECT (cbautoplay), "toggled",
GTK_SIGNAL_FUNC (on_comboPrefs_entry_changed), GTK_SIGNAL_FUNC (on_cbautoplay_toggled),
NULL); NULL);
gtk_object_set_data (GTK_OBJECT (familiar), "tooltips", tooltips);
return familiar; return familiar;
} }
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