Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Add set_locale #6

Merged
merged 4 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 20 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,40 @@
# Chaotic Installer

This a port Anarchy Linux to C++ using Qt with QML.
It's recommended to use with EGLFS as platform abstraction.

## What it shares with Anarchy Linux?

* This text is valid for both projects:

Anarchy Linux is an Arch Linux installer providing a hassle-free pure installation and polished user experience.
Every aspect of the install is taken into account from partitioning and general system configuration,
to installing your favorite DE/WM and additional software from the official Arch Linux repos.

The Anarchy installer is intended to provide both novice and experienced Linux users a simple and pain free way to install Arch Linux.
Install when you want it, where you want it, and how you want it.
That is the Anarchy philosophy.

Anarchy aims to provide a polished and pure Arch install while leaving open every possible configuration avenue for the user to choose from.

# What is different from Anarchy Linux?

* Chaotic Installer has a Graphical Interface (still light and fast).
* Chaotic Installer is written in C++, has qt as deps, needs compilation, doesn't give you a terminal, and because of that it's hard to say it still follows KISS philosophy.
* It doesn't includes `yay`.

# Is it related to Chaotic-AUR repository?

Nope. And if it worries you, this installer doesn't include Chaotic-AUR or it's pacakges.
But, you'll find a ready to burn ISO with Chaotic Installer available in chaotic-aur (soon), and both projects are mantained by the same Pedro.

# Why EGLFS?

So you won't need Wayland, neither X nor a WM.

# Dependencies
A setup wizard for ArchLinux using Qt and compatible with EGLFS.

# Features
* Compatible with EGLFS:
* Does not require X11 or Wayland to run.
* Lazy scriptable setup:
* At the end of the script you'll be presented to an editable bash script containing all the instructions that will be used during setup.
* The same happens for networks connections and partitioning.
* No package will be installed without your consent.

# Building
## Dependencies
```
yay -S qt5-base qt5-quickcontrols2 libinput libxkbcommon
```

# How to compile?
## How to build?
```
yay -S qt5-tools
cd chaotic-installer-qt
qmake -project chaotic-installer.pro
make
lrelease chaotic-installer.pro
```

# How to run without X/Wayland?
## How to run without X/Wayland?
Open a TTY without an open graphical session (`Ctrl+Alt+F3` should do it):

```
export QT_QPA_PLATFORM='eglfs'
./bin/chaotic-installer
```

There is also a `launcher/startchaotic` script that will be used in generated ISO.

# What it looks like?

![Language Picking Screen](screenshot.png)

# Is it related to Chaotic-AUR repository?
Both projects are mantained by the same Pedro, and you'll find a ready to burn ISO with Chaotic Installer available in Chaotic-AUR (soon).
But, this installer doesn't include Chaotic-AUR, any of it's packages, and won't offer to add it.
10 changes: 6 additions & 4 deletions chaotic-installer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ VPATH *= $${BASEDIR}/src
TRANSLATIONS = langs/en_US.ts langs/pt_BR.ts

HEADERS = chaotic-installer.hpp \
lib/language.hpp lib/locale.hpp \
lib/network.hpp lib/mirrors.hpp
lib/translations.hpp lib/keymap.hpp \
lib/network.hpp lib/mirrors.hpp \
lib/locales.hpp
SOURCES = main.cpp \
lib/language.cpp lib/locale.cpp \
lib/network.cpp lib/mirrors.cpp
lib/translations.cpp lib/keymap.cpp \
lib/network.cpp lib/mirrors.cpp \
lib/locales.cpp
TARGET = bin/chaotic-installer

lupdate_only {
Expand Down
19 changes: 19 additions & 0 deletions langs/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ If unsure leave default</source>
<translation></translation>
</message>
</context>
<context>
<name>LocalesSelect</name>
<message>
<source>Select enabled locales:</source>
<translation></translation>
</message>
<message>
<source>Select system language: </source>
<translation></translation>
</message>
<message>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<source>Next</source>
<translation></translation>
</message>
</context>
<context>
<name>MirrorsSort</name>
<message>
Expand Down
27 changes: 23 additions & 4 deletions langs/pt_BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>EthernetMenu</name>
<message>
<source>Select adapter: </source>
<translation>Selecione a interface:</translation>
<translation>Selecione a interface: </translation>
</message>
<message>
<source>Generate profile</source>
Expand Down Expand Up @@ -138,6 +138,25 @@ Caso não tenha certeza, deixe o padrão</translation>
<translation>Próximo</translation>
</message>
</context>
<context>
<name>LocalesSelect</name>
<message>
<source>Select enabled locales:</source>
<translation>Selecione as internacionalizações:</translation>
</message>
<message>
<source>Select system language: </source>
<translation>Selecione o idioma do sistema: </translation>
</message>
<message>
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Next</source>
<translation>Próximo</translation>
</message>
</context>
<context>
<name>MirrorsSort</name>
<message>
Expand Down Expand Up @@ -198,19 +217,19 @@ um script para o netctl, esse script poderá ser editado antes de conectar.</tra
<name>WifiMenu</name>
<message>
<source>Select adapter: </source>
<translation>Selecione uma interface:</translation>
<translation>Selecione uma interface: </translation>
</message>
<message>
<source>Select SSID: </source>
<translation>Selecione um SSID:</translation>
<translation>Selecione um SSID: </translation>
</message>
<message>
<source>Refresh</source>
<translation>Atualizar</translation>
</message>
<message>
<source>Password: </source>
<translation>Senha:</translation>
<translation>Senha: </translation>
</message>
<message>
<source>WPA2 personal password only</source>
Expand Down
4 changes: 2 additions & 2 deletions qml/KeyboardPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Component {
id: pickKeyboardList

Repeater {
model: allKeyboards
model: keymap.allKeyboards

RadioButton {text: modelData; onClicked: setupLocale.selectedKeyboard = modelData }
RadioButton {text: modelData; onClicked: keymap.selectedKeyboard = modelData }
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions qml/LanguagePicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Component {
anchors.bottomMargin: 20
width: parent.width

//Flickable {
ScrollView {
anchors.top: parent.top
anchors.bottom: parent.bottom
Expand All @@ -51,7 +50,7 @@ Component {
Column {
id: pickLangList

RadioButton {text: qsTr('English'); checked: true; onClicked: lang.setLang("en_US") }
RadioButton {text: qsTr('English'); checked: true; onClicked: translations.setLang("en_US") }
/*RadioButton {text: qsTr('Bulgarian')}
RadioButton {text: qsTr('Dutch')}
RadioButton {text: qsTr('French')}
Expand All @@ -64,7 +63,7 @@ Component {
RadioButton {text: qsTr('Lithuanian')}
RadioButton {text: qsTr('Polish')}
RadioButton {text: qsTr('Portuguese')}*/
RadioButton {text: qsTr('Portuguese (Brazilian)'); onClicked: lang.setLang("pt_BR") }
RadioButton {text: qsTr('Portuguese (Brazilian)'); onClicked: translations.setLang("pt_BR") }
/*RadioButton {text: qsTr('Romanian')}
RadioButton {text: qsTr('Russian')}
RadioButton {text: qsTr('Spanish')}
Expand Down
111 changes: 111 additions & 0 deletions qml/LocalesSelect.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/* Chaotic Installer Locales Selecting Screen

I like to write this by hand, do whatever you want, but keep diff clean to read, so I
can keep writing it manually.

Also, consider this file copyright-free.
*/

import QtQuick 2.9
import QtQml.Models 2.2
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12

Component {
Column {
anchors.fill: parent
anchors.leftMargin: 20
anchors.rightMargin: 20

Row {
id: localesHeader
anchors.top: parent.top
anchors.topMargin: 20
anchors.horizontalCenter: parent.horizontalCenter

Column {
spacing: 20

Row {
anchors.horizontalCenter: parent.horizontalCenter

Text {
text: qsTr('Select enabled locales:')
}
}
}
}

Row {
id: localeListView
anchors.top: localesHeader.bottom
anchors.bottom: langPicker.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottomMargin: 20
ScrollView {
anchors.fill:parent
clip: true

contentWidth: localeList.width
contentHeight: localeList.height

ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AlwaysOn;
parent: localeListView
anchors.top: parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom
}

ListView {
id: localeList
width: parent.width
model: locales.codes
delegate: CheckBox {
text: modelData
checked: false
onClicked: locales.setEnabled(index, checked)
}
}
}
}

Row {
id: langPicker
anchors.bottom: localesFooter.top
anchors.bottomMargin: 20

Column {
anchors.verticalCenter: parent.verticalCenter
Text { text: qsTr('Select system language: ') }
}
Column {
ComboBox {
model: locales.langs
onActivated: locales.setLANG(currentIndex)
}
}
}

Row {
id: localesFooter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
spacing: 80


Button {
text: qsTr('Cancel')
onClicked: contentStack.pop()
}

Button {
text: qsTr('Next')
highlighted: true
onClicked: contentStack.push(nextMenu)
}
}
}
}
1 change: 1 addition & 0 deletions qml/MainContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ Rectangle {
WifiMenu { id: wifiMenu }
EthernetMenu { id: ethMenu }
MirrorsSort { id: mirrorsSort }
LocalesSelect { id: localesSelect }
}
5 changes: 4 additions & 1 deletion qml/MirrorsSort.qml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Component {
id: mirrorsFooter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.topMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
spacing: 80

Expand All @@ -166,9 +167,11 @@ Component {

Button {
text: qsTr('Apply && Next')
highlighted: true
//[TODO] Require at least one active mirror!
onClicked: {
mirrors.apply()
contentStack.push(nextMenu)
contentStack.push(localesSelect)
}
}
}
Expand Down
15 changes: 0 additions & 15 deletions src/chaotic-installer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,4 @@
#define QML_PATH "qml/"
#define ASSETS_PATH "assets/"

void set_keys();
void update_mirrors();
void check_connection();
void set_locale();
void set_zone();
void prepare_drives();
void install_options();
void set_hostname();
void set_user();
void add_software();
void install_base();
void configure_system();
void add_user();
void reboot_system();

#endif // CHAOTIC_INSTALLER_H
Loading