summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport')
-rwxr-xr-xrhimport21
1 files changed, 16 insertions, 5 deletions
diff --git a/rhimport b/rhimport
index ee1f552..46794b6 100755
--- a/rhimport
+++ b/rhimport
@@ -38,23 +38,26 @@ my $DB = "rivendell";
my $HELP = 0;
my $FILE = "";
my $POOL = 0;
+my $EMPTYCARTS = 1;
my $DROPBOX = "";
my $LISTALLOWED = 0;
GetOptions ("help!" => \$HELP,
"file=s" => \$FILE,
"pool!" => \$POOL,
+ "empty-carts!" => \$EMPTYCARTS,
"dropbox=s" => \$DROPBOX,
"list-allowed!" => \$LISTALLOWED,
);
if($HELP) {
print << "EOF";
-usage: $0 --file <audio or playlist file> --pool --dropbox <path to dropbox> --list-allowed
+usage: $0 --file <audio or playlist file> --pool --empty-carts --dropbox <path to dropbox> --list-allowed
options:
--file the media file or playlist to import
--pool pool mode, import media files referneced by playlist
+ --empty-carts emtpy out pool of carts before import
--dropbox the path to the dropbox to use
--list-allowed list allowed dropboxes and exit
@@ -102,6 +105,8 @@ sub set_mode_playlist_gui()
$POOL = 1;
my $l_mode = $guixml->get_widget('l_mode');
$l_mode->set_label("<b>Musik Pool</b>");
+ my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
+ $cb_clear_carts->set_sensitive(1);
my $l_file_playlist = $guixml->get_widget('l_file_playlist');
$l_file_playlist->set_label("<b>Playlist</b>");
my $filter = Gtk2::FileFilter->new;
@@ -120,6 +125,8 @@ sub set_mode_file_gui()
$POOL = 0;
my $l_mode = $guixml->get_widget('l_mode');
$l_mode->set_label("<b>Sendung</b>");
+ my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
+ $cb_clear_carts->set_sensitive(0);
my $l_file_playlist = $guixml->get_widget('l_file_playlist');
$l_file_playlist->set_label("<b>Datei</b>");
my $filter = Gtk2::FileFilter->new;
@@ -149,7 +156,11 @@ sub start_import_gui()
my $filechooser = $guixml->get_widget('filechooser');
my $file = $filechooser->get_filename;
if(!$file || -d $file) {
- $l_status->set_label("No Playlist selected!");
+ if($POOL) {
+ $l_status->set_label("Keine Playlist ausgewählt!");
+ } else {
+ $l_status->set_label("Keine Audio Datei ausgewählt!");
+ }
return 0;
}
$filechooser->unselect_all;
@@ -157,7 +168,7 @@ sub start_import_gui()
my $co_dropbox = $guixml->get_widget('co_dropbox');
my $dropbox = $co_dropbox->get_active_text;
- $l_status->set_label("importing from $file");
+ $l_status->set_label("importiere von $file");
my $ret;
if($POOL) {
@@ -209,9 +220,9 @@ if(!$FILE && !$DROPBOX) {
(-e "$FILE") or die "file '$FILE' not found";
if($POOL) {
- print "Will import from playlist $FILE, with user $user\n\n";
+ print "will import from playlist $FILE, with user $user\n\n";
} else {
- print "Will import $FILE, with user $user\n\n";
+ print "will import $FILE, with user $user\n\n";
}
my $ret;