summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-05-22 03:09:37 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-01-02 14:58:10 +0100
commit41fc00cea5d49e46870db72a5612cbe9f67f8e26 (patch)
tree92de7d9d752d764e8a41f4536933cf7d168f84fe
parente1a1d3d2e14a141ff17ab5c550eb966092a19aa9 (diff)
downloaddrakx-41fc00cea5d49e46870db72a5612cbe9f67f8e26.tar
drakx-41fc00cea5d49e46870db72a5612cbe9f67f8e26.tar.gz
drakx-41fc00cea5d49e46870db72a5612cbe9f67f8e26.tar.bz2
drakx-41fc00cea5d49e46870db72a5612cbe9f67f8e26.tar.xz
drakx-41fc00cea5d49e46870db72a5612cbe9f67f8e26.zip
split drakautologin from drakboot (mga#7160)
-rw-r--r--perl-install/Makefile.config2
-rw-r--r--perl-install/NEWS1
-rwxr-xr-xperl-install/standalone/drakautologin138
-rwxr-xr-xperl-install/standalone/drakboot112
4 files changed, 140 insertions, 113 deletions
diff --git a/perl-install/Makefile.config b/perl-install/Makefile.config
index 20d192612..aa55ea774 100644
--- a/perl-install/Makefile.config
+++ b/perl-install/Makefile.config
@@ -9,7 +9,7 @@ SO_FILES = c/blib/arch/auto/c/c.so
PMS_DIRS = c diskdrake harddrake interactive modules partition_table resize_fat security fs fs/remote
PMS = *.pm $(PMS_DIRS:%=%/*.pm) install/*.pm install/help/*.pm install/commands install/install2
-STANDALONEPMS_ = adduserdrake bootloader-config display_help display_release_notes.pl diskdrake drakauth drakboot drakbug drakbug_report drakclock drakedm drakdvb drakfont drakhelp drakperm draksec draksound drakupdate_fstab drakups drakxservices drakxtv fileshareset finish-install harddrake2 localedrake logdrake lsnetdrake notify-x11-free-driver-switch remove-unused-packages scannerdrake service_harddrake service_harddrake_confirm
+STANDALONEPMS_ = adduserdrake bootloader-config display_help display_release_notes.pl diskdrake drakauth drakautologin drakboot drakbug drakbug_report drakclock drakedm drakdvb drakfont drakhelp drakperm draksec draksound drakupdate_fstab drakups drakxservices drakxtv fileshareset finish-install harddrake2 localedrake logdrake lsnetdrake notify-x11-free-driver-switch remove-unused-packages scannerdrake service_harddrake service_harddrake_confirm
STANDALONEPMS = $(STANDALONEPMS_:%=standalone/%)
ALLPMS = $(PMS) $(STANDALONEPMS)
diff --git a/perl-install/NEWS b/perl-install/NEWS
index aff5089a3..89126549a 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -4,6 +4,7 @@
o suggest "lv_foo" instead of just "foo" for LVname
- drakboot:
o skip swap in the list of partitions (mga#15767)
+ o split drakautologin from drakboot (mga#7160)
Version 17.8 - 22 December 2015
diff --git a/perl-install/standalone/drakautologin b/perl-install/standalone/drakautologin
new file mode 100755
index 000000000..109f44a04
--- /dev/null
+++ b/perl-install/standalone/drakautologin
@@ -0,0 +1,138 @@
+#!/usr/bin/perl
+
+# DrakAutoLogin
+# Copyright (C) 2001-2008 Mandriva
+# Yves Duret, Thierry Vignaud
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+use strict;
+use diagnostics;
+use lib qw(/usr/lib/libDrakX);
+
+use standalone; #- warning, standalone must be loaded very first, for 'explanations'
+use common;
+use interactive;
+use any;
+use Xconfig::various;
+
+my $in = 'interactive'->vnew('su');
+
+require ugtk3;
+ugtk3->import(qw(:helpers :wrappers :create));
+require mygtk3;
+mygtk3->import(qw(gtknew));
+
+autologin_choice();
+
+sub run_boot_window {
+ my ($title, $pack_list, $apply_sub) = @_;
+
+ my $w = ugtk3->new($title);
+ my $window = $w->{window};
+ mygtk3::register_main_window($w->{real_window});
+
+ $window->signal_connect(delete_event => sub { ugtk3->exit(0) });
+ unless ($::isEmbedded) {
+ $window->set_border_width(2);
+ ### menus definition
+ # the menus are not shown but they provides shiny shortcut like C-q
+ my $ui = gtknew('UIManager', actions => [
+ # [name, stock_id, value, label, accelerator, tooltip, callback]
+ [ 'FileMenu', undef, N("_File") ],
+ [ 'Quit', undef, N("_Quit"), N("<control>Q"), undef, sub { ugtk3->exit(0) } ],
+ ],
+ string => qq(<ui>
+ <menubar name='MenuBar'>
+ <menu action='FileMenu'>
+ <menuitem action='Quit'/>
+ </menu>
+ </menubar>
+</ui>));
+ $w->{rwindow}->add_accel_group($ui->get_accel_group);
+
+ ######### menus end
+ }
+ gtkadd($window, gtknew('VBox', children => [
+ @$pack_list,
+ 0, create_okcancel({
+ cancel_clicked => sub { ugtk3->exit(0) },
+ ok_clicked => sub {
+ $apply_sub->();
+ ugtk3->exit(0);
+ }
+ }) ]));
+ $window->show_all;
+ gtkflush();
+ $w->main;
+ $in->exit(0);
+}
+
+sub autologin_choice() {
+ my @users = sort(list_users());
+ my @sessions = sort(split(' ', `/usr/sbin/chksession -l`));
+
+ my $x_mode = Xconfig::various::runlevel() == 5;
+ my $auto_mode = any::get_autologin();
+
+ my $user = member($auto_mode->{user}, @users) ? $auto_mode->{user} : $users[0];
+ if (!$user) {
+ # no user, bad but add root anyway:
+ $user = "root";
+ push @users, $user;
+ }
+ my $user_combo = gtknew('ComboBox', text => $user, list => \@users);
+ my $desktop_combo = Gtk3::ComboBoxText->new_with_strings(\@sessions, if_(member($auto_mode->{desktop}, @sessions), $auto_mode->{desktop}));
+
+ my $auto_box = gtknew('Table', col_spacings => 5, row_spacings => 5, homogeneous => 1, children => [
+ [ gtknew('Label_Left', text => N("Default user")), $user_combo ],
+ [ gtknew('Label_Left', text => N("Default desktop")), $desktop_combo ] ]);
+ $auto_box->set_sensitive($auto_mode->{user} ? 1 : 0);
+
+ my @auto_buttons = gtkradio((N("No, I do not want autologin")) x 2,
+ N("Yes, I want autologin with this (user, desktop)"));
+ $auto_buttons[1]->signal_connect('toggled' => sub { $auto_box->set_sensitive($auto_buttons[1]->get_active) });
+ $auto_buttons[0]->signal_connect('toggled' => sub { $auto_box->set_sensitive(!$auto_buttons[0]->get_active) });
+ $auto_buttons[1]->set_active(1) if $auto_mode->{user};
+ $auto_buttons[0]->set_active(1) if !$auto_mode->{user};
+
+ my $x_box;
+ run_boot_window(N("System mode"),
+ [
+ 1, gtknew('VBox', spacing => 5, children_tight => [
+ gtksignal_connect(gtkset_active(gtknew('CheckButton', text => N("Launch the graphical environment when your system starts")),
+ $x_mode),
+ clicked => sub {
+ $x_box->set_sensitive(!$x_mode);
+ $x_mode = !$x_mode;
+ }),
+ $x_box = gtknew('VBox', sensitive => $x_mode, children_tight => [
+ gtknew('VBox', children_tight => [ @auto_buttons ]),
+ $auto_box
+ ]) ])
+ ],
+ sub {
+ Xconfig::various::runlevel($x_mode ? 5 : 3);
+ $::testing and return;
+ if ($auto_buttons[1]->get_active) {
+ $auto_mode->{user} = $user_combo->entry->get_text;
+ $auto_mode->{desktop} = $desktop_combo->entry->get_text;
+ } else {
+ $auto_mode->{user} = undef;
+ $auto_mode->{desktop} = undef;
+ }
+ any::set_autologin($in->do_pkgs, $auto_mode);
+ });
+}
diff --git a/perl-install/standalone/drakboot b/perl-install/standalone/drakboot
index 77e1922c6..68e67d396 100755
--- a/perl-install/standalone/drakboot
+++ b/perl-install/standalone/drakboot
@@ -23,17 +23,12 @@ use diagnostics;
use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
-use c;
use common;
use interactive;
use any;
use bootloader;
use fsedit;
use fs;
-use Config;
-use POSIX;
-use Xconfig::various;
-use log;
my $in = 'interactive'->vnew('su');
@@ -64,110 +59,3 @@ if ($is_bootloader_mode) {
die if $@ && $@ !~ /^wizcancel/;
$in->exit(0);
}
-
-require ugtk3;
-ugtk3->import(qw(:helpers :wrappers :create));
-require mygtk3;
-mygtk3->import(qw(gtknew));
-
-autologin_choice();
-
-sub run_boot_window {
- my ($title, $pack_list, $apply_sub) = @_;
-
- my $w = ugtk3->new($title);
- my $window = $w->{window};
- mygtk3::register_main_window($w->{real_window});
-
- $window->signal_connect(delete_event => sub { ugtk3->exit(0) });
- unless ($::isEmbedded) {
- $window->set_border_width(2);
- ### menus definition
- # the menus are not shown but they provides shiny shortcut like C-q
- my $ui = gtknew('UIManager', actions => [
- # [name, stock_id, value, label, accelerator, tooltip, callback]
- [ 'FileMenu', undef, N("_File") ],
- [ 'Quit', undef, N("_Quit"), N("<control>Q"), undef, sub { ugtk3->exit(0) } ],
- ],
- string => qq(<ui>
- <menubar name='MenuBar'>
- <menu action='FileMenu'>
- <menuitem action='Quit'/>
- </menu>
- </menubar>
-</ui>));
- $w->{rwindow}->add_accel_group($ui->get_accel_group);
-
- ######### menus end
- }
- gtkadd($window, gtknew('VBox', children => [
- @$pack_list,
- 0, create_okcancel({
- cancel_clicked => sub { ugtk3->exit(0) },
- ok_clicked => sub {
- $apply_sub->();
- ugtk3->exit(0);
- }
- }) ]));
- $window->show_all;
- gtkflush();
- $w->main;
- $in->exit(0);
-}
-
-sub autologin_choice() {
- my @users = sort(list_users());
- my @sessions = sort(split(' ', `/usr/sbin/chksession -l`));
-
- my $x_mode = Xconfig::various::runlevel() == 5;
- my $auto_mode = any::get_autologin();
-
- my $user = member($auto_mode->{user}, @users) ? $auto_mode->{user} : $users[0];
- if (!$user) {
- # no user, bad but add root anyway:
- $user = "root";
- push @users, $user;
- }
- my $user_combo = gtknew('ComboBox', text => $user, list => \@users);
- my $desktop_combo = Gtk3::ComboBoxText->new_with_strings(\@sessions, if_(member($auto_mode->{desktop}, @sessions), $auto_mode->{desktop}));
-
- my $auto_box = gtknew('Table', col_spacings => 5, row_spacings => 5, homogeneous => 1, children => [
- [ gtknew('Label_Left', text => N("Default user")), $user_combo ],
- [ gtknew('Label_Left', text => N("Default desktop")), $desktop_combo ] ]);
- $auto_box->set_sensitive($auto_mode->{user} ? 1 : 0);
-
- my @auto_buttons = gtkradio((N("No, I do not want autologin")) x 2,
- N("Yes, I want autologin with this (user, desktop)"));
- $auto_buttons[1]->signal_connect('toggled' => sub { $auto_box->set_sensitive($auto_buttons[1]->get_active) });
- $auto_buttons[0]->signal_connect('toggled' => sub { $auto_box->set_sensitive(!$auto_buttons[0]->get_active) });
- $auto_buttons[1]->set_active(1) if $auto_mode->{user};
- $auto_buttons[0]->set_active(1) if !$auto_mode->{user};
-
- my $x_box;
- run_boot_window(N("System mode"),
- [
- 1, gtknew('VBox', spacing => 5, children_tight => [
- gtksignal_connect(gtkset_active(gtknew('CheckButton', text => N("Launch the graphical environment when your system starts")),
- $x_mode),
- clicked => sub {
- $x_box->set_sensitive(!$x_mode);
- $x_mode = !$x_mode;
- }),
- $x_box = gtknew('VBox', sensitive => $x_mode, children_tight => [
- gtknew('VBox', children_tight => [ @auto_buttons ]),
- $auto_box
- ]) ])
- ],
- sub {
- Xconfig::various::runlevel($x_mode ? 5 : 3);
- $::testing and return;
- if ($auto_buttons[1]->get_active) {
- $auto_mode->{user} = $user_combo->entry->get_text;
- $auto_mode->{desktop} = $desktop_combo->entry->get_text;
- } else {
- $auto_mode->{user} = undef;
- $auto_mode->{desktop} = undef;
- }
- any::set_autologin($in->do_pkgs, $auto_mode);
- });
-}