From 9ced6b2a11727ae7f004e16262e3f64617c35f08 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 21 Jan 2009 10:54:29 +0000 Subject: Drop () only for display, and fix double click on channel --- perl-install/standalone/drakdvb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakdvb b/perl-install/standalone/drakdvb index 9a5a0ef0a..e98f35e7d 100644 --- a/perl-install/standalone/drakdvb +++ b/perl-install/standalone/drakdvb @@ -35,12 +35,12 @@ my $in = 'interactive'->vnew; my $config_file = "$ENV{HOME}/.mplayer/channels.conf"; -my $channel_list = Gtk2::SimpleList->new(N("Channel")=> "text"); +my $channel_list = Gtk2::SimpleList->new(N("Channel")=> "text", "id" => "hidden"); my %buttons; sub get_selected_channel() { my ($index) = $channel_list->get_selected_indices; - defined $index && $channel_list->{data}[$index][0]; + defined $index && $channel_list->{data}[$index][1]; } sub detect_channels { @@ -65,8 +65,8 @@ sub load_channels { open(CHANNELCONF, "<$config_file"); while() { my($line) = $_; - if ($line =~ /^([^:]*)(\([^(:]*\))?:/) { - push @{$channel_list->{data}}, $1; + if ($line =~ /^([^:]*?)(\([^(:]*\))?:/) { + push @{$channel_list->{data}}, [$1, $1.$2]; } } close(CHANNELCONF); @@ -94,13 +94,16 @@ gtkadd($w->{window}, ); $buttons{view}->set_sensitive(0); + $channel_list->get_selection->signal_connect('changed' => sub { my ($index) = $channel_list->get_selected_indices; $buttons{view}->set_sensitive(defined $index); }); -$channel_list->signal_connect('activated' => sub { + +$channel_list->signal_connect('row-activated' => sub { launch_tv(); }); + load_channels(); $w->main; -- cgit v1.2.1