From b7c4d4b12e1ea547ed6028e3920b34e8eb932236 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Feb 2010 21:47:39 +0000 Subject: filling dropbox comob box with info git-svn-id: https://svn.helsinki.at/rhimport/trunk@9 7c65635b-ec39-4f67-a626-873dbafdd612 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"; -- cgit v0.10.2