diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-04-19 10:34:41 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-04-19 10:34:41 (GMT) |
commit | 31f268b173eb42b2b2ada15003e43669dcc26b97 (patch) | |
tree | 53b6538b0b8a7138eb71a475d3951729468b428d /rhimport | |
parent | aee3275fa50dae3aab22012b11a3aaf1a428a9a1 (diff) |
added message dialog at import end
disabling buttons while importing
Diffstat (limited to 'rhimport')
-rwxr-xr-x | rhimport | 45 |
1 files changed, 37 insertions, 8 deletions
@@ -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(); |