aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Module
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo.pasotti@gmail.com>2014-09-16 00:13:52 +0200
committerMatteo Pasotti <matteo.pasotti@gmail.com>2014-09-16 00:13:52 +0200
commit54e27181f2f1fa1916a5f7b61829e32228f97560 (patch)
tree1244f71ee887ff8f9d62d2b5ac747b60d85ebe3b /lib/AdminPanel/Module
parent66c0d6fa5e9555b08e40961585e15f59e2403903 (diff)
downloadmanatools-54e27181f2f1fa1916a5f7b61829e32228f97560.tar
manatools-54e27181f2f1fa1916a5f7b61829e32228f97560.tar.gz
manatools-54e27181f2f1fa1916a5f7b61829e32228f97560.tar.bz2
manatools-54e27181f2f1fa1916a5f7b61829e32228f97560.tar.xz
manatools-54e27181f2f1fa1916a5f7b61829e32228f97560.zip
- select the radiobutton with the current value
- invoke addVarsInSh to save changes - check for root permissions
Diffstat (limited to 'lib/AdminPanel/Module')
-rw-r--r--lib/AdminPanel/Module/DisplayManager.pm26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/AdminPanel/Module/DisplayManager.pm b/lib/AdminPanel/Module/DisplayManager.pm
index a246cf74..12921089 100644
--- a/lib/AdminPanel/Module/DisplayManager.pm
+++ b/lib/AdminPanel/Module/DisplayManager.pm
@@ -35,7 +35,7 @@ use AdminPanel::Shared::GUI;
# TODROP but provides network::network
use lib qw(/usr/lib/libDrakX);
use network::network;
-use MDK::Common::System qw(getVarsFromSh);
+use MDK::Common::System qw(getVarsFromSh addVarsInSh);
extends qw( AdminPanel::Module );
@@ -147,13 +147,13 @@ sub _SharedUGUIInitialize {
sub start {
my $self = shift;
- # if ($EUID != 0) {
- # $self->sh_gui->warningMsgBox({
- # title => $self->name,
- # text => $self->loc->N("root privileges required"),
- # });
- # return;
- # }
+ if ($EUID != 0) {
+ $self->sh_gui->warningMsgBox({
+ title => $self->name,
+ text => $self->loc->N("root privileges required"),
+ });
+ return;
+ }
# initialize dm descriptions for i18n
$self->_build_desc_for_i18n();
@@ -202,7 +202,7 @@ sub _manageProxyDialog {
my ($dm_NAME) = apcat($self->conffile) =~ /^DISPLAYMANAGER=(.*)/m;
my $dm = (AdminPanel::Shared::find { uc($_->{NAME}) eq uc($dm_NAME) } @{$self->dmlist});
-
+
$self->dialog($factory->createMainDialog());
my $layout = $factory->createVBox($self->dialog);
@@ -230,6 +230,10 @@ sub _manageProxyDialog {
foreach my $d (@{$self->dmlist()})
{
my $rb = $factory->createRadioButton($factory->createHBox($factory->createLeft($rbbox)), $d->{NAME});
+ if($d->{NAME} eq uc($dm_NAME))
+ {
+ $rb->setValue(1);
+ }
$rb_group->addRadioButton($rb);
$rb->DISOWN();
}
@@ -268,7 +272,9 @@ sub _manageProxyDialog {
}
);
}elsif ($widget == $okButton) {
- next;
+ addVarsInSh($self->conffile, { DISPLAYMANAGER => lc($rb_group->currentButton()->label()) } );
+ $self->ask_for_X_restart();
+ last;
}
}
}