summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-04-19 10:34:41 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-04-19 10:34:41 (GMT)
commit31f268b173eb42b2b2ada15003e43669dcc26b97 (patch)
tree53b6538b0b8a7138eb71a475d3951729468b428d /rhimport
parentaee3275fa50dae3aab22012b11a3aaf1a428a9a1 (diff)
added message dialog at import end
disabling buttons while importing
Diffstat (limited to 'rhimport')
-rwxr-xr-xrhimport45
1 files changed, 37 insertions, 8 deletions
diff --git a/rhimport b/rhimport
index 8670f12..1ef55d3 100755
--- a/rhimport
+++ b/rhimport
@@ -220,12 +220,19 @@ sub start_import_gui()
exit 2;
}
+ my $b_apply = $guixml->get_widget('b_apply');
+ my $b_close = $guixml->get_widget('b_close');
+ $b_apply->set_sensitive(0);
+ $b_close->set_sensitive(0);
+
if(!rhimport::check_key_file()) {
my $parent_window = $guixml->get_widget('appwin');
my $dialog = Gtk2::MessageDialog->new ($parent_window, 'destroy-with-parent',
'error', 'ok', "Es wurde kein Import Key gefunden.");
$dialog->run;
$dialog->destroy;
+ $b_apply->set_sensitive(1);
+ $b_close->set_sensitive(1);
return 0;
}
@@ -239,6 +246,8 @@ sub start_import_gui()
} else {
$l_status->set_label("Keine Audio Datei ausgewählt!");
}
+ $b_apply->set_sensitive(1);
+ $b_close->set_sensitive(1);
return 0;
}
$filechooser->unselect_all;
@@ -255,18 +264,34 @@ sub start_import_gui()
if($POOL) {
my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
if($cb_clear_carts->get_active) {
- rhimport::clear_carts($dbh, $group, $to_cart, $gui_progress_cb);
+ $log = rhimport::clear_carts($dbh, $group, $to_cart, $gui_progress_cb);
}
- ($ret, $log) = rhimport::import_playlist($file, $dropbox, $gui_progress_cb, $gui_error_cb);
+ my $import_log;
+ ($ret, $import_log) = rhimport::import_playlist($file, $dropbox, $gui_progress_cb, $gui_error_cb);
+ $log .= $import_log;
} else {
- rhimport::clear_carts($dbh, $group, $to_cart, $gui_progress_cb);
- ($ret, $log) = rhimport::import_single($file, $dropbox, $gui_progress_cb, $gui_error_cb);
+ $log = rhimport::clear_carts($dbh, $group, $to_cart, $gui_progress_cb);
+ my $import_log;
+ ($ret, $import_log) = rhimport::import_single($file, $dropbox, $gui_progress_cb, $gui_error_cb);
+ $log .= $import_log;
}
+ my $parent_window = $guixml->get_widget('appwin');
+ my $dialog;
if(!$ret) {
$l_status->set_label("Fehler beim Importieren");
+ $dialog = Gtk2::MessageDialog->new ($parent_window, 'destroy-with-parent',
+ 'error', 'ok', "Fehler beim Importieren.");
+ } else {
+ $l_status->set_label("");
+ $dialog = Gtk2::MessageDialog->new ($parent_window, 'destroy-with-parent',
+ 'info', 'ok', "Der Import wurde erfolgreich abgeschlossen!");
}
+ $dialog->run;
+ $dialog->destroy;
+ $b_apply->set_sensitive(1);
+ $b_close->set_sensitive(1);
return $ret;
}
@@ -405,13 +430,17 @@ my $ret;
my $log;
if($POOL) {
if(!$KEEPCARTS) {
- rhimport::clear_carts($dbh, $group, $to_cart);
+ $log = rhimport::clear_carts($dbh, $group, $to_cart);
}
- ($ret, $log) = rhimport::import_playlist($FILE, $DROPBOX, 0, $cl_error_cb);
+ my $import_log;
+ ($ret, $import_log) = rhimport::import_playlist($FILE, $DROPBOX, 0, $cl_error_cb);
+ $log .= $import_log;
} else {
- rhimport::clear_carts($dbh, $group, $to_cart);
- ($ret, $log) = rhimport::import_single($FILE, $DROPBOX, 0);
+ $log = rhimport::clear_carts($dbh, $group, $to_cart);
+ my $import_log;
+ ($ret, $import_log) = rhimport::import_single($FILE, $DROPBOX, 0);
+ $log .= $import_log;
}
$dbh->disconnect();