From 1df0cbc64656ac4431e4497c49a089c598acec18 Mon Sep 17 00:00:00 2001 From: Cyrille Pontvieux Date: Thu, 14 Feb 2013 02:14:55 +0100 Subject: [PATCH] - Rewrite to improve maintainance and readability. - 'Cancel' action can be done if there is something to cancel. - User accounts are now done, even in liveclone mode. - New way to know if the passwords are strong enough using a GtkLevelBar for Gtk2 ;-) --- src/salix-live-installer.glade | 2116 ++++++++++++++++++++------------ src/salix-live-installer.py | 382 ++++-- 2 files changed, 1607 insertions(+), 891 deletions(-) diff --git a/src/salix-live-installer.glade b/src/salix-live-installer.glade index 552614d..fef4aba 100644 --- a/src/salix-live-installer.glade +++ b/src/salix-live-installer.glade @@ -1,73 +1,137 @@ - + - + - + + True + True + True + 5 + True + True + gtk-about + normal + True + main_window + Salix Live Installer + Version + Copyright © 2010-2011 Pierrick Le Brun + SalixOS installation from SalixLive's graphic environment + http://www.salixos.org + salixos.org + 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 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, +MA 02110-1301, USA. + Pierrick Le Brun <akuna~at~salixos~dot~org> + translator-credits + salix-live-installer.png + + + + + True + False + 2 + + + True + False + end + + + False + True + end + 0 + + + + + + + + + + 59 + 1 + 1 + 10 + + + 23 + 1 + 10 + + + 59 + 1 + 1 + 10 + + - - - + - fr-latin9 - azerty + Paris + + + + + + + + - us - qwerty + Paris - + - - - - + + - fr_FR.utf8 - French locale for France + 30 - + - - - - - + - + - WDC (320GB) - /dev/sda1 - 160GB - ntfs - - - WDC (320GB) - /dev/sda2 - 160GB - xfs + fr-latin9 + azerty - Sandisk (8GB) - /dev/sdb1 - 8GB - fat32 + us + qwerty - + @@ -91,6 +155,9 @@ jfs + + Select... + @@ -119,26 +186,69 @@ - + - + + + + + + + + + + + + + + + - /mnt/windows - - - /mnt/xp + WDC (320GB) + /dev/sda1 + 160GB + ntfs + Do not format! + Do not mount! + gtk-add + gtk-yes - /mnt/vista + WDC (320GB) + /dev/sda2 + 160GB + xfs + Do not format! + Do not mount! + gtk-add + gtk-yes - /mnt/custom + Sandisk (8GB) + /dev/sdb1 + 8GB + fat32 + Do not format! + Do not mount! + gtk-add + gtk-yes + + + + + + + + + + - Select... + fr_FR.utf8 + French locale for France @@ -168,202 +278,168 @@ - + - - + + - 2000 + ext2 - 2001 + ext3 - 2002 + ext4 - 2003 + reiserfs - 2004 + xfs - 2005 + jfs - + - - + + + + + + + + - 30 + WDC (320GB) + /dev/sda1 + 160GB + ntfs - - - - - - - - - Paris - - - - - - - - - - - Paris - - - - - - - - - - - ext2 - - - ext3 - - - ext4 - - - reiserfs - - - xfs - - - jfs - - - Select... - - - - - - - - - - - - - - - - - - - - - WDC (320GB) - /dev/sda1 - 160GB - ntfs - Do not mount! - gtk-edit - - - WDC (320GB) - /dev/sda2 - 160GB - xfs - Do not mount! - gtk-edit - - - Sandisk (8GB) - /dev/sdb1 - 8GB - fat32 - Do not mount! - gtk-edit - - - - - - - - - - - - - - - - - - - - - - - - - WDC (320GB) - /dev/sda1 - 160GB - ntfs - Do not format! - Do not mount! - gtk-add - gtk-yes - - - WDC (320GB) - /dev/sda2 - 160GB - xfs - Do not format! - Do not mount! - gtk-add - gtk-yes - - - Sandisk (8GB) - /dev/sdb1 - 8GB - fat32 - Do not format! - Do not mount! - gtk-add - gtk-yes + WDC (320GB) + /dev/sda2 + 160GB + xfs + + + Sandisk (8GB) + /dev/sdb1 + 8GB + fat32 800 True + False Salix Live Installer center-always salix-live-installer.png - + True + False + + + True + False + edge + + + gtk-quit + True + True + True + False + True + + + + + + False + False + 0 + + + + + True + False + + + + + True + False + True + True + False + + + + + + True + False + + + True + False + gtk-execute + + + True + True + 0 + + + + + True + False + Launch Salix _installation + True + + + True + True + 1 + + + + + + + + + False + False + 1 + + + + + False + False + end + 0 + + 170 True + False 5 @@ -371,13 +447,15 @@ True True True + False none - - - + + + True + False salix-live-installer.png @@ -391,12 +469,14 @@ True - - + False + + 585 True + False 0 2 2 @@ -421,18 +501,22 @@ True + False 0 True + False 190 True + False 0 True + False 1 True @@ -442,19 +526,22 @@ True True True + False none - - - + + + True + False True True 5 True + False gtkclocksetup @@ -466,11 +553,14 @@ True + False _Time True time_tab + True + True end 1 @@ -479,6 +569,8 @@ + True + True 0 @@ -489,19 +581,22 @@ True True True + False none - - - + + + True + False True True 5 True + False preferences-desktop-keyboard @@ -513,11 +608,14 @@ True + False Key_board True keyboard_tab + True + True end 1 @@ -526,6 +624,8 @@ + True + True 1 @@ -534,18 +634,21 @@ True True True + False none - - - + + + True + False 5 12 True + False preferences-desktop-locale @@ -557,11 +660,14 @@ True + False Lo_cale True locale_tab + True + True end 1 @@ -570,6 +676,8 @@ + True + True 2 @@ -578,18 +686,21 @@ True True True + False none - - - + + + True + False 5 11 True + False drive-harddisk @@ -601,11 +712,14 @@ True + False _Partitions True partition_tab + True + True end 1 @@ -614,6 +728,8 @@ + True + True 3 @@ -622,18 +738,21 @@ True True True + False none - - - + + + True + False 5 11 True + False system-config-users @@ -646,11 +765,14 @@ 140 True + False U_sers True users_tab + True + True end 1 @@ -659,6 +781,8 @@ + True + True 4 @@ -667,18 +791,21 @@ True True True + False none - - - + + + True + False 10 11 True + False package-x-generic @@ -690,11 +817,14 @@ True + False S_oftware True packages_tab + True + True end 1 @@ -703,11 +833,15 @@ + True + True 5 + True + True 0 @@ -715,11 +849,14 @@ 40 True + False True + False + False gtk-yes @@ -731,22 +868,29 @@ True + False + True + True 1 + True + True 0 True + False + False gtk-yes @@ -758,22 +902,29 @@ True + False + True + True 1 + True + True 1 True + False + False gtk-yes @@ -785,22 +936,29 @@ True + False + True + True 1 + True + True 2 True + False + False gtk-yes @@ -812,22 +970,29 @@ True + False + True + True 1 + True + True 3 True + False + False gtk-yes @@ -839,22 +1004,29 @@ True + False + True + True 1 + True + True 4 True + False + False gtk-yes @@ -866,19 +1038,26 @@ True + False + True + True 1 + True + True 5 + True + True 3 1 @@ -893,9 +1072,11 @@ True + False False + True 7 1 @@ -903,19 +1084,23 @@ True + False True + False 1 True - - + False + + 580 True + False 0 Salix Live Installer will perform a standard installation of Salix Operating System on your computer. @@ -932,21 +1117,27 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 0 + True + True 0 + False 1 580 True + False 0 <b>Please set the time, date and time zone:</b> True @@ -962,24 +1153,31 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 375 True + False 0 0 world-timezones.png + True + True 0 True + False + True + True 5 1 @@ -987,8 +1185,9 @@ Contextual help triggered by the mouse position is available each step of the wa True - - + False + + True @@ -998,10 +1197,12 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 0.5 True + False True @@ -1009,19 +1210,28 @@ Contextual help triggered by the mouse position is available each step of the wa 2 2 1 + False + False + True + True adjustment2 1 + True + True 0 True + False : + True + True 1 @@ -1032,19 +1242,28 @@ Contextual help triggered by the mouse position is available each step of the wa 2 2 1 + False + False + True + True adjustment1 1 + True + True 2 True + False : + True + True 3 @@ -1055,10 +1274,16 @@ Contextual help triggered by the mouse position is available each step of the wa 2 2 1 + False + False + True + True adjustment3 1 + True + True 4 @@ -1067,6 +1292,7 @@ Contextual help triggered by the mouse position is available each step of the wa True + False hour : min : sec True @@ -1081,25 +1307,32 @@ Contextual help triggered by the mouse position is available each step of the wa True + False + True + True 1 True + False True + False True + False 1 Year: + True False 0 @@ -1107,10 +1340,12 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 1 Month: + True False 1 @@ -1118,25 +1353,31 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 1 Day: + True False 2 + True + True 0 True + False True + False year_list_store @@ -1146,6 +1387,7 @@ Contextual help triggered by the mouse position is available each step of the wa + True False 0 @@ -1153,6 +1395,7 @@ Contextual help triggered by the mouse position is available each step of the wa True + False month_list_store @@ -1162,6 +1405,7 @@ Contextual help triggered by the mouse position is available each step of the wa + True False 1 @@ -1169,6 +1413,7 @@ Contextual help triggered by the mouse position is available each step of the wa True + False day_list_store @@ -1178,12 +1423,15 @@ Contextual help triggered by the mouse position is available each step of the wa + True False 2 + True + True 1 @@ -1197,9 +1445,12 @@ Contextual help triggered by the mouse position is available each step of the wa True + False + True + True 3 @@ -1207,34 +1458,43 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 2 + True + True 1 True + False 10 True - - + False + + 375 True + False True + False Time zone: False + True 0 @@ -1243,7 +1503,7 @@ Contextual help triggered by the mouse position is available each step of the wa True True continent_zone_list_store - + @@ -1253,14 +1513,16 @@ Contextual help triggered by the mouse position is available each step of the wa False + True 1 True + False country_zone_list_store - + @@ -1270,6 +1532,7 @@ Contextual help triggered by the mouse position is available each step of the wa False + True 2 @@ -1277,6 +1540,8 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 0 @@ -1286,13 +1551,14 @@ Contextual help triggered by the mouse position is available each step of the wa True True False + False 1 right True True - - - + + + False @@ -1303,6 +1569,7 @@ Contextual help triggered by the mouse position is available each step of the wa + True False 2 @@ -1310,6 +1577,7 @@ Contextual help triggered by the mouse position is available each step of the wa True + False edge @@ -1317,10 +1585,11 @@ Contextual help triggered by the mouse position is available each step of the wa True True True + False True - - - + + + False @@ -1334,10 +1603,11 @@ Contextual help triggered by the mouse position is available each step of the wa True True True + False True - - - + + + False @@ -1356,16 +1626,20 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 1 + False 1 580 True + False 0 <b>Please select your keyboard layout:</b> True @@ -1379,30 +1653,110 @@ Contextual help triggered by the mouse position is available each step of the wa - + True - True - never - automatic + False + edge - + + gtk-undo True True - keymap_list_store - False - True - 0 - - + True + False + True + + + + + + False + False + 0 + + + + + True + True + True + False + + + - - autosize - Layout + + True + False - - - 0 - + + True + False + gtk-yes + + + True + True + 0 + + + + + True + False + Select _keyboard + True + keyboard_apply + + + True + True + 1 + + + + + + + False + False + 1 + + + + + False + False + 3 + end + 1 + + + + + True + True + never + automatic + + + True + True + keymap_list_store + False + True + 0 + + + + + autosize + Layout + + + + 0 + @@ -1422,12 +1776,15 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 2 True + False 75 @@ -1435,10 +1792,11 @@ Contextual help triggered by the mouse position is available each step of the wa True True False + False True - - - + + + False @@ -1452,11 +1810,12 @@ Contextual help triggered by the mouse position is available each step of the wa True True False + False none True - - - + + + False @@ -1474,17 +1833,21 @@ Contextual help triggered by the mouse position is available each step of the wa True + False True - - + False + + True + False True + False 0 <b>Selected keyboard layout: </b> True @@ -1498,10 +1861,13 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 0 None + True + True 1 @@ -1517,8 +1883,11 @@ Contextual help triggered by the mouse position is available each step of the wa True + False + True + True 1 @@ -1530,20 +1899,50 @@ Contextual help triggered by the mouse position is available each step of the wa 4 + + + True + True + 2 + + + + + False + 1 - + + 580 + True + False + 0 + <b>Please select your system language:</b> + True + True + + + False + False + 5 + 0 + + + + True + False edge - + gtk-undo True True True + False True - - - + + + False @@ -1552,33 +1951,41 @@ Contextual help triggered by the mouse position is available each step of the wa - + True True True - - - + False + + + - + True + False - + True + False gtk-yes + True + True 0 - + True - Select _keyboard + False + Select _language True - keyboard_apply + locale_apply + True + True 1 @@ -1600,30 +2007,6 @@ Contextual help triggered by the mouse position is available each step of the wa 1 - - - 2 - - - - - 1 - - - 580 - True - 0 - <b>Please select your system language:</b> - True - True - - - False - False - 5 - 0 - - True @@ -1638,8 +2021,8 @@ Contextual help triggered by the mouse position is available each step of the wa False True 0 - - + + Locale @@ -1667,23 +2050,29 @@ Contextual help triggered by the mouse position is available each step of the wa + True + True 2 True + False True - - + False + + True + False True + False 0 <b>Selected system language: </b> True @@ -1697,10 +2086,13 @@ Contextual help triggered by the mouse position is available each step of the wa True + False 0 None + True + True 1 @@ -1716,8 +2108,11 @@ Contextual help triggered by the mouse position is available each step of the wa True + False + True + True 1 @@ -1729,88 +2124,21 @@ Contextual help triggered by the mouse position is available each step of the wa 3 - - - True - edge - - - gtk-undo - True - True - True - True - - - - - - False - False - 0 - - - - - True - True - True - - - - - - True - - - True - gtk-yes - - - 0 - - - - - True - Select _language - True - locale_apply - - - 1 - - - - - - - False - False - 1 - - - - - False - False - 3 - end - 1 - - + True + True 3 - vertical + False 580 True + False 0 2 <b>Important!</b> @@ -1824,6 +2152,8 @@ If you already have all the needed partitions, please click on the button 'Do no True + True + True 3 0 @@ -1831,30 +2161,39 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True True True - + False + True + False True + False Modify partition scheme + True + True 0 True + False gparted + True + True 1 @@ -1872,25 +2211,33 @@ If you already have all the needed partitions, please click on the button 'Do no True True True - + False + True + False True + False Do not modify partition scheme + True + True 0 True + False gtk-go-forward + True + True 1 @@ -1905,21 +2252,27 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 1 + True + True 4 + False 1 580 True + False 0 <b>Please select Salix main partition:</b> True @@ -1949,8 +2302,8 @@ If you already have all the needed partitions, please click on the button 'Do no False True 0 - - + + Disk @@ -2003,6 +2356,8 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 2 @@ -2012,10 +2367,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True False + False True - - - + + + False @@ -2027,6 +2383,7 @@ If you already have all the needed partitions, please click on the button 'Do no 580 True + False 0 From the above partitions found on your system, please select the one where Salix' main directory tree (/) should be installed. <b>Warning!</b> This partition will be reformatted and its data will be permanently erased. @@ -2043,17 +2400,21 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True - - + False + + True + False True + False 1 Format with: @@ -2066,6 +2427,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False main_format_list_store 2 False @@ -2094,8 +2456,11 @@ If you already have all the needed partitions, please click on the button 'Do no True + False + True + True 1 @@ -2104,29 +2469,37 @@ If you already have all the needed partitions, please click on the button 'Do no True True True - - - + False + + + True + False True + False gtk-ok + True + True 0 True + False Select _partition True main_partition_apply + True + True 1 @@ -2149,16 +2522,20 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 5 + False 1 580 True + False 0 <b>Please configure your other Linux partition(s):</b> True @@ -2185,8 +2562,8 @@ If you already have all the needed partitions, please click on the button 'Do no False True 0 - - + + False @@ -2248,9 +2625,9 @@ If you already have all the needed partitions, please click on the button 'Do no - - - + + + 4 @@ -2270,9 +2647,9 @@ If you already have all the needed partitions, please click on the button 'Do no - - - + + + 5 @@ -2284,6 +2661,8 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 1 @@ -2291,6 +2670,7 @@ If you already have all the needed partitions, please click on the button 'Do no 580 True + False 0 It appears that you have more than one Linux partition. If you wish, you can now spread Salix directory tree on separate partitions. In fact, it is highly recommended to have the /home directory on a separate partition. True @@ -2306,35 +2686,44 @@ If you already have all the needed partitions, please click on the button 'Do no True + False end True True True - - - + False + + + True + False True + False gtk-yes + True + True 0 True + False Apply _settings True linux_partition_apply + True + True 1 @@ -2359,16 +2748,20 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 6 + False 1 580 True + False 0 <b>Please configure your Windows partition(s):</b> True @@ -2396,8 +2789,8 @@ If you already have all the needed partitions, please click on the button 'Do no False True 0 - - + + False @@ -2459,9 +2852,9 @@ If you already have all the needed partitions, please click on the button 'Do no - - - + + + 4 @@ -2473,6 +2866,8 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 1 @@ -2480,6 +2875,7 @@ If you already have all the needed partitions, please click on the button 'Do no 580 True + False 0 It appears that some of your partitions have a Windows formatting. Here you can set a mount point for each one if you wish them to be accessible in Salix system. True @@ -2495,35 +2891,44 @@ If you already have all the needed partitions, please click on the button 'Do no True + False end True True True - - - + False + + + True + False True + False gtk-yes + True + True 0 True + False Apply _settings True windows_partition_apply + True + True 1 @@ -2548,23 +2953,29 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 7 + False 1 True - - + False + + True + False True + False 0 <b>Salix main partition:</b> True @@ -2578,6 +2989,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 Main partition @@ -2590,6 +3002,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 <b>Other Linux partitions:</b> True @@ -2603,6 +3016,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 Home partition @@ -2615,6 +3029,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 <b>Windows partitions:</b> True @@ -2628,6 +3043,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 Windows partitions @@ -2640,6 +3056,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 <b>Swap partitions:</b> True @@ -2653,6 +3070,7 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 Swap partitions @@ -2666,12 +3084,15 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 0 True + False start @@ -2679,10 +3100,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True True + False True - - - + + + False @@ -2700,56 +3122,67 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 8 + False - - + False + + True - vertical + False True + False True True False + False True - - - + + + True + False <b>Transfer LiveClone login accounts</b> True + True + True 0 True + False gtk-undo True True True + False True - - - + + + False @@ -2763,10 +3196,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True True + False True - - - + + + False @@ -2783,15 +3217,19 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 0 True + False False + True 1 @@ -2799,22 +3237,27 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 0 True - - + False + + True + False 1 580 True + False 0 <b>Please create a new standard user:</b> True @@ -2830,9 +3273,11 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True + False Enter login: @@ -2845,8 +3290,12 @@ If you already have all the needed partitions, please click on the button 'Do no True True - - + False + False + True + True + + False @@ -2856,15 +3305,19 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 1 True + False True + False Enter password: @@ -2877,8 +3330,13 @@ If you already have all the needed partitions, please click on the button 'Do no True True - - + False + False + True + True + + + False @@ -2888,32 +3346,33 @@ If you already have all the needed partitions, please click on the button 'Do no - - Do not hide + + 100 True - True - False - True - - - + False - 3 + False + False + 10 2 + True + True 2 True + False True + False Re-enter password: @@ -2926,8 +3385,12 @@ If you already have all the needed partitions, please click on the button 'Do no True True - - + False + False + True + True + + False @@ -2936,17 +3399,40 @@ If you already have all the needed partitions, please click on the button 'Do no 1 + + + Do not hide + True + True + False + False + True + + + + + + True + True + 3 + 2 + + + True + True 3 True + False True + False 0 <b>User created: </b> True @@ -2960,10 +3446,13 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 None + True + True 2 1 @@ -2971,16 +3460,18 @@ If you already have all the needed partitions, please click on the button 'Do no True + False gtk-undo True True True + False True - - - + + + False @@ -2994,10 +3485,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True True + False True - - - + + + False @@ -3023,9 +3515,11 @@ If you already have all the needed partitions, please click on the button 'Do no True + False False + True 4 5 @@ -3034,6 +3528,7 @@ If you already have all the needed partitions, please click on the button 'Do no 580 True + False 0 <b>Please create a new administrator's password:</b> True @@ -3049,9 +3544,11 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True + False Enter root password: @@ -3064,8 +3561,13 @@ If you already have all the needed partitions, please click on the button 'Do no True True - - + False + False + True + True + + + False @@ -3075,32 +3577,33 @@ If you already have all the needed partitions, please click on the button 'Do no - - Do not hide + + 100 True - True - False - True - - - + False - 3 + False + False + 10 2 + True + True 7 True + False True + False Re-enter root password: @@ -3113,8 +3616,12 @@ If you already have all the needed partitions, please click on the button 'Do no True True - - + False + False + True + True + + False @@ -3123,17 +3630,40 @@ If you already have all the needed partitions, please click on the button 'Do no 1 + + + Do not hide + True + True + False + False + True + + + + + + True + True + 3 + 2 + + + True + True 8 True + False True + False 0 <b>Password created: </b> True @@ -3147,26 +3677,31 @@ If you already have all the needed partitions, please click on the button 'Do no True + False 0 None + True + True 1 True + False gtk-undo True True True + False True - - - + + + False @@ -3180,10 +3715,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True True + False True - - - + + + False @@ -3210,21 +3746,27 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 1 + True + True 9 + False 1 580 True + False 0 <b>Please select your installation mode:</b> True @@ -3238,19 +3780,21 @@ If you already have all the needed partitions, please click on the button 'Do no - + True + False + edge - - Core - 120 + + gtk-undo True True - False - True - full_radiobutton - - + True + False + True + + + False @@ -3259,33 +3803,91 @@ If you already have all the needed partitions, please click on the button 'Do no - + + gtk-apply True - - - True - utilities-terminal - - - 5 - 0 - - + True + True + False + True + + + False False + end 1 - 2 + False + False + 3 + end + 1 - + True + False + + + Core + 120 + True + True + False + False + True + full_radiobutton + + + + + False + False + 0 + + + + + True + False + + + True + False + utilities-terminal + + + True + True + 5 + 0 + + + + + False + False + 1 + + + + + True + True + 2 + + + + + True + False Basic @@ -3293,10 +3895,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True False + False True full_radiobutton - - + + False @@ -3307,12 +3910,16 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True + False utilities-terminal + True + True 5 0 @@ -3320,9 +3927,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False preferences-desktop-wallpaper + True + True 5 1 @@ -3330,9 +3940,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False applications-internet + True + True 5 2 @@ -3340,9 +3953,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False gslapt + True + True 5 3 @@ -3356,12 +3972,15 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 3 True + False Full @@ -3369,10 +3988,11 @@ If you already have all the needed partitions, please click on the button 'Do no True True False + False True True - - + + False @@ -3383,12 +4003,16 @@ If you already have all the needed partitions, please click on the button 'Do no True + False True + False utilities-terminal + True + True 5 0 @@ -3396,9 +4020,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False preferences-desktop-wallpaper + True + True 5 1 @@ -3406,9 +4033,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False applications-internet + True + True 5 2 @@ -3416,9 +4046,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False gslapt + True + True 5 3 @@ -3426,9 +4059,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False claws-mail + True + True 5 4 @@ -3436,9 +4072,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False applications-office + True + True 5 5 @@ -3446,9 +4085,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False applications-multimedia + True + True 5 6 @@ -3456,9 +4098,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False applications-graphics + True + True 5 7 @@ -3466,9 +4111,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False brasero + True + True 5 8 @@ -3476,19 +4124,39 @@ If you already have all the needed partitions, please click on the button 'Do no True + False pidgin + True + True 5 9 + + + True + False + 0 + ... + + + True + True + end + 10 + + True + False exaile + True + True 5 11 @@ -3496,9 +4164,12 @@ If you already have all the needed partitions, please click on the button 'Do no True + False epdfview + True + True 5 12 @@ -3506,24 +4177,16 @@ If you already have all the needed partitions, please click on the button 'Do no True + False transmission + True + True 5 13 - - - True - 0 - ... - - - end - 10 - - False @@ -3533,72 +4196,33 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 4 True + False + True + True 5 - - - True - edge - - - gtk-undo - True - True - True - True - - - - - - False - False - 0 - - - - - gtk-apply - True - True - True - True - - - - - - False - False - end - 1 - - - - - False - False - 3 - end - 1 - - + True + True 10 + True + True 5 2 @@ -3610,145 +4234,166 @@ If you already have all the needed partitions, please click on the button 'Do no + True + True 2 - - - True - edge - - - gtk-quit - True - True - True - True - - - - - - False - False - 0 - - - - - True - - - - - True - False - True - True - - - - - - True - - - True - gtk-execute - - - 0 - - - - - True - Launch Salix _installation - True - - - 1 - - - - - - - - - False - False - 1 - - - - - False - False - end - 0 - - - + True True True 5 + Salix installation + False True - True - gtk-about + center-always + salix-live-installer.png normal - True + False main_window - Salix Live Installer - Version - Copyright © 2010-2011 Pierrick Le Brun - SalixOS installation from SalixLive's graphic environment - http://www.salixos.org - salixos.org - 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 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, -MA 02110-1301, USA. - Pierrick Le Brun <akuna~at~salixos~dot~org> - translator-credits - salix-live-installer.png - - - + True + False 2 - - - - + True + False end + + + False + True end 0 + + + True + False + Please be patient, Salix installation is in progress... + + + True + True + 1 + + + + + True + False + True + + + True + True + 2 + + + + + + + + + + /mnt/windows + + + /mnt/xp + + + /mnt/vista + + + /mnt/custom + + + Select... + + + + + + + + + + + + + + + + + + + + + WDC (320GB) + /dev/sda1 + 160GB + ntfs + Do not mount! + gtk-edit + + + WDC (320GB) + /dev/sda2 + 160GB + xfs + Do not mount! + gtk-edit + + + Sandisk (8GB) + /dev/sdb1 + 8GB + fat32 + Do not mount! + gtk-edit + + + + + + + + + + + 2000 + + + 2001 + + + 2002 + + + 2003 + + + 2004 + + + 2005 + + + True True @@ -3764,16 +4409,22 @@ MA 02110-1301, USA. True + False 2 - - + + True + False + end - + + gtk-no True - 0 - <b>Message about the particular choice: </b> - True + True + True + False + True + False @@ -3782,11 +4433,14 @@ MA 02110-1301, USA. - + + gtk-yes True - 0 - <b>Do you want to proceed with this?</b> - True + True + True + False + True + False @@ -3798,21 +4452,21 @@ MA 02110-1301, USA. False False - 1 + end + 0 - - + + True - end + False - - gtk-no + True - True - True - True - + False + 0 + <b>Message about the particular choice: </b> + True False @@ -3821,14 +4475,12 @@ MA 02110-1301, USA. - - gtk-yes + True - True - True - True - - + False + 0 + <b>Do you want to proceed with this?</b> + True False @@ -3840,8 +4492,7 @@ MA 02110-1301, USA. False False - end - 0 + 1 @@ -3851,73 +4502,4 @@ MA 02110-1301, USA. confirm_button - - True - True - True - 5 - Salix installation - False - True - center-always - salix-live-installer.png - normal - False - main_window - - - True - 2 - - - True - Please be patient, Salix installation is in progress... - - - 1 - - - - - True - True - - - 2 - - - - - True - end - - - - - - False - end - 0 - - - - - - - 1 - 59 - 1 - 10 - - - 23 - 1 - 10 - - - 1 - 59 - 1 - 10 - diff --git a/src/salix-live-installer.py b/src/salix-live-installer.py index c4f25ab..2d5df91 100755 --- a/src/salix-live-installer.py +++ b/src/salix-live-installer.py @@ -33,6 +33,7 @@ import sys import glob import re +import math from datetime import * import salix_livetools_library as sltl @@ -121,20 +122,30 @@ def __init__(self, is_test = False, is_test_clone = False): self.BasicRadioButton = builder.get_object("basic_radiobutton") self.BasicHBox = builder.get_object("basic_hbox") self.FullRadioButton = builder.get_object("full_radiobutton") + self.PackagesUndoButton = builder.get_object("packages_undo") self.PackagesApplyButton = builder.get_object("packages_apply") + self.TimeUndoButton = builder.get_object("time_undo") self.TimeApplyButton = builder.get_object("time_apply") + self.KeyboardUndoButton = builder.get_object("keyboard_undo") self.KeyboardApplyButton = builder.get_object("keyboard_apply") + self.LocaleUndoButton = builder.get_object("locale_undo") self.LocaleApplyButton = builder.get_object("locale_apply") self.CloneLoginEventbox = builder.get_object("clone_login_eventbox") self.UsersEventbox = builder.get_object("users_eventbox") self.CloneLoginCheckbutton = builder.get_object("clone_login_checkbutton") self.CloneLoginUndo = builder.get_object("clone_login_undo") self.CloneLoginApply = builder.get_object("clone_login_apply") - self.RootPass1Entry = builder.get_object("root_pass1_entry") - self.RootPass2Entry = builder.get_object("root_pass2_entry") + self.UserLoginEntry = builder.get_object("user_login_entry") self.UserPass1Entry = builder.get_object("user_pass1_entry") + self.UserPass1Entry.set_visibility(False) self.UserPass2Entry = builder.get_object("user_pass2_entry") - self.UserLoginEntry = builder.get_object("user_login_entry") + self.UserPass2Entry.set_visibility(False) + self.UserPassStrength = builder.get_object("user_pass_strength") + self.RootPass1Entry = builder.get_object("root_pass1_entry") + self.RootPass1Entry.set_visibility(False) + self.RootPass2Entry = builder.get_object("root_pass2_entry") + self.RootPass2Entry.set_visibility(False) + self.RootPassStrength = builder.get_object("root_pass_strength") self.UserVisibleCheckButton = builder.get_object("user_visible_checkbutton") self.RootVisibleCheckButton = builder.get_object("root_visible_checkbutton") self.ExternalDeviceCheckButton = builder.get_object("external_device_checkbutton") @@ -142,7 +153,9 @@ def __init__(self, is_test = False, is_test_clone = False): self.IBusCheckButton = builder.get_object("ibus_checkbutton") self.RootPassCreated = builder.get_object("root_pass_created") self.NewUserLogin = builder.get_object("new_user_login") + self.UsersUndoButton = builder.get_object("users_undo") self.UsersApplyButton = builder.get_object("users_apply") + self.RootPassUndoButton = builder.get_object("rootpass_undo") self.RootPassApplyButton = builder.get_object("rootpass_apply") self.InstallButton = builder.get_object("install_button") self.YearCombobox = builder.get_object("year_combobox") @@ -187,7 +200,7 @@ def __init__(self, is_test = False, is_test_clone = False): # Indicate if the partition wizard is done or not self.partition_done = False # Initialize the lock system preventing the Install button to be activated prematurely - self.configurations = {'time':False, 'keyboard':False, 'locale':False, 'partitions':False, 'user':False, 'root':False, 'packages':False} + self.configurations = {'time':False, 'keyboard':False, 'locale':False, 'partitions':False, 'clonelogins':False, 'user':False, 'root':False, 'packages':False} self.get_current_config() self.build_data_stores() self.update_install_button() @@ -398,6 +411,7 @@ def on_button_quit_clicked(self, widget, data=None): def get_current_config(self): print 'Gathering current configuration…', + sys.stdout.flush() if self.is_test: self.is_live = True self.is_liveclone = self.is_test_clone @@ -430,11 +444,17 @@ def get_current_config(self): self.cur_use_numlock = sltl.isNumLockEnabledByDefault() self.cur_use_ibus = sltl.isIbusEnabledByDefault() self.cur_locale = sltl.getCurrentLocale() + self.keep_live_logins = self.is_liveclone + self.new_login = '' # None cannot be used in a GtkEntry + self.new_password = '' + self.new_root_password = '' self.install_mode = None print ' Done' + sys.stdout.flush() def build_data_stores(self): print 'Building choice lists…', + sys.stdout.flush() self.ContinentZoneListStore.clear() self.ContinentZoneListStore.append([_("Select...")]) self.ContinentZoneCombobox.set_active(0) @@ -458,6 +478,7 @@ def build_data_stores(self): for l in sltl.listAvailableLocales(): self.LocaleListStore.append(l) print ' Done' + sys.stdout.flush() def add_custom_signals(self): self.KeyboardList.get_selection().connect('changed', self.on_keyboard_list_changed_event) @@ -544,7 +565,6 @@ def time_settings(self): index += 1 self.time_set_cities_list() self.NTPCheckButton.set_active(self.cur_use_ntp) - self.ManualTimeBox.set_sensitive(not self.cur_use_ntp) year, month, day, hour, minute, second, __, __, __ = datetime.now().timetuple() index = 0 for y in self.YearListStore: @@ -557,6 +577,18 @@ def time_settings(self): self.HourSpinButton.set_value(hour) self.MinuteSpinButton.set_value(minute) self.SecondSpinButton.set_value(second) + self.ManualTimeBox.set_sensitive(not self.configurations['time'] and not self.cur_use_ntp) + self.NTPCheckButton.set_sensitive(not self.configurations['time']) + self.TimeZoneBox.set_sensitive(not self.configurations['time']) + self.TimeUndoButton.set_sensitive(self.configurations['time']) + self.TimeApplyButton.set_sensitive(not self.configurations['time']) + if self.configurations['time']: + self.TimeCheck.show() + self.TimeCheckMarker.hide() + else: + self.TimeCheck.hide() + self.TimeCheckMarker.show() + self.update_install_button() def time_set_cities_list(self): self.CountryZoneListStore.clear() self.CountryZoneListStore.append([_("Select...")]) @@ -585,34 +617,37 @@ def on_ntp_checkbutton_toggled(self, widget, data=None): self.cur_use_ntp = self.NTPCheckButton.get_active() self.ManualTimeBox.set_sensitive(not self.cur_use_ntp) def on_time_apply_clicked(self, widget, data=None): - self.ManualTimeBox.set_sensitive(False) - self.NTPCheckButton.set_sensitive(False) - self.TimeZoneBox.set_sensitive(False) - self.TimeApplyButton.set_sensitive(False) self.configurations['time'] = True - self.update_install_button() - self.TimeCheck.show() - self.TimeCheckMarker.hide() - def on_time_undo_clicked(self, widget, data=None): - self.TimeCheck.hide() - self.TimeCheckMarker.show() - self.ManualTimeBox.set_sensitive(True) - self.NTPCheckButton.set_sensitive(True) - self.TimeZoneBox.set_sensitive(True) - self.TimeApplyButton.set_sensitive(True) self.time_settings() + def on_time_undo_clicked(self, widget, data=None): self.configurations['time'] = False - self.update_install_button() + self.time_settings() def keyboard_settings(self): - index = 0 - for km in self.KeyboardListStore: - if km[0] == self.cur_km: - self.KeyboardList.get_selection().select_path(index) - break - index += 1 + self.KeyboardSelection.set_text(_('None')) + if self.cur_km: + index = 0 + for km in self.KeyboardListStore: + if km[0] == self.cur_km: + self.KeyboardList.get_selection().select_path(index) + if self.configurations['keyboard']: + self.KeyboardSelection.set_text('{0} ({1})'.format(km[0], km[1])) + break + index += 1 self.NumLockCheckButton.set_active(self.cur_use_numlock) self.IBusCheckButton.set_active(self.cur_use_ibus) + self.KeyboardList.set_sensitive(not self.configurations['keyboard']) + self.NumLockCheckButton.set_sensitive(not self.configurations['keyboard']) + self.IBusCheckButton.set_sensitive(not self.configurations['keyboard']) + self.KeyboardUndoButton.set_sensitive(self.configurations['keyboard']) + self.KeyboardApplyButton.set_sensitive(not self.configurations['keyboard']) + if self.configurations['keyboard']: + self.KeyboardCheck.show() + self.KeyboardCheckMarker.hide() + else: + self.KeyboardCheck.hide() + self.KeyboardCheckMarker.show() + self.update_install_button() def on_keyboard_list_changed_event(self, selection, data=None): model, it = selection.get_selected() if it: @@ -625,58 +660,46 @@ def on_ibus_checkbutton_toggled(self, widget, data=None): self.cur_use_ibus = self.IBusCheckButton.get_active() def on_keyboard_apply_clicked(self, widget, data=None): if self.cur_km: - self.KeyboardList.set_sensitive(False) - self.KeyboardApplyButton.set_sensitive(False) - self.NumLockCheckButton.set_sensitive(False) - self.IBusCheckButton.set_sensitive(False) - model, it = self.KeyboardList.get_selection().get_selected() - self.KeyboardSelection.set_text('{0} ({1})'.format(model.get_value(it, 0), model.get_value(it, 1))) self.configurations['keyboard'] = True - self.update_install_button() - self.KeyboardCheck.show() - self.KeyboardCheckMarker.hide() + self.keyboard_settings() def on_keyboard_undo_clicked(self, widget, data=None): - self.KeyboardList.set_sensitive(True) - self.KeyboardApplyButton.set_sensitive(True) - self.NumLockCheckButton.set_sensitive(True) - self.IBusCheckButton.set_sensitive(True) - self.KeyboardSelection.set_text(_('None')) self.configurations['keyboard'] = False - self.update_install_button() - self.KeyboardCheck.hide() - self.KeyboardCheckMarker.show() + self.keyboard_settings() def locale_settings(self): - index = 0 - for l in self.LocaleListStore: - if l[0] + '.utf8' == self.cur_locale: - self.LocaleList.get_selection().select_path(index) - break - index += 1 + self.LocaleSelection.set_text(_('None')) + if self.cur_locale: + index = 0 + for l in self.LocaleListStore: + if l[0] + '.utf8' == self.cur_locale: + self.LocaleList.get_selection().select_path(index) + if self.configurations['locale']: + self.LocaleSelection.set_text('{0} ({1})'.format(l[0], l[1])) + break + index += 1 + self.LocaleList.set_sensitive(not self.configurations['locale']) + self.LocaleUndoButton.set_sensitive(self.configurations['locale']) + self.LocaleApplyButton.set_sensitive(not self.configurations['locale']) + if self.configurations['locale']: + self.LocaleCheck.show() + self.LocaleCheckMarker.hide() + else: + self.LocaleCheck.hide() + self.LocaleCheckMarker.show() + self.update_install_button() def on_locale_list_changed_event(self, selection, data=None): model, it = selection.get_selected() if it: - self.cur_locale = model.get_value(it, 0) + self.cur_locale = model.get_value(it, 0) + '.utf8' else: self.cur_locale = None def on_locale_apply_clicked(self, widget, data=None): if self.cur_locale: - self.LocaleList.set_sensitive(False) - self.LocaleApplyButton.set_sensitive(False) - model, it = self.LocaleList.get_selection().get_selected() - self.LocaleSelection.set_text('{0} ({1})'.format(model.get_value(it, 0), model.get_value(it, 1))) self.configurations['locale'] = True - self.update_install_button() - self.LocaleCheck.show() - self.LocaleCheckMarker.hide() + self.locale_settings() def on_locale_undo_clicked(self, widget, data=None): - self.LocaleList.set_sensitive(True) - self.LocaleApplyButton.set_sensitive(True) - self.LocaleSelection.set_text(_('None')) self.configurations['locale'] = False - self.update_install_button() - self.LocaleCheck.hide() - self.LocaleCheckMarker.show() + self.locale_settings() def partitions_settings(self): pass @@ -694,31 +717,184 @@ def on_partition_recap_undo_clicked(self, widget, data=None): pass def users_settings(self): - pass + if self.is_liveclone: + self.CloneLoginEventbox.show() + self.users_settings_liveclone() + self.CloneLoginCheckbutton.set_active(self.keep_live_logins) # raise toggled event + else: + self.CloneLoginEventbox.hide() + self.configurations['clonelogins'] = True + self.users_settings_live() + def users_settings_liveclone(self): + self.CloneLoginCheckbutton.set_sensitive(not self.keep_live_logins or not self.configurations['clonelogins']) + self.CloneLoginUndo.set_sensitive(self.keep_live_logins and self.configurations['clonelogins']) + self.CloneLoginApply.set_sensitive(self.keep_live_logins and not self.configurations['clonelogins']) + self.update_users_check() + def users_settings_live(self): + self.UsersEventbox.set_sensitive(True) + self.UserLoginEntry.set_text(self.new_login) + self.UserLoginEntry.set_sensitive(not self.configurations['user']) + self.UserPass1Entry.set_text(self.new_password) + self.UserPass1Entry.set_sensitive(not self.configurations['user']) + self.UserPass2Entry.set_text(self.new_password) + self.UserPass2Entry.set_sensitive(not self.configurations['user']) + self.UserVisibleCheckButton.set_sensitive(not self.configurations['user']) + self.UsersUndoButton.set_sensitive(self.configurations['user']) + self.UsersApplyButton.set_sensitive(not self.configurations['user']) + if self.configurations['user']: + self.NewUserLogin.set_text(self.new_login) + else: + self.NewUserLogin.set_text(_("None")) + self.RootPass1Entry.set_text(self.new_root_password) + self.RootPass1Entry.set_sensitive(not self.configurations['root']) + self.RootPass2Entry.set_text(self.new_root_password) + self.RootPass2Entry.set_sensitive(not self.configurations['root']) + self.RootVisibleCheckButton.set_sensitive(not self.configurations['root']) + self.RootPassUndoButton.set_sensitive(self.configurations['root']) + self.RootPassApplyButton.set_sensitive(not self.configurations['root']) + if self.configurations['root']: + self.RootPassCreated.set_text(_("Yes")) + else: + self.RootPassCreated.set_text(_("None")) + self.update_users_check() + def update_users_check(self): + if self.configurations['clonelogins'] and self.configurations['user'] and self.configurations['root']: + self.UsersCheck.show() + self.UsersCheckMarker.hide() + else: + self.UsersCheck.hide() + self.UsersCheckMarker.show() + self.update_install_button() + def on_clone_login_checkbutton_toggled(self, widget, data=None): + if self.CloneLoginCheckbutton.get_sensitive(): + self.keep_live_logins = self.CloneLoginCheckbutton.get_active() + self.on_clone_login_undo_clicked(None) + self.on_users_undo_clicked(None) + self.on_rootpass_undo_clicked(None) + if self.keep_live_logins: + self.configurations['user'] = True + self.configurations['root'] = True + self.UsersEventbox.set_sensitive(False) + else: + self.configurations['clonelogins'] = True + self.UsersEventbox.set_sensitive(True) def on_clone_login_apply_clicked(self, widget, data=None): - pass + self.configurations['clonelogins'] = True + self.users_settings_liveclone() def on_clone_login_undo_clicked(self, widget, data=None): - pass + self.configurations['clonelogins'] = False + self.users_settings_liveclone() + def get_password_strength(self, pwd): + """ + Returns a number from 0 to 4 indicates the strength of the password. + """ + if not pwd: + score = 0 + else: + score = 1 + if len(pwd) >= 5: + score += 1 + if re.search(r'[A-Z]', pwd): + score += 0.5 + if re.search(r'[1-9]', pwd): + score += 0.5 + if re.search(r'[-_.,;:!?"\']', pwd): + score += 0.5 + if re.search(r'[][(){}/\<>$%*#@^]', pwd): + score += 0.5 + score = int(math.floor(score)) + return score + def set_progressbar_strength(self, pwd, draw_widget): + strength = self.get_password_strength(pwd) + gc = draw_widget.window.new_gc() + bg_color = draw_widget.get_colormap().alloc_color("#FFFFFF") + border_color = draw_widget.get_colormap().alloc_color("#000000") + if strength <= 1: + progress_color = draw_widget.get_colormap().alloc_color("#FF0000") + elif strength == 2: + progress_color = draw_widget.get_colormap().alloc_color("#FF8800") + elif strength == 3: + progress_color = draw_widget.get_colormap().alloc_color("#CCCC00") + elif strength == 4: + progress_color = draw_widget.get_colormap().alloc_color("#00FF00") + gc.set_foreground(bg_color) + draw_widget.window.draw_rectangle(gc, True, 0, 0, 80, 25) + gc.set_foreground(progress_color) + draw_widget.window.draw_rectangle(gc, True, 0, 0, 20 * strength, 25) + gc.set_foreground(border_color) + draw_widget.window.draw_rectangle(gc, False, 0, 0, 80, 25) + def on_user_pass1_entry_changed(self, widget, data=None): + self.set_progressbar_strength(widget.get_text().strip(), self.UserPassStrength) + def on_user_visible_checkbutton_toggled(self, widget, data=None): + self.UserPass1Entry.set_visibility(self.UserVisibleCheckButton.get_active()) + self.UserPass2Entry.set_visibility(self.UserVisibleCheckButton.get_active()) + def check_login(self, login): + if not login: + error_dialog(_("Your login name is empty.") + "\n" + _("Please verify and correct!")) + return False + elif not re.match(r'^[a-z][-_a-z1-9]*$', login): + error_dialog(_("Your login name should only contain alphanumeric lowercase characters with no space and should start with a letter.") + "\n" + _("Please verify and correct!")) + return False + else: + return True + def check_password(self, pwd1, pwd2): + if not pwd1: + error_dialog(_("Your password entry is empty.") + "\n" + _("Please verify and correct!")) + return False + elif pwd1 != pwd2: + error_dialog(_("Your two password entries do not match.") + "\n" + _("Please verify and correct!")) + return False + else: + return True def on_users_apply_clicked(self, widget, data=None): - pass + ok = self.check_login(self.UserLoginEntry.get_text().strip()) + if ok: + ok = self.check_password(self.UserPass1Entry.get_text().strip(), self.UserPass2Entry.get_text().strip()) + if ok: + self.configurations['user'] = True + self.new_login = self.UserLoginEntry.get_text().strip() + self.new_password = self.UserPass1Entry.get_text().strip() + self.users_settings_live() def on_users_undo_clicked(self, widget, data=None): - pass + self.configurations['user'] = False + self.new_login = '' + self.new_password = '' + self.users_settings_live() + def on_root_pass1_entry_changed(self, widget, data=None): + self.set_progressbar_strength(widget.get_text().strip(), self.RootPassStrength) + def on_root_visible_checkbutton_toggled(self, widget, data=None): + self.RootPass1Entry.set_visibility(self.RootVisibleCheckButton.get_active()) + self.RootPass2Entry.set_visibility(self.RootVisibleCheckButton.get_active()) def on_rootpass_apply_clicked(self, widget, data=None): - pass + ok = self.check_password(self.RootPass1Entry.get_text().strip(), self.RootPass2Entry.get_text().strip()) + if ok: + self.configurations['root'] = True + self.new_root_password = self.RootPass1Entry.get_text().strip() + self.users_settings_live() def on_rootpass_undo_clicked(self, widget, data=None): - pass + self.configurations['root'] = False + self.new_root_password = '' + self.users_settings_live() def packages_settings(self): - if not self.install_mode: - self.CoreRadioButton.set_sensitive(not self.is_liveclone) - self.CoreHBox.set_sensitive(not self.is_liveclone) - self.BasicRadioButton.set_sensitive(not self.is_liveclone) - self.BasicHBox.set_sensitive(not self.is_liveclone) + self.CoreRadioButton.set_sensitive(not self.configurations['packages'] and not self.is_liveclone) + self.CoreHBox.set_sensitive(not self.configurations['packages'] and not self.is_liveclone) + self.CoreRadioButton.set_active(self.install_mode == 'core') + self.BasicRadioButton.set_sensitive(not self.configurations['packages'] and not self.is_liveclone) + self.BasicHBox.set_sensitive(not self.configurations['packages'] and not self.is_liveclone) + self.BasicRadioButton.set_active(self.install_mode == 'basic') + self.FullRadioButton.set_sensitive(not self.configurations['packages']) + self.FullRadioButton.set_active(self.install_mode == 'full') + self.PackagesUndoButton.set_sensitive(self.configurations['packages']) + self.PackagesApplyButton.set_sensitive(not self.configurations['packages']) + if self.configurations['packages']: + self.PackagesCheck.show() + self.PackagesCheckMarker.hide() + else: + self.PackagesCheck.hide() + self.PackagesCheckMarker.show() + self.update_install_button() def on_packages_apply_clicked(self, widget, data=None): - self.CoreRadioButton.set_sensitive(False) - self.BasicRadioButton.set_sensitive(False) - self.FullRadioButton.set_sensitive(False) - self.PackagesApplyButton.set_sensitive(False) if self.CoreRadioButton.get_active(): self.install_mode = 'core' elif self.BasicRadioButton.get_active(): @@ -726,54 +902,16 @@ def on_packages_apply_clicked(self, widget, data=None): elif self.FullRadioButton.get_active(): self.install_mode = 'full' self.configurations['packages'] = True - self.update_install_button() - self.PackagesCheck.show() - self.PackagesCheckMarker.hide() + self.packages_settings() def on_packages_undo_clicked(self, widget, data=None): self.install_mode = None - self.packages_settings() - self.FullRadioButton.set_sensitive(True) - self.PackagesApplyButton.set_sensitive(True) self.configurations['packages'] = False - self.update_install_button() - self.PackagesCheck.hide() - self.PackagesCheckMarker.show() + self.packages_settings() ################################################################### - # What to do when the liveclone login checkbutton is toggled - def on_clone_login_checkbutton_toggled(self, widget, data=None): - if self.CloneLoginCheckbutton.get_active() == True: - users_undo(self) - rootpass_undo(self) - self.UsersEventbox.set_sensitive(False) - self.CloneLoginUndo.set_sensitive(True) - self.CloneLoginApply.set_sensitive(True) - else: - self.UsersEventbox.set_sensitive(True) - self.CloneLoginUndo.set_sensitive(False) - self.CloneLoginApply.set_sensitive(False) - - # What to do when the user's password visible checkbutton is toggled - def on_user_visible_checkbutton_toggled(self, widget, data=None): - if self.UserVisibleCheckButton.get_active() == True : - self.UserPass1Entry.set_visibility(True) - self.UserPass2Entry.set_visibility(True) - if self.UserVisibleCheckButton.get_active() == False : - self.UserPass1Entry.set_visibility(False) - self.UserPass2Entry.set_visibility(False) - - # What to do when the root's password visible checkbutton is toggled - def on_root_visible_checkbutton_toggled(self, widget, data=None): - if self.RootVisibleCheckButton.get_active() == True : - self.RootPass1Entry.set_visibility(True) - self.RootPass2Entry.set_visibility(True) - if self.RootVisibleCheckButton.get_active() == False : - self.RootPass1Entry.set_visibility(False) - self.RootPass2Entry.set_visibility(False) - # What to do when the external device checkbutton is toggled def on_external_device_checkbutton_toggled (self, widget, data=None): global show_external_device @@ -850,10 +988,6 @@ def on_install_button_clicked(self, widget, data=None): def on_confirm_button_clicked(self, widget, data=None): pass - # What to do when the yes button of the YesNo Confirmation Needed dialog is 'released' - def on_confirm_button_released(self, widget, data=None): - pass - # What to do when the no button of the YesNo dialog is clicked def on_do_not_confirm_button_clicked(self, widget, data=None): pass @@ -896,7 +1030,7 @@ def error_dialog(message, parent = None): gtk.glade.textdomain(APP) if not is_test and os.getuid() != 0: - error_dialog(_("Sorry! \n\nRoot privileges are required to run this program. ")) + error_dialog(_("Sorry!\n\nRoot privileges are required to run this program.")) sys.exit(1) print 'Salix Live Installer v' + VERSION # show the gui and wait for signals