summaryrefslogtreecommitdiff
path: root/rhimport.pl
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport.pl')
-rwxr-xr-xrhimport.pl17
1 files changed, 14 insertions, 3 deletions
diff --git a/rhimport.pl b/rhimport.pl
index 08063e0..c5ef194 100755
--- a/rhimport.pl
+++ b/rhimport.pl
@@ -56,13 +56,11 @@ EOF
exit;
}
-my $user = 'martinland';#$ENV{'USER'};
+my $user = $ENV{'USER'};
$user or die "Username not found in environment";
# my $dbh = DBI->connect( "DBI:mysql:$DB:$DBHOST","$DBUSER","$DBPW") or die "Database Error: $DBI::errstr";
-
# my $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH from USER_PERMS, DROPBOXES where USER_PERMS.USER_NAME='$user' and DROPBOXES.GROUP_NAME=USER_PERMS.GROUP_NAME;};
-
# my $sth = $dbh->prepare($sql);
# $sth->execute();
my @allowed_dbs;
@@ -86,6 +84,7 @@ if($LISTALLOWED) {
exit 0;
}
+###########################################
## GUI mode
if(!$M3U) {
@@ -96,6 +95,17 @@ if(!$M3U) {
require gui_callbacks;
$guixml->signal_autoconnect_from_package('gui_callbacks');
+ my $model = Gtk2::ListStore->new ('Glib::String');
+ for my $href ( @allowed_dbs ) {
+ $model->set ($model->append, 0, $href->{'PATH'});
+ }
+ my $combo_db = $guixml->get_widget('co_dropbox');
+ $combo_db->set_model($model);
+ my $renderer = Gtk2::CellRendererText->new;
+ $combo_db->pack_start ($renderer, 1);
+ $combo_db->add_attribute ($renderer, text => 0);
+ $combo_db->set_active(0);
+
my $appwin = $guixml->get_widget('appwin');
$appwin or die "can't find Main Window";
$appwin->show;
@@ -105,6 +115,7 @@ if(!$M3U) {
exit 0;
}
+###########################################
## command line mode
(-e "$M3U") or die "file '$M3U' not found";