summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-09-06 10:34:22 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-09-06 10:34:22 +0000
commitc0bf84bea00837c70ad62540e5a7b45f529e4221 (patch)
treee2c325e0b290d57e8bd34f463e53e73a2f92c212 /perl-install/standalone
parentb7d360feeb2441b33928d742a1778d9b11a02448 (diff)
downloaddrakx-backup-do-not-use-c0bf84bea00837c70ad62540e5a7b45f529e4221.tar
drakx-backup-do-not-use-c0bf84bea00837c70ad62540e5a7b45f529e4221.tar.gz
drakx-backup-do-not-use-c0bf84bea00837c70ad62540e5a7b45f529e4221.tar.bz2
drakx-backup-do-not-use-c0bf84bea00837c70ad62540e5a7b45f529e4221.tar.xz
drakx-backup-do-not-use-c0bf84bea00837c70ad62540e5a7b45f529e4221.zip
use my_gtk for embedded mode.
code must be cleaned up through my_gtk usage though.
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakperm24
1 files changed, 10 insertions, 14 deletions
diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm
index fdb553a5d..84135b75e 100755
--- a/perl-install/standalone/drakperm
+++ b/perl-install/standalone/drakperm
@@ -5,8 +5,7 @@ use standalone;
use MDK::Common;
-use Gtk;
-init Gtk;
+use my_gtk;
use interactive;
@@ -35,8 +34,10 @@ my $modified = 0;
my $prec_txt = $default_perm_level;
#my $bg = Gtk::Gdk::Color->parse_color('grey');
#- Widget declaration
-my $W = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window ("toplevel");
-$W->signal_connect(delete_event => sub { $::isEmbedded ? kill(USR1, $::CCPID) : &killapp });
+my $w = my_gtk->new('drakperm');
+my $W = $w->{window};
+#my $W = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window ("toplevel");
+$W->signal_connect(delete_event => sub { my_gtk->exit });
my $scroll = new Gtk::ScrolledWindow;
my $Perm_list = new_with_titles Gtk::CList((_("path"),_("user"),_("group"),_("permissions")));
my $vb = new Gtk::VBox(0,5);
@@ -65,11 +66,11 @@ $tips->set_tip($B_down,_("Down selected rule one level"));
$tips->set_tip($B_del,_("Delete selected rule"));
#- signal management
-$W->signal_connect(delete_event => \&killapp);
+$W->signal_connect(delete_event => sub { my_gtk->exit });
$Perm_list->signal_connect( select_row => \&row_setting_data );
#$Perm_list->signal_connect( unselect_row => sub{ undef(%CURENT)});
$B_sav->signal_connect( clicked => \&save_perm);
-$B_quit->signal_connect( clicked => \&killapp);
+$B_quit->signal_connect( clicked => sub { my_gtk->exit });
$B_edit->signal_connect( clicked => \&row_setting_dialog );
$B_add->signal_connect( clicked => sub{
$Perm_list->insert( $rows_cnt ,'');
@@ -140,24 +141,19 @@ $vb_->pack_start($F,1,1,5);
$W->add($vb_);
$W->show_all;
-$W->set_position('center');
+$w->{rwindow}->set_position('center') unless $::isEmbedded;
&display_perm($default_perm_level);
$combo_perm->entry->set_text($default_perm_level);
#- Gtk loop start here
-main Gtk;
+$w->main;
#- Should never get here
-exit 0;
+my_gtk->exit;
#- Built in functions
-sub killapp{
- $modified and (&check_save or return 0);
- Gtk->exit(0);
- return 0;
-}
sub check_save{
$modified or return 0;
my $sav_ = $in->ask_okcancel('Warning','your changed will be lost do you wish to continue?');