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)
commitd6ff970c44ce7488f138a1cee3515b48c383d299 (patch)
treeb8b0a18f09f2ff8c0ce3b78b03e6249191a8a625 /rhimport
parent9caad911cdb3650b16ae7cbe8294f0ebec9502d1 (diff)
added warning to mode selection
git-svn-id: https://svn.helsinki.at/rhimport/trunk@29 7c65635b-ec39-4f67-a626-873dbafdd612
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();
+ }
}
}