diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-02-20 21:47:39 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-02-20 21:47:39 (GMT) |
commit | 279ed0997adda2200d0fd2d62229e8885b17bdb7 (patch) | |
tree | 3bc52f6fa865941b688653d682085c257d5407ce | |
parent | 2b9308dc3accb620b84a9504101c00c33e046237 (diff) |
filling dropbox comob box with info
-rwxr-xr-x | rhimport.pl | 17 |
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"; |