summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrhimport40
1 files changed, 36 insertions, 4 deletions
diff --git a/rhimport b/rhimport
index c28d013..0b69652 100755
--- a/rhimport
+++ b/rhimport
@@ -137,10 +137,42 @@ sub set_mode_file_gui()
sub toggle_mode_gui()
{
- if($POOL) {
- set_mode_file_gui();
- } else {
- set_mode_playlist_gui();
+ if(!$guixml) {
+ print STDERR "no GUI definition found!\n";
+ exit 0;
+ }
+
+ my $co_dropbox = $guixml->get_widget('co_dropbox');
+ my $to_cart = $allowed_dbs[$co_dropbox->get_active]->{'TO_CART'};
+
+ my $response = 'no';
+ if(($to_cart == 0 && $POOL) ||
+ ($to_cart != 0 && !$POOL)) {
+ my $question = "Diese Sendung hat ";
+ if($to_cart != 0) {
+ $question .= "nur ein Cart";
+ } else {
+ $question .= "mehrere Carts";
+ }
+ $question .= ". Soll der Modus trotzdem gewechselt werden?";
+
+ my $parent_window = $guixml->get_widget('appwin');
+ my $dialog = Gtk2::MessageDialog->new ($parent_window, 'destroy-with-parent',
+ 'question', 'yes-no', $question);
+ $dialog->set_default_response ('no');
+ $response = $dialog->run;
+ $dialog->destroy;
+ }
+ else {
+ $response = 'yes';
+ }
+
+ if($response eq 'yes') {
+ if($POOL) {
+ set_mode_file_gui();
+ } else {
+ set_mode_playlist_gui();
+ }
}
}