summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-02-21 03:59:29 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-02-21 03:59:29 (GMT)
commit90b00dff59efba90d6127a174026420f6f2ba113 (patch)
tree3490435301fb10a8c4dece8cd6ae317b1fd282b1 /rhimport
parent1786583bc9e4e2a2573cbc2470ffcff0b1cfd05d (diff)
added sanity checks
git-svn-id: https://svn.helsinki.at/rhimport/trunk@16 7c65635b-ec39-4f67-a626-873dbafdd612
Diffstat (limited to 'rhimport')
-rwxr-xr-xrhimport12
1 files changed, 9 insertions, 3 deletions
diff --git a/rhimport b/rhimport
index f25a430..c07b4d4 100755
--- a/rhimport
+++ b/rhimport
@@ -137,17 +137,23 @@ sub start_import_gui()
exit 0;
}
- my $co_dropbox = $guixml->get_widget('co_dropbox');
- my $dropbox = $co_dropbox->get_active_text;
+ my $l_status = $guixml->get_widget('l_status');
my $filechooser = $guixml->get_widget('filechooser');
my $m3u = $filechooser->get_filename;
+ if(!$m3u || -d $m3u) {
+ $l_status->set_label("No Playlist selected!");
+ return 0;
+ }
+ $filechooser->unselect_all;
+
+ my $co_dropbox = $guixml->get_widget('co_dropbox');
+ my $dropbox = $co_dropbox->get_active_text;
my $cb_concat = $guixml->get_widget('cb_concat');
my $concat = 1;
$concat = 0 unless $cb_concat->get_active;
- my $l_status = $guixml->get_widget('l_status');
$l_status->set_label("importing from $m3u");
rhimport::start_import($m3u, $dropbox, $concat);