[pve-devel] [PATCH installer 2/2] implement acknowledgement screen
Oguz Bektas
o.bektas at proxmox.com
Mon Dec 3 11:57:50 CET 2018
* adds an additional installation step before extracting the filesystem,
showing the user the options that were chosen during the installation.
* adapt the html file accordingly
Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
html-common/ipconf.htm | 4 +--
proxinstall | 85 ++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 74 insertions(+), 15 deletions(-)
diff --git a/html-common/ipconf.htm b/html-common/ipconf.htm
index ba699ed..2aefa90 100644
--- a/html-common/ipconf.htm
+++ b/html-common/ipconf.htm
@@ -19,8 +19,8 @@
the displayed network configuration. You will need a valid network
configuration to access the management interface after installation.
<br><br>
- Afterwards press the <b>Install</b> button to start the installation. The
- installer will then partition your hard disk and start copying packages.
+ Afterwards press the Next button. You will be displayed a list of the options
+ that you chose during the previous steps.
</td></tr>
</tbody></table>
</p></td>
diff --git a/proxinstall b/proxinstall
index 9970bf9..0631490 100755
--- a/proxinstall
+++ b/proxinstall
@@ -14,6 +14,7 @@ use IO::Select;
use Cwd 'abs_path';
use Gtk3 '-init';
use Gtk3::WebKit;
+use Gtk3::SimpleList;
use Encode;
use String::ShellQuote;
use Data::Dumper;
@@ -192,12 +193,16 @@ my $ipv4_reverse_mask = [
my $stack_number = 0; # init number for function stack
-my %function_stack = ( # global function stack
+my %function_stack = (
+
+ # Description: Hash for global function stack
+
1 => \&create_intro_view,
2 => \&create_hdsel_view,
3 => \&create_country_view,
4 => \&create_password_view,
5 => \&create_ipconf_view,
+ 6 => \&create_ack_view,
);
my ($window, $cmdbox, $inbox, $htmlview);
@@ -1697,7 +1702,7 @@ sub prev_fctn {
my ($text, $fctn) = @_;
- $stack_number = $stack_number - 1;
+ $stack_number--;
$fctn = $stack_number if !$fctn;
$text = "_Previous" if !$text;
$prev->set_label ($text);
@@ -1707,11 +1712,6 @@ sub prev_fctn {
$prev->grab_focus ();
}
-sub prev_available {
- $prev->set_sensitive (1);
- $prev->set_sensitive (0) if $stack_number <= 3;
-}
-
sub set_next {
my ($text, $fctn) = @_;
@@ -2030,7 +2030,7 @@ sub create_ipconf_view {
$vbox2->pack_start ($dnsbox, 0, 0, 0);
$inbox->show_all;
- set_next ('_Install', sub {
+ set_next (undef, sub {
# verify hostname
@@ -2116,12 +2116,73 @@ sub create_ipconf_view {
#print "TEST $ipaddress $netmask $gateway $dnsserver\n";
- create_extract_view ();
+ create_ack_view ();
});
$hostentry->grab_focus();
}
+sub create_ack_view {
+
+ # Description: Function for showing the user a list of
+ # the previously chosen options during install
+
+ $stack_number = 6;
+
+ cleanup_view ();
+
+ display_info ();
+
+ #display_html ('install.htm'); # TODO: show fitting html file
+
+ my $grid = Gtk3::Grid->new();
+ $grid->set_visible(1);
+ $grid->set_column_spacing(10);
+ $grid->set_row_spacing(10);
+ $grid->set_hexpand(1);
+
+ $grid->set_margin_start(7);
+ $grid->set_margin_end(7);
+ $grid->set_margin_top(7);
+ $grid->set_margin_bottom(7);
+
+
+ # acknowledge the following configs:
+ # a. target disk
+ # b. network configuration
+ # c. timezone/keyboard layout
+ # d. email
+
+ my $ack_list = Gtk3::SimpleList->new (
+ 'Option' => 'text',
+ 'Value' => 'text',
+ );
+
+ @{$ack_list->{data}} = (
+ [ 'disk', $target_hd ],
+ [ 'country' ,$country ],
+ [ 'timezone' ,$timezone ],
+ [ 'keymap' ,$keymap ],
+ [ 'mailto' ,$mailto ],
+ [ 'interface', $ipconf->{ifaces}->{$ipconf->{selected}}->{name} ],
+ [ 'hostname' ,$hostname ],
+ [ 'ip' ,$ipaddress ],
+ [ 'netmask' ,$netmask ],
+ [ 'gateway' ,$gateway ],
+ [ 'dnsserver' ,$dnsserver ],
+ );
+
+ $grid->add($ack_list);
+
+ $inbox->pack_start($grid, 1, 0, 0);
+ $inbox->show_all ();
+
+ set_next ('_Install', sub {
+ create_extract_view ();
+ });
+
+}
+
sub get_device_desc {
my ($devname, $size, $model) = @_;
@@ -2205,7 +2266,6 @@ sub update_zonelist {
sub create_password_view {
$stack_number = 4;
- $prev->set_sensitive (1); # enable previous button at this point
cleanup_view ();
@@ -2297,7 +2357,6 @@ sub create_password_view {
sub create_country_view {
$stack_number = 3;
- $prev->set_sensitive (0);
cleanup_view ();
@@ -2932,7 +2991,7 @@ sub get_btrfs_raid_setup {
sub create_hdsel_view {
$stack_number = 2;
- $prev->set_sensitive (0);
+ $prev->set_sensitive (1); # enable previous button at this point
cleanup_view ();
@@ -3021,7 +3080,7 @@ sub create_extract_view {
$vbox2->pack_start ($progress, 0, 0, 0);
- $inbox->show_all;
+ $inbox->show_all ();
my $tdir = $opt_testmode ? "target" : "/target";
mkdir $tdir;
--
2.11.0
More information about the pve-devel
mailing list