Skip to content

Commit

Permalink
Merge branch '17g-installer:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix authored Oct 31, 2023
2 parents ed02bbf + 04f9233 commit 11942b4
Show file tree
Hide file tree
Showing 113 changed files with 57,076 additions and 58,590 deletions.
998 changes: 495 additions & 503 deletions live-installer.pot

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions live-installer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def get(key, default=""):
return default
return default

def set(key, value):
main[key] = value

set_logfile(get("log_file","/var/log/17g-installer.log"))

# Distribution
Expand Down
47 changes: 36 additions & 11 deletions live-installer/frontend/gtk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def __init__(self, fullscreen=False):
"clicked", self.wizard_cb, False)
self.builder.get_object("button_back").connect(
"clicked", self.wizard_cb, True)
self.builder.get_object("button_quit").connect(
"clicked", self.quit_cb)
self.builder.get_object("button_automated").connect(
"clicked", self.automated_install_button_event)


self.builder.get_object("check_eula").connect(
Expand Down Expand Up @@ -131,6 +131,8 @@ def __init__(self, fullscreen=False):
if os.system("which ckbcomp") == 0:
if config.get("keyboard_preview", True):
self.builder.get_object("vbox_keyboard_variant").add(self.keyboardview)
self.keyboardview.show_all()


# build the language list
self.build_lang_list()
Expand Down Expand Up @@ -331,12 +333,11 @@ def enter_event(widget=None, name=""):

# make sure we're on the right page (no pun.)
self.activate_page(0)
self.builder.get_object("label_automated_warning").hide()
self.builder.get_object("button_back").set_sensitive(False)
self.slideshow()
self.window.set_position(Gtk.WindowPosition.CENTER)
self.window.show()
if not fullscreen and config.get("set_alternative_ui", False):
self.builder.get_object("button_quit").hide()
if fullscreen:
self.fullscreen()

Expand Down Expand Up @@ -419,6 +420,7 @@ def enter_event(widget=None, name=""):
self.builder.get_object("progress_%d" % self.PAGE_USER).hide()

self.ui_init = True

if self.testmode:
self.builder.get_object("label_install_progress").set_text("text "*100)

Expand Down Expand Up @@ -456,7 +458,6 @@ def update_partition_menu(pid, status):
def fullscreen(self):
self.window.set_resizable(True)
GLib.timeout_add(300, self.window.fullscreen)
self.builder.get_object("button_quit").show()

def i18n(self):

Expand Down Expand Up @@ -492,7 +493,7 @@ def i18n(self):
_("Installing"), "system-run-symbolic", _("Please wait..."))

# Buttons
self.builder.get_object("button_quit").set_label(_("Quit"))
self.builder.get_object("button_automated").set_label(_("Automated install"))
self.builder.get_object("button_back").set_label(_("Back"))
self.builder.get_object("button_next").set_label(_("Next"))

Expand Down Expand Up @@ -604,6 +605,10 @@ def i18n(self):
self.builder.get_object("label_donotturnoff").set_text(_("Please do not turn off your computer during the installation process."))
self.builder.get_object("swap_size").set_value(1)

# automated install
self.builder.get_object("label_automated_warning").set_text(_("Automated installation enabled!"))
self.builder.get_object("button_automated").set_label(_("Automated install"))

def view_password_text(self,entry, icon_pos, event):
entry.set_visibility(True)
entry.set_icon_from_icon_name(0,"view-conceal-symbolic")
Expand All @@ -613,6 +618,21 @@ def hide_password_text(self,entry, icon_pos, event):
entry.set_visibility(False)
entry.set_icon_from_icon_name(0,"view-reveal-symbolic")

def automated_install_button_event(self,widget):
config.set("automated",True)
self.setup.automated = True
self.builder.get_object("entry_username").set_text(os.uname()[1])
self.builder.get_object("entry_password").set_text("1")
self.builder.get_object("entry_confirm").set_text("1")
self.builder.get_object("entry_hostname").set_text(os.uname()[1])
self.builder.get_object("entry_name").set_text(os.uname()[1])
self.builder.get_object("swap_size").set_text("0")
self.builder.get_object("button_next").set_label(_("Install"))
self.builder.get_object("button_next").get_style_context().add_class("suggested-action")
self.builder.get_object("label_automated_warning").show()
self.show_overview()
self.activate_page(self.PAGE_OVERVIEW)

def assign_realname(self, entry):
errorFound = False
# Try to set the username (doesn't matter if it fails)
Expand Down Expand Up @@ -1023,8 +1043,6 @@ def assign_keyboard_model(self, combobox):

def assign_keyboard_layout(self, treeview):
''' Called whenever someone updates the keyboard layout '''
if not self.ui_init:
return
model, active = treeview.get_selection().get_selected_rows()
if not active:
return
Expand Down Expand Up @@ -1077,6 +1095,10 @@ def assign_keyboard_variant(self, treeview):
self.setup.keyboard_variant = '%s,us' % self.setup.keyboard_variant

def activate_page(self, nex=0, index=0, goback=False):
if nex == 0:
self.builder.get_object("button_automated").show()
else:
self.builder.get_object("button_automated").hide()
errorFound = False
if self.testmode:
self.builder.get_object("notebook1").set_visible_child_name(str(nex))
Expand Down Expand Up @@ -1211,7 +1233,6 @@ def activate_page(self, nex=0, index=0, goback=False):
elif index == self.PAGE_INSTALL:
self.builder.get_object("button_next").set_sensitive(False)
self.builder.get_object("button_back").set_sensitive(False)
self.builder.get_object("button_quit").set_sensitive(False)
self.builder.get_object("dot_box").hide()
self.window.resize(0, 0)
GLib.timeout_add(100, self.set_slide_page)
Expand Down Expand Up @@ -1408,8 +1429,12 @@ def bold(strvar):
_pass1 = self.builder.get_object("entry_password").get_text()
model.append(top, (_("Real name: ") + bold(_realname),))
model.append(top, (_("Username: ") + bold(_username),))
model.append(
top, (_("Password: ") + bold(len(str(_pass1)) * "*"),))
if config.get("automated",False):
model.append(
top, (_("Password: ") + bold(str(_pass1)),))
else:
model.append(
top, (_("Password: ") + bold(len(str(_pass1)) * "*"),))
if config.get("autologin_enabled", True):
model.append(top, (_("Automatic login: ") + bold(_("enabled")
if self.setup.autologin else _("disabled")),))
Expand Down
2 changes: 2 additions & 0 deletions live-installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ def exceptdebug(e, v, tb):
os.system("gtk-update-icon-cache /usr/share/icons/hicolor/ || true")
from frontend.gtk_interface import InstallerWindow
win = InstallerWindow("--fullscreen" in sys.argv)
if "--automated" in sys.argv:
win.automated_install_button_event(None)
Gtk.main()
25 changes: 22 additions & 3 deletions live-installer/resources/interface.ui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2 -->
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.18"/>
<object class="GtkSizeGroup">
Expand Down Expand Up @@ -1905,6 +1905,24 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label_automated_warning">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-top">13</property>
<property name="margin-bottom">13</property>
<property name="label" translatable="yes">Automated installation enabled!</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="foreground" value="#ffff00000000"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="name">8</property>
Expand Down Expand Up @@ -2199,8 +2217,9 @@
<property name="spacing">6</property>
<property name="layout-style">end</property>
<child>
<object class="GtkButton" id="button_quit">
<property name="label">Quit</property>
<object class="GtkButton" id="button_automated">
<property name="label">Automated
install</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
Expand Down
Loading

0 comments on commit 11942b4

Please sign in to comment.