summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-03-25 17:36:50 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-03-25 17:36:50 (GMT)
commit7b1ee536f84eadb63776a1b7ff7b5b57fb3b1670 (patch)
treed8fbfedf5cc18242b3b261479f2f084a4c2d8b57
parent20f753dec4fa15abc9e7bd685d6666a3ce2e20e7 (diff)
get TO_CART field for dropboxes as well
git-svn-id: https://svn.helsinki.at/rhimport/trunk@26 7c65635b-ec39-4f67-a626-873dbafdd612
-rw-r--r--gui_callbacks.pm1
-rwxr-xr-xrhimport18
-rw-r--r--rhimport.pm5
3 files changed, 18 insertions, 6 deletions
diff --git a/gui_callbacks.pm b/gui_callbacks.pm
index 10d3881..f101cf7 100644
--- a/gui_callbacks.pm
+++ b/gui_callbacks.pm
@@ -58,6 +58,7 @@ sub on_co_dropbox_changed
my ($widget, $data) = @_;
::clear_status_gui();
+ ::dropbox_updated_gui();
}
sub on_filechooser_selection_changed
diff --git a/rhimport b/rhimport
index 5f5dfa0..aa3cd4a 100755
--- a/rhimport
+++ b/rhimport
@@ -236,23 +236,32 @@ sub clear_status_gui()
$progressbar->set_fraction(0);
}
+sub dropbox_updated_gui()
+{
+ if(!$guixml) {
+ print STDERR "no GUI definition found!\n";
+ exit 0;
+ }
+
+
+}
+
if(!$FILE || !$DROPBOX) {
Gtk2->init;
$guixml = Gtk2::GladeXML->new('rhimport.glade');
$guixml or die "can't load glade xml file";
require gui_callbacks;
- $guixml->signal_autoconnect_from_package('gui_callbacks');
- my $model = Gtk2::ListStore->new('Glib::String', 'Glib::String', 'Glib::String');
+ my $model = Gtk2::ListStore->new('Glib::String', 'Glib::String', 'Glib::String', 'Glib::String');
for my $href ( @allowed_dbs ) {
- $model->set ($model->append, 0, $href->{'PATH'}, 1, $href->{'GROUP'}, 2, $href->{'NAME'});
+ $model->set ($model->append, 0, $href->{'PATH'}, 1, $href->{'GROUP'}, 2, $href->{'TO_CART'}, 3, $href->{'NAME'});
}
my $co_dropbox = $guixml->get_widget('co_dropbox');
$co_dropbox->set_model($model);
my $renderer = Gtk2::CellRendererText->new;
$co_dropbox->pack_start($renderer, 1);
- $co_dropbox->add_attribute($renderer, text => 2);
+ $co_dropbox->add_attribute($renderer, text => 3);
$co_dropbox->set_active(0);
my $cb_clear_carts = $guixml->get_widget('cb_clear_carts');
@@ -268,6 +277,7 @@ if(!$FILE || !$DROPBOX) {
set_mode_file_gui();
}
+ $guixml->signal_autoconnect_from_package('gui_callbacks');
my $appwin = $guixml->get_widget('appwin');
$appwin or die "can't find Main Window";
$appwin->resize(800,600);
diff --git a/rhimport.pm b/rhimport.pm
index 2541660..4729969 100644
--- a/rhimport.pm
+++ b/rhimport.pm
@@ -30,11 +30,11 @@ sub get_dropboxes
my $dbh = shift;
my $user = shift;
- 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 $sql = qq{select USER_PERMS.GROUP_NAME,DROPBOXES.PATH,DROPBOXES.TO_CART 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;
- while(my ($group, $path) = $sth->fetchrow_array()) {
+ while(my ($group, $path, $to_cart) = $sth->fetchrow_array()) {
$path =~ s/\/\*$//;
my $name = $path;
$name =~ s/^\/programm\///;
@@ -59,6 +59,7 @@ sub get_dropboxes
my $perm = {};
$perm->{'GROUP'} = $group;
$perm->{'PATH'} = $path;
+ $perm->{'TO_CART'} = $to_cart;
$perm->{'NAME'} = $name;
push @allowed_dbs, $perm;
}