diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-03-29 07:22:26 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-03-29 07:22:26 (GMT) |
commit | 3cd642a557205510b6f2a6c9808f0dfe96d27172 (patch) | |
tree | b8b0a18f09f2ff8c0ce3b78b03e6249191a8a625 | |
parent | f01b5c68ff71034cdc179739f42875dde9d99dee (diff) |
added warning to mode selection
-rwxr-xr-x | rhimport | 40 |
1 files changed, 36 insertions, 4 deletions
@@ -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(); + } } } |