summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-03-29 07:22:26 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-03-29 07:22:26 (GMT)
commit3cd642a557205510b6f2a6c9808f0dfe96d27172 (patch)
treeb8b0a18f09f2ff8c0ce3b78b03e6249191a8a625 /rhimport
parentf01b5c68ff71034cdc179739f42875dde9d99dee (diff)
added warning to mode selection
Diffstat (limited to 'rhimport')
-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();
+ }
}
}