Changeset 1169 in ProjectBuilder for projects/CDDBeditor
- Timestamp:
- Jan 30, 2011, 8:13:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
projects/CDDBeditor/devel/CDDBeditor/bin/CDDBeditor
r1004 r1169 169 169 my $dev_label = Newt::Label("Device: "); 170 170 my $proxy_label = Newt::Label("Proxy: "); 171 my $user_label = Newt::Label("Multi CD: ");172 171 173 172 my $wait_label = Newt::Label("Please wait while searching ..."); … … 188 187 $ce_config{"HTTP_PROXY"}=$ENV{http_proxy} if $ENV{http_proxy}; 189 188 $ce_config{"input"}=0; 189 $ce_config{"multi"}=1; 190 190 $ce_config{"PROTO_VERSION"} = 6; 191 191 $ce_config{"DOMAIN"} = "musique-ancienne.org"; … … 217 217 my $dev_entry = Newt::Entry($width, $flag, $ce_config{"CD_DEVICE"}); 218 218 my $user_group; 219 if ($ce_config{input} == 0 ) {220 $user_group = Newt::HRadiogroup('FALSE', 'TRUE');221 } else {222 $user_group = Newt::HRadiogroup('TRUE', 'FALSE');223 }224 219 my $quit_button = Newt::Button("Quit"); 225 220 $quit_button->Tag("Quit"); … … 250 245 $flage = NEWT_ANCHOR_LEFT; 251 246 $ce_panel->Add(1, 4, $dev_entry, $flage); 252 $flage = NEWT_ANCHOR_RIGHT;253 $ce_panel->Add(0, 5, $user_label, $flage);254 247 $flage = NEWT_ANCHOR_LEFT; 255 $ce_panel->Add(1, 5, $user_group, $flage);256 248 $ce_panel->Add(0, 6, $empty_label); 257 249 $ce_panel->Add(0, 7, $next_button); … … 271 263 $ce_config{"CDDB_MODE"}=$ce_cddb_mode{$mode_group->Get()}; 272 264 $ce_config{"CD_DEVICE"}=$dev_entry->Get(); 273 $ce_config{"input"}=$user_group->Get();274 265 275 266 # Components … … 280 271 281 272 my $firsttime = 1; 273 my @cecd; 282 274 my $ce_cd; 283 275 my $artist_entry; … … 303 295 # CDDB query if first time 304 296 if ($firsttime == 1) { 305 my %ce_cd = get_cddb(\%ce_config); 306 $ce_cd = \%ce_cd if (defined %ce_cd); 297 @cecd = get_cddb(\%ce_config); 298 # by default use first one 299 $ce_cd = @cecd[0] if (defined @cecd[0]); 307 300 } 308 301 $firsttime = 0; 309 302 310 #print Dumper($ce_cd)."\n"; 311 #exit 0; 303 my @vradio; 304 my $ind = 0; 305 foreach my $entry (@cecd) { 306 push @vradio,sprintf "%02d (%s - %d tracks) - %s",$ind,$entry->{cat},$entry->{tno},$entry->{title}; 307 $ind++; 308 } 309 310 if ($ind gt 1) { 311 # We have multiple entries chose the right one 312 # Second panel for configuration parameters 313 Newt::Cls(); 314 Newt::DrawRootText(ce_center_string($ce_title), 1, $ce_title); 315 Newt::PushHelpLine($ce_help); 316 Newt::Refresh(); 317 318 my $user_group = Newt::VRadiogroup(@vradio); 319 my $quit_button = Newt::Button("Quit"); 320 $quit_button->Tag("Quit"); 321 my $next_button = Newt::Button("Next"); 322 $next_button->Tag("Next"); 323 324 my $ce_panel = Newt::Panel(2, 20, "CD chooser"); 325 $flage = NEWT_ANCHOR_LEFT; 326 $ce_panel->Add(0, 5, $user_group, $flage); 327 $ce_panel->Add(0, 10, $empty_label); 328 $ce_panel->Add(0, 11, $next_button); 329 $ce_panel->Add(1, 11, $quit_button); 330 331 Newt::Refresh(); 332 my ($reason, $data) = $ce_panel->Run(); 333 334 Newt::Cls(); 335 exit 0 if ($data->Tag() eq "Quit"); 336 337 $ind=$user_group->Get(); 338 } 339 # Point now to the right CD 340 $ce_cd = @cecd[$ind-1]; 341 312 342 if (not defined $ce_cd->{title}) { 313 343 # Get the disc id first
Note:
See TracChangeset
for help on using the changeset viewer.