aboutsummaryrefslogtreecommitdiffstats
path: root/userdrake2
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-06-05 10:57:54 +0000
committerDaouda Lo <daouda@mandriva.com>2003-06-05 10:57:54 +0000
commit33b633e9b1412e3d53ba2fb755fb3a68ee5b501c (patch)
treed582b91c7e0d8de8cf437966bc60d374e544550b /userdrake2
parent19f1d67373316ad2762885b915dbebf22147ae95 (diff)
downloaduserdrake-33b633e9b1412e3d53ba2fb755fb3a68ee5b501c.tar
userdrake-33b633e9b1412e3d53ba2fb755fb3a68ee5b501c.tar.gz
userdrake-33b633e9b1412e3d53ba2fb755fb3a68ee5b501c.tar.bz2
userdrake-33b633e9b1412e3d53ba2fb755fb3a68ee5b501c.tar.xz
userdrake-33b633e9b1412e3d53ba2fb755fb3a68ee5b501c.zip
- cosmetic fixes
Diffstat (limited to 'userdrake2')
-rwxr-xr-xuserdrake240
1 files changed, 19 insertions, 21 deletions
diff --git a/userdrake2 b/userdrake2
index 8fc3c30..8c092f7 100755
--- a/userdrake2
+++ b/userdrake2
@@ -118,7 +118,7 @@ foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(0) };
my $ctx = USER::ADMIN->new;
Refresh($sysfilter);
$nb->signal_connect('switch-page' => sub { NotebookSwitch() });
-GetEvent($usertree); GetEvent($grouptree);
+#GetEvent($usertree); GetEvent($grouptree);
$us->{wnd}{rwindow}->show_all;
Gtk2->main;
ugtk2->exit;
@@ -132,24 +132,6 @@ sub NotebookSwitch {
my $page = $nb->get_current_page();
$page and TreeUnselect($usertree) or TreeUnselect($grouptree);
}
-sub GetEvent {
- my $treev = shift;
- $treev->signal_connect(button_press_event => sub {
- my (undef, $event) = @_;
- my (undef, $iter) = $treev->get_selection->get_selected;
- return unless $iter;
- foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(1) };
- Edit($iter) if $event->type eq '2button-press';
- $iter->free;
- });
- $treev->signal_connect(key_press_event => sub {
- my (undef, $event) = @_;
- my (undef, $iter) = $treev->get_selection->get_selected;
- return unless $iter;
- Edit($iter) if ($event->keyval == Gtk2::Gdk::Event::Key->Sym_Return);
- $iter->free;
- });
-}
sub Refresh_Users_Full {
my $filterusers = shift;
my $users = $ctx->UsersEnumerateFull();
@@ -366,7 +348,7 @@ sub AddGroup {
sub Delete {
my $page = $nb->get_current_page();
if ($page == 0) {
- print "page 0\n";
+ print "page 0";
} elsif ($page == 1) {
print "page 1\n";
}
@@ -376,9 +358,25 @@ sub Delete {
sub CreateTree {
my ($tree_model) = @_;
my $tree = Gtk2::TreeView->new_with_model($tree_model);
- $tree->get_selection->set_mode('browse');
+ $tree->get_selection->set_mode('single');
$tree->set_headers_visible(1);
$tree->set_rules_hint(1);
+ $tree->get_selection->signal_connect('changed' => sub { foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(1);} });
+ $tree->signal_connect(button_press_event => sub {
+ my (undef, $event) = @_;
+ my (undef, $iter) = $tree->get_selection->get_selected;
+ return unless $iter;
+ foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(1) };
+ Edit($iter) if $event->type eq '2button-press';
+ $iter->free;
+ });
+ $tree->signal_connect(key_press_event => sub {
+ my (undef, $event) = @_;
+ my (undef, $iter) = $tree->get_selection->get_selected;
+ return unless $iter;
+ Edit($iter) if ($event->keyval == Gtk2::Gdk::Event::Key->Sym_Return);
+ $iter->free;
+ });
$tree
}
sub gtkentry_hidepass {