From 9caad911cdb3650b16ae7cbe8294f0ebec9502d1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 25 Mar 2010 18:17:47 +0000 Subject: automatic selection of pool vs show mode based on selected dropbox git-svn-id: https://svn.helsinki.at/rhimport/trunk@28 7c65635b-ec39-4f67-a626-873dbafdd612 diff --git a/rhimport b/rhimport index 3b828bc..c28d013 100755 --- a/rhimport +++ b/rhimport @@ -252,7 +252,16 @@ sub dropbox_updated_gui() exit 0; } - + my $co_dropbox = $guixml->get_widget('co_dropbox'); + my $to_cart = $allowed_dbs[$co_dropbox->get_active]->{'TO_CART'}; + my $group = $allowed_dbs[$co_dropbox->get_active]->{'GROUP'}; + my ($low_cart, $high_cart) = rhimport::get_cart_range($dbh, $group); + + if($to_cart == 0) { + set_mode_playlist_gui(); + } else { + set_mode_file_gui(); + } } if(!$FILE || !$DROPBOX) { @@ -272,6 +281,7 @@ if(!$FILE || !$DROPBOX) { $co_dropbox->pack_start($renderer, 1); $co_dropbox->add_attribute($renderer, text => 3); $co_dropbox->set_active(0); + dropbox_updated_gui(); my $cb_clear_carts = $guixml->get_widget('cb_clear_carts'); if($KEEPCARTS) { @@ -280,12 +290,6 @@ if(!$FILE || !$DROPBOX) { $cb_clear_carts->set_active(1); } - if($POOL) { - set_mode_playlist_gui(); - } else { - set_mode_file_gui(); - } - $guixml->signal_autoconnect_from_package('gui_callbacks'); my $appwin = $guixml->get_widget('appwin'); $appwin or die "can't find Main Window"; -- cgit v0.10.2