diff --git a/.gitignore b/.gitignore index 74ba485..82850cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,61 +1,5 @@ -# makepkg -pkg/ -src/ -gui/ - -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# macos -.DS_Store -.fseventsd/ -.Spotlight-V100/ -.Trashes/ -ehthumbs.db -Icon -macos/ -ios/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release +/subprojects/blueprint-compiler +build/ +src/.flatpak-builder/ +src/locales/.flatpak-builder/ +flatpak-builder/ diff --git a/LICENSE b/COPYING similarity index 99% rename from LICENSE rename to COPYING index f288702..10926e8 100644 --- a/LICENSE +++ b/COPYING @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. 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, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,12 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. + diff --git a/Jade.desktop b/Jade.desktop deleted file mode 100644 index 65e5fc2..0000000 --- a/Jade.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Comment=GUI frontend for the jade crystal installer -Name=Jade GUI -Icon=/usr/share/icons/jade-logo.svg -Exec=jade_gui -Categories=System diff --git a/PKGBUILD b/PKGBUILD deleted file mode 100644 index 7f8176a..0000000 --- a/PKGBUILD +++ /dev/null @@ -1,41 +0,0 @@ -# Maintainer: Matt C -pkgname=jade_gui -pkgver=1.1.1 -pkgrel=4 -pkgdesc="Flutter GUI for installing crystal" -license=('GPL3') -arch=('any') -url="https://git.tar.black/crystal/programs/jade_gui" -depends=('gtk3' 'jade' 'openssl' 'python-websockets' 'python-pycryptodome' 'inetutils') -makedepends=('clang' 'ninja' 'cmake' 'git' 'unzip' 'flutter' 'flutter-group-pacman-hook') - -source=("gui::git+${url}.git") -sha256sums=('SKIP') - -build() { - cd ${srcdir}/gui - flutter config --enable-linux-desktop - flutter config --no-analytics - flutter clean - flutter pub get - flutter build linux --release --verbose -} - -package() { - mkdir -p ${pkgdir}/opt/jade_gui/ - install -dm755 ${pkgdir}/opt - mv ${srcdir}/gui/build/linux/x64/release/bundle ${pkgdir}/opt/jade_gui/. - - install -dm755 ${pkgdir}/usr/bin - ln -s /opt/jade_gui/bundle/jade_gui ${pkgdir}/usr/bin/jade_gui - - mkdir -p ${pkgdir}/opt/jade_gui/scripts/ - mv ${srcdir}/gui/scripts/* ${pkgdir}/opt/jade_gui/scripts/. - chmod +x ${pkgdir}/opt/jade_gui/scripts/* - - mkdir -p ${pkgdir}/usr/share/applications/ - cp ${srcdir}/gui/Jade.desktop ${pkgdir}/usr/share/applications/Jade.desktop - - mkdir -p ${pkgdir}/usr/share/icons/ - cp ${srcdir}/gui/assets/jade_logo.svg ${pkgdir}/usr/share/icons/jade-logo.svg -} diff --git a/README.md b/README.md index 2d8cc94..5a927c3 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,40 @@ -<<<<<<< Updated upstream -# Jade GUI -=======

- Logo + Logo

->>>>>>> Stashed changes -The flutter-based gui installer using jade as the backend +

Jade

-![](https://git.tar.black/crystal/programs/jade_gui/-/raw/main/assets/mainpage.png) +

+ License + GitHub isses + GitHub pull requests
+ Twitter Follow + Discord + The maintainer of this repository
+ Mastodon Follow + Twitter Follow + Please don't theme
+

+ +

The libadwaita/gtk based gui installer using jade as the backend. +

+ +

The jade gui mockups

+ + +![](main-page-screenshot.png) + + +### Building +__NOTE: the jade gui libadwaita rewrite is not complete and CAN'T install a crystal system yet__ -![](https://git.tar.black/crystal/programs/jade_gui/-/raw/main/assets/sumarypage.png) +jade gui relies on a yet unreleased version of libadwaita, that's why you have to use flatpak to build it: -![](https://git.tar.black/crystal/programs/jade_gui/-/raw/main/assets/lastpage.png) \ No newline at end of file +```sh +git clone https://github.com/crystal-linux/jade_gui +cd jade_gui +flatpak-builder --user --install --install-deps-from=flathub --force-clean build-dir al.getcryst.jadegui +flatpak run al.getcryst.jadegui +``` diff --git a/al.getcryst.jadegui.yml b/al.getcryst.jadegui.yml new file mode 100644 index 0000000..0f491cf --- /dev/null +++ b/al.getcryst.jadegui.yml @@ -0,0 +1,81 @@ +app-id: al.getcryst.jadegui +runtime: org.gnome.Platform +runtime-version: '42' +sdk: org.gnome.Sdk +command: jade_gui + +finish-args: + - --share=network + - --share=ipc + - --socket=fallback-x11 + - --device=dri + - --socket=wayland +# - --socket=session-bus + +cleanup: + - /include + - /lib/pkgconfig + - /man + - /share/doc + - /share/gtk-doc + - /share/pkgconfig + - "*.la" + - "*.a" + +modules: + - name: libadwaita + buildsystem: meson + config-opts: + - -Dexamples=false + - -Dtests=false + sources: + - type: git + url: https://gitlab.gnome.org/GNOME/libadwaita.git + commit: da4125248a434ba7caaec85186db6ab44deecad7 + modules: + - name: libsass + buildsystem: meson + sources: + - type: git + url: https://github.com/lazka/libsass.git + branch: meson + - name: sassc + buildsystem: meson + sources: + - type: git + url: https://github.com/lazka/sassc.git + branch: meson + - name: python3-pytz + buildsystem: simple + sources: + - type: archive + url: https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz + sha256: 1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7 + build-commands: + - ls + - pip3 install --prefix=/app . + # - name: vte + # buildsystem: meson + # config-opts: + # - -Ddocs = false + # - -Dvapi=false + # - -Dgtk4=true + # - -Dgtk3=false + # sources: + # - type: git + # url: https://gitlab.gnome.org/GNOME/vte.git + # commit: 3ed53bfaa7344ce5b7727a60a2d33315b15201e5 + - name: blueprint + buildsystem: meson + sources: + - type: git + url: "https://gitlab.gnome.org/jwestman/blueprint-compiler" + branch: "main" + - name: jadegui + buildsystem: meson + build-options: + build-args: + - --share=network + sources: + - type: dir + path: . diff --git a/al.getcyrst.jadegui.json b/al.getcyrst.jadegui.json new file mode 100644 index 0000000..2b10841 --- /dev/null +++ b/al.getcyrst.jadegui.json @@ -0,0 +1,38 @@ +{ + "app-id" : "al.getcryst.jadegui", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "jade_gui", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + { + "name" : "jade_gui", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "file:///var/home/user/Projects/jade_gui" + } + ] + } + ] +} diff --git a/analysis_options.yaml b/analysis_options.yaml deleted file mode 100644 index 61b6c4d..0000000 --- a/analysis_options.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index 6f56801..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index 273c807..0000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.jade_gui" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 2dd9c06..0000000 --- a/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 89d6e7e..0000000 --- a/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/android/app/src/main/kotlin/com/example/jade_gui/MainActivity.kt b/android/app/src/main/kotlin/com/example/jade_gui/MainActivity.kt deleted file mode 100644 index 48f5fa4..0000000 --- a/android/app/src/main/kotlin/com/example/jade_gui/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.jade_gui - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 7453439..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 1251bd9..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 7453439..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 1251bd9..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 7453439..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 3db14bb..0000000 --- a/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml deleted file mode 100644 index d460d1e..0000000 --- a/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 2dd9c06..0000000 --- a/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 24047dc..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index bc6a58a..0000000 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/assets/crystal-logo-minimal.png b/assets/crystal-logo-minimal.png deleted file mode 100644 index d24be04..0000000 Binary files a/assets/crystal-logo-minimal.png and /dev/null differ diff --git a/assets/default.png b/assets/default.png deleted file mode 100644 index a52af8f..0000000 Binary files a/assets/default.png and /dev/null differ diff --git a/assets/desktops/budgie.png b/assets/desktops/budgie.png deleted file mode 100644 index 1ca7e56..0000000 Binary files a/assets/desktops/budgie.png and /dev/null differ diff --git a/assets/desktops/enlightenment.png b/assets/desktops/enlightenment.png deleted file mode 100644 index 19ebfcb..0000000 Binary files a/assets/desktops/enlightenment.png and /dev/null differ diff --git a/assets/desktops/gnome.png b/assets/desktops/gnome.png deleted file mode 100644 index d4a64b0..0000000 Binary files a/assets/desktops/gnome.png and /dev/null differ diff --git a/assets/desktops/kde.png b/assets/desktops/kde.png deleted file mode 100644 index 6369bc6..0000000 Binary files a/assets/desktops/kde.png and /dev/null differ diff --git a/assets/desktops/mate.png b/assets/desktops/mate.png deleted file mode 100644 index d1f3198..0000000 Binary files a/assets/desktops/mate.png and /dev/null differ diff --git a/assets/desktops/xfce.png b/assets/desktops/xfce.png deleted file mode 100644 index ed5d59c..0000000 Binary files a/assets/desktops/xfce.png and /dev/null differ diff --git a/assets/disk.png b/assets/disk.png deleted file mode 100644 index 1d685f6..0000000 Binary files a/assets/disk.png and /dev/null differ diff --git a/assets/jade_logo.png b/assets/jade_logo.png deleted file mode 100644 index 51e31e5..0000000 Binary files a/assets/jade_logo.png and /dev/null differ diff --git a/assets/jade_logo.svg b/assets/jade_logo.svg deleted file mode 100644 index a58c98c..0000000 --- a/assets/jade_logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/lastpage.png b/assets/lastpage.png deleted file mode 100644 index d8c5edc..0000000 Binary files a/assets/lastpage.png and /dev/null differ diff --git a/assets/loadanim.gif b/assets/loadanim.gif deleted file mode 100644 index df09c7a..0000000 Binary files a/assets/loadanim.gif and /dev/null differ diff --git a/assets/locales.json b/assets/locales.json deleted file mode 100644 index 903f1c3..0000000 --- a/assets/locales.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "Europe": [ - "Amsterdam", - "Andorra", - "Astrakhan", - "Athens", - "Belfast", - "Belgrade", - "Berlin", - "Bratislava", - "Brussels", - "Bucharest", - "Budapest", - "Busingen", - "Chisinau", - "Copenhagen", - "Dublin", - "Gibraltar", - "Guernsey", - "Helsinki", - "Isle_of_Man", - "Istanbul", - "Jersey", - "Kaliningrad", - "Kiev", - "Lisbon", - "Ljubljana", - "London", - "Luxemburg", - "Madrid", - "Malta", - "Mariehamn", - "Minsk", - "Monaco", - "Moscow", - "Oslo", - "Paris", - "Podgorica", - "Prague", - "Riga", - "Rome", - "Samara", - "San_Marino", - "Sarajevo", - "Saratov", - "Simferopol", - "Skopje", - "Sofia", - "Stockholm", - "Tallinn", - "Tirane", - "Tiraspol", - "Ulyanovsk", - "Uzhgorod", - "Vaduz", - "Vatican", - "Vienna", - "Vilnius", - "Volgograd", - "Warsaw", - "Zagreb", - "Zaporozhye", - "Zurich" - ], - "Africa": [ - "Abidjan", - "Accra", - "Addis_Ababa", - "Algiers", - "Asmara", - "Asmera", - "Bamako", - "Bangui", - "Banjul", - "Bissau", - "Blantyre", - "Brazzaville", - "Bujumbura", - "Cairo", - "Casablanca", - "Ceuta", - "Conakry", - "Dakar", - "Dar_es_Salaam", - "Djibouti", - "Douala", - "El_Aaiun", - "Freetown", - "Gaborone", - "Harare", - "Johannesburg", - "Juba", - "Kampala", - "Khartoum", - "Kigali", - "Kinshasa", - "Lagos", - "Libreville", - "Lome", - "Luanda", - "Lubumbashi", - "Lusaka", - "Malabo", - "Maputo", - "Maseru", - "Mbabane", - "Mogadishu", - "Monrovia", - "Nairobi", - "Ndjamena", - "Niamey", - "Nouakchott", - "Ouagadougou", - "Porto-Novo", - "Sao_Tome", - "Timbuktu", - "Tripoli", - "Tunis", - "Windhoek" - ] -} \ No newline at end of file diff --git a/assets/mainpage.png b/assets/mainpage.png deleted file mode 100644 index a23ad55..0000000 Binary files a/assets/mainpage.png and /dev/null differ diff --git a/assets/scuffednvme.png b/assets/scuffednvme.png deleted file mode 100644 index cb95fac..0000000 Binary files a/assets/scuffednvme.png and /dev/null differ diff --git a/assets/success.png b/assets/success.png deleted file mode 100644 index a7e6b8f..0000000 Binary files a/assets/success.png and /dev/null differ diff --git a/assets/sumarypage.png b/assets/sumarypage.png deleted file mode 100644 index e0b3325..0000000 Binary files a/assets/sumarypage.png and /dev/null differ diff --git a/assets/tux_monochrome.png b/assets/tux_monochrome.png deleted file mode 100644 index 751ea1a..0000000 Binary files a/assets/tux_monochrome.png and /dev/null differ diff --git a/assets/tux_monochrome.svg b/assets/tux_monochrome.svg deleted file mode 100644 index 26ced8f..0000000 --- a/assets/tux_monochrome.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/welcome-bg-alt.png b/assets/welcome-bg-alt.png deleted file mode 100644 index 1393c46..0000000 Binary files a/assets/welcome-bg-alt.png and /dev/null differ diff --git a/assets/welcome-bg.png b/assets/welcome-bg.png deleted file mode 100644 index 8558de9..0000000 Binary files a/assets/welcome-bg.png and /dev/null differ diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..9703fd1 --- /dev/null +++ b/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +if [[ $1 == "build" ]]; then + if [[ ! -d "build" ]]; then + meson build + else + meson --reconfigure build + fi + ninja -C build +elif [[ $1 == "install" ]]; then + pushd build + sudo ninja install +elif [[ $1 == "build-install" ]]; then + if [[ ! -d "build" ]]; then + meson build + else + meson --reconfigure build + fi + ninja -C build + pushd build + sudo ninja install +else + echo "Unkown command $1" + echo "usage:" + echo "build build jade gui" + echo "install install jade gui" + echo "build-install build and install jade_gui" +fi diff --git a/data/al.getcryst.jadegui.appdata.xml.in b/data/al.getcryst.jadegui.appdata.xml.in new file mode 100644 index 0000000..7c545e7 --- /dev/null +++ b/data/al.getcryst.jadegui.appdata.xml.in @@ -0,0 +1,9 @@ + + + al.getcryst.jadegui.desktop + CC0-1.0 + GPL-3.0-only + +

No description

+
+
diff --git a/data/al.getcryst.jadegui.desktop.in b/data/al.getcryst.jadegui.desktop.in new file mode 100644 index 0000000..7b9fac1 --- /dev/null +++ b/data/al.getcryst.jadegui.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=jade_gui + +Exec=jade_gui + +Icon=al.getcryst.jadegui + +Terminal=false +Type=Application +Categories=GTK; +StartupNotify=true diff --git a/data/al.getcryst.jadegui.gschema.xml b/data/al.getcryst.jadegui.gschema.xml new file mode 100644 index 0000000..8763ef6 --- /dev/null +++ b/data/al.getcryst.jadegui.gschema.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/al.getcyrst.jadegui.appdata.xml.in b/data/al.getcyrst.jadegui.appdata.xml.in new file mode 100644 index 0000000..1fc8bc4 --- /dev/null +++ b/data/al.getcyrst.jadegui.appdata.xml.in @@ -0,0 +1,9 @@ + + + al.getcyrst.jadegui.desktop + CC0-1.0 + GPL-3.0-only + +

No description

+
+
diff --git a/data/al.getcyrst.jadegui.desktop.in b/data/al.getcyrst.jadegui.desktop.in new file mode 100644 index 0000000..d33b8a3 --- /dev/null +++ b/data/al.getcyrst.jadegui.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=jade_gui + +Exec=jade_gui + +Icon=al.getcyrst.jadegui + +Terminal=false +Type=Application +Categories=GTK; +StartupNotify=true diff --git a/data/al.getcyrst.jadegui.gschema.xml b/data/al.getcyrst.jadegui.gschema.xml new file mode 100644 index 0000000..f753157 --- /dev/null +++ b/data/al.getcyrst.jadegui.gschema.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg b/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg new file mode 100644 index 0000000..15a9aa0 --- /dev/null +++ b/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg b/data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg new file mode 100644 index 0000000..0444828 --- /dev/null +++ b/data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg b/data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg new file mode 100644 index 0000000..0444828 --- /dev/null +++ b/data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/icons/meson.build b/data/icons/meson.build new file mode 100644 index 0000000..76c72f2 --- /dev/null +++ b/data/icons/meson.build @@ -0,0 +1,13 @@ +application_id = 'al.getcryst.jadegui' + +scalable_dir = join_paths('hicolor', 'scalable', 'apps') +install_data( + join_paths(scalable_dir, ('@0@.svg').format(application_id)), + install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir) +) + +symbolic_dir = join_paths('hicolor', 'symbolic', 'apps') +install_data( + join_paths(symbolic_dir, ('@0@-symbolic.svg').format(application_id)), + install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir) +) diff --git a/data/icons/padlock2-symbolic.svg b/data/icons/padlock2-symbolic.svg new file mode 100644 index 0000000..e0724b7 --- /dev/null +++ b/data/icons/padlock2-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..41b505b --- /dev/null +++ b/data/meson.build @@ -0,0 +1,43 @@ +desktop_file = i18n.merge_file( + input: 'al.getcryst.jadegui.desktop.in', + output: 'al.getcryst.jadegui.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) + +desktop_utils = find_program('desktop-file-validate', required: false) +if desktop_utils.found() + test('Validate desktop file', desktop_utils, + args: [desktop_file] + ) +endif + +appstream_file = i18n.merge_file( + input: 'al.getcryst.jadegui.appdata.xml.in', + output: 'al.getcryst.jadegui.appdata.xml', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'appdata') +) + +appstream_util = find_program('appstream-util', required: false) +if appstream_util.found() + test('Validate appstream file', appstream_util, + args: ['validate', appstream_file] + ) +endif + +install_data('al.getcryst.jadegui.gschema.xml', + install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') +) + +compile_schemas = find_program('glib-compile-schemas', required: false) +if compile_schemas.found() + test('Validate schema file', compile_schemas, + args: ['--strict', '--dry-run', meson.current_source_dir()] + ) +endif + +subdir('icons') diff --git a/env b/env deleted file mode 100755 index b726062..0000000 Binary files a/env and /dev/null differ diff --git a/ios/.gitignore b/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 8d4492f..0000000 --- a/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 9.0 - - diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6..0000000 --- a/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bf..0000000 --- a/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 59c0625..0000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,481 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.jadeGui; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.jadeGui; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.jadeGui; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index c87d15a..0000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a1..0000000 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist deleted file mode 100644 index 04037b5..0000000 --- a/ios/Runner/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Jade Gui - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - jade_gui - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a5..0000000 --- a/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/jade_log.txt b/jade_log.txt deleted file mode 100644 index a1b8118..0000000 --- a/jade_log.txt +++ /dev/null @@ -1,3 +0,0 @@ - -Disks:widget /dev/sda -/dev/nvme0n1 diff --git a/jadeemu.sh b/jadeemu.sh deleted file mode 100755 index bd557d0..0000000 --- a/jadeemu.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/bash -echo "[LOG] doing thing" -sleep 0.1 -echo "[ERROR] failed doing thing" -sleep 1 -echo "[LOG]" -sleep 0.1 -echo "[ERROR]" -sleep 1 -echo "Installation finished! You may reboot now!" \ No newline at end of file diff --git a/lib/classes/desktop.dart b/lib/classes/desktop.dart deleted file mode 100644 index 50ba5d9..0000000 --- a/lib/classes/desktop.dart +++ /dev/null @@ -1,13 +0,0 @@ -class Desktop { - final String name; - final String displayManager; - final List packages; - final String imageurl; - - const Desktop({ - this.name = "", - this.displayManager = "", - this.packages = const [""], - this.imageurl = 'assets/jade_logo.png', - }); -} diff --git a/lib/classes/install_prefs.dart b/lib/classes/install_prefs.dart deleted file mode 100644 index 82bebe4..0000000 --- a/lib/classes/install_prefs.dart +++ /dev/null @@ -1,102 +0,0 @@ -import 'package:jade_gui/classes/desktop.dart'; -import 'package:jade_gui/classes/location.dart'; - -class InstallPrefs { - final Location locale; - final String keymap; - final String layout; - final String username; - final String password; - final bool enableSudo; - final String rootPass; - final Desktop desktop; - final String disk; - final bool isEfi; - final String bootloader; - final String bootloaderLocation; - final String hostname; - final bool ipv6; - final bool enableTimeshift; - final bool enableFlatpak; - final bool manualPartitioning; - final List partitions; - final bool enableUnakite; - final String unakiteRoot; - final String crystalRoot; - final String unakiteEfiDir; - final String unakiteBootDev; - final String kernel; - - InstallPrefs({ - this.locale = const Location(), - this.keymap = "", - this.layout = "", - this.username = "", - this.password = "", - this.enableSudo = false, - this.rootPass = "", - this.desktop = const Desktop(), - this.disk = "", - this.isEfi = false, - this.bootloader = "", - this.bootloaderLocation = "", - this.hostname = "", - this.ipv6 = false, - this.enableTimeshift = false, - this.enableFlatpak = false, - this.manualPartitioning = false, - this.partitions = const [], - this.enableUnakite = true, - this.unakiteRoot = "", - this.crystalRoot = "", - this.unakiteEfiDir = "", - this.unakiteBootDev = "", - this.kernel = "linux", - }); - - Map toJson() => { - "partition": { - "device": disk, - "mode": manualPartitioning ? "Manual" : "Auto", - "efi": isEfi, - "partitions": partitions, - }, - "bootloader": { - "type": bootloader, - "location": bootloaderLocation, - }, - "locale": { - "locale": [ - locale.locale, - ], - "keymap": keymap, - "timezone": locale.region, - }, - "networking": { - "hostname": hostname, - "ipv6": ipv6, - }, - "users": [ - { - "name": username, - "password": password, - "hasroot": enableSudo, - } - ], - "rootpass": rootPass, - "desktop": desktop.name, - "timeshift": enableTimeshift, - "flatpak": enableFlatpak, - "extra_packages": [ - "firefox", - ], - "unakite": { - "enable": enableUnakite, - "root": unakiteRoot, - "oldroot": crystalRoot, - "efidir": unakiteEfiDir, - "bootdev": unakiteBootDev, - }, - "kernel": kernel, - }; -} diff --git a/lib/classes/keymap.dart b/lib/classes/keymap.dart deleted file mode 100644 index 1146c30..0000000 --- a/lib/classes/keymap.dart +++ /dev/null @@ -1,11 +0,0 @@ -class Keymap { - String layout = ""; - List variant = []; - String backLayout = ""; - - Keymap({ - this.layout = "", - this.variant = const [""], - this.backLayout = "", - }); -} diff --git a/lib/classes/location.dart b/lib/classes/location.dart deleted file mode 100644 index da8c93c..0000000 --- a/lib/classes/location.dart +++ /dev/null @@ -1,13 +0,0 @@ -class Location { - final String region; - final String location; - final String locale; - final String image; - - const Location({ - this.region = "", - this.location = "", - this.locale = "", - this.image = "assets/default.png", - }); -} diff --git a/lib/classes/partition.dart b/lib/classes/partition.dart deleted file mode 100644 index 935dc83..0000000 --- a/lib/classes/partition.dart +++ /dev/null @@ -1,11 +0,0 @@ -class Partition { - String partition; - String mountpoint; - String filesystem; - - Partition({ - this.partition = "", - this.mountpoint = "none", - this.filesystem = "don't format", - }); -} diff --git a/lib/desktops/desktops.dart b/lib/desktops/desktops.dart deleted file mode 100644 index 9c98dcd..0000000 --- a/lib/desktops/desktops.dart +++ /dev/null @@ -1,84 +0,0 @@ -import 'package:jade_gui/classes/desktop.dart'; - -List desktops = const [ - Desktop( - name: "Onyx", - displayManager: "lightdm", - packages: [ - "onyx", - "xorg-server", - "budgie-desktop", - "gnome", - ], - imageurl: 'assets/crystal-logo-minimal.png', - ), - Desktop( - name: "Gnome", - displayManager: "gdm", - packages: [ - "gnome", - "xorg", - "gnome-extra", - "chrome-gnome-shell", - ], - imageurl: 'assets/desktops/gnome.png', - ), - Desktop( - name: "Kde", - displayManager: "sddm", - packages: [ - "plasma", - "xorg", - "kde-applications", - "sddm", - ], - imageurl: 'assets/desktops/kde.png', - ), - Desktop( - name: "Budgie", - displayManager: "lightdm", - packages: [ - "budgie-desktop", - "xorg", - "gnome", - ], - imageurl: "assets/desktops/budgie.png", - ), - Desktop( - name: "Mate", - displayManager: "lightdm", - packages: [ - "mate", - "mate-extra", - "mate-applet-dock", - "mate-applet-streamer", - "xorg", - "mate-extra", - "mate-desktop", - ], - imageurl: "assets/desktops/mate.png", - ), - Desktop( - name: "Enlightenment", - displayManager: "", - packages: [ - "enlightenment", - "terminology", - ], - imageurl: "assets/desktops/enlightenment.png", - ), - Desktop( - name: "Xfce", - displayManager: "lightdm", - packages: [ - "xfce4", - "xfce4-goodies", - ], - imageurl: "assets/desktops/xfce.png", - ), - Desktop( - name: "None/DIY", - displayManager: "", - packages: [], - ), -]; diff --git a/lib/functions/desktop.dart b/lib/functions/desktop.dart deleted file mode 100644 index 5924d62..0000000 --- a/lib/functions/desktop.dart +++ /dev/null @@ -1,176 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/desktops/desktops.dart'; - -Widget desktopTemplate(desktop, setDesktop, currDesktop) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setDesktop(desktop); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: currDesktop.name == desktop.name - ? const Color.fromARGB(100, 170, 40, 255) - : const Color.fromARGB(0, 170, 0, 255), - shadowColor: currDesktop.name == desktop.name - ? const Color.fromARGB(100, 170, 0, 255) - : const Color.fromARGB(0, 170, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: Text( - desktop.name, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); -} - -Widget desktopView(currDesktop, setDesktop, next) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'Please select a Desktop', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(width: 40), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: desktops - .map((desktop) => - desktopTemplate(desktop, setDesktop, currDesktop)) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 100), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - children: [ - const SizedBox(height: 10), - const Text( - 'Currently chosen Desktop: ', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - Text( - currDesktop.name, - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 20), - Image(image: AssetImage(currDesktop.imageurl)), - const SizedBox(height: 10), - ], - ), - ], - ), - ), - ], - ), - const SizedBox(width: 40), - ], - ), - ), - const SizedBox(height: 20), - const SizedBox(width: 60), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - next(); - }, - child: const Text( - 'Next', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); -} diff --git a/lib/functions/install.dart b/lib/functions/install.dart deleted file mode 100644 index 9a21321..0000000 --- a/lib/functions/install.dart +++ /dev/null @@ -1,158 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/classes/install_prefs.dart'; -import 'package:jade_gui/classes/desktop.dart'; -import 'package:jade_gui/classes/location.dart'; -import 'dart:convert'; -import 'dart:io'; - -test(setOutput, running, setRunning, config, writeToLog) async { - if (!running) { - const filename = "/tmp/jade.json"; - await File(filename).writeAsString(config); - writeToLog("Json config: $config"); - var process = await Process.start('pkexec', ['jade', 'config', filename]); - //var process = await Process.start('/opt/jade_gui/scripts/jadeemu.sh', []); - process.stdout.transform(utf8.decoder).forEach(setOutput); - setRunning(true); - } -} - -Widget install( - Location locale, - String keymap, - String layout, - String username, - String password, - bool enableSudo, - String rootPass, - Desktop desktop, - String disk, - bool isEfi, - String bootloader, - String hostname, - bool ipv6, - bool enableTimeshift, - bool enableFlatpak, - bool enableUnakite, - String unakiteRoot, - String unakiteBootDev, - String unakiteEfiDir, - String crystalRoot, - String kernel, - setOutput, - output, - running, - setRunning, - writeToLog, - partitions, - manual) { - List partsParsed = []; - - for (var part in partitions) { - if (part.mountpoint != "none" && part.filesystem != "none") { - if (part.mountpoint == "unakite") { - partsParsed.add("none:${part.partition}:btrfs"); - } else { - partsParsed - .add("/mnt${part.mountpoint}:${part.partition}:${part.filesystem}"); - } - } - } - - InstallPrefs prefs = InstallPrefs( - locale: locale, - keymap: keymap, - layout: layout, - username: username, - password: password, - enableSudo: enableSudo, - rootPass: rootPass, - desktop: desktop, - disk: disk.replaceAll("/dev/", ""), - manualPartitioning: manual, - partitions: partsParsed, - isEfi: isEfi, - bootloader: bootloader, - bootloaderLocation: isEfi ? "/boot/efi" : disk, - hostname: hostname, - ipv6: ipv6, - enableTimeshift: enableTimeshift, - enableFlatpak: enableFlatpak, - enableUnakite: enableUnakite, - unakiteRoot: unakiteRoot, - unakiteBootDev: unakiteBootDev, - unakiteEfiDir: unakiteEfiDir, - crystalRoot: crystalRoot, - kernel: kernel, - ); - String jsonPrefs = jsonEncode(prefs.toJson()); - //writeConfig(jsonPrefs); - test(setOutput, running, setRunning, jsonPrefs, writeToLog); - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - output - .toString() - .contains("Installation finished! You may reboot now!") - ? "Installed!" - : " Installing...", - style: const TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - ], - ), - const SizedBox( - height: 20, - ), - const SizedBox(width: 40), - Container( - width: 1000, - height: 500, - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 15, 15, 15), - ), - child: SingleChildScrollView( - reverse: true, - child: Text( - output, - style: const TextStyle( - color: Colors.white, - fontSize: 15, - fontFamily: 'Monospace', - fontWeight: FontWeight.w100, - ), - ), - ), - ), - const SizedBox(height: 20), - Text( - output.toString().contains("Installation finished! You may reboot now!") - ? "Installation finished! You may reboot now!" - : "This may take a while...", - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - Text( - output.toString().contains("Installation finished! You may reboot now!") - ? "You can now close this window and reboot your computer." - : "Please do not close this window until the installation is finished.", - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - ], - ); -} diff --git a/lib/functions/keyboard.dart b/lib/functions/keyboard.dart deleted file mode 100644 index d8faa71..0000000 --- a/lib/functions/keyboard.dart +++ /dev/null @@ -1,167 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/Keymaps/keymaps.dart'; -import 'package:jade_gui/classes/keymap.dart'; - -Keymap chosenLayout = keymaps[0]; -String chosenVariant = "none"; - -String getChosenVariant() { - return chosenVariant; -} - -String getChosenLayout() { - return chosenLayout.backLayout; -} - -Widget variantTemplate(variant, chosenLayout, nextPage, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - chosenVariant = variant; - writeToLog("Chosen variant: $chosenVariant"); - nextPage(); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: Text( - variant, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); -} - -Widget layoutTemplate(keymap, setChosenLayout, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setChosenLayout(keymap); - writeToLog("Chosen layout: ${keymap.backLayout}"); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 30, 30, 30), - shadowColor: const Color.fromARGB(100, 30, 30, 30), - padding: const EdgeInsets.all(10), - ), - child: Text( - keymap.layout, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); -} - -Widget keyboard(nextPage, showVariant, choseLayout, setChosenLayout, - chosenLayout, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'Please select a keyboard layout', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - const SizedBox(width: 40), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: keymaps - .map((keymap) => - layoutTemplate(keymap, setChosenLayout, writeToLog)) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 50), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: chosenLayout.variant - .map((map) => variantTemplate( - map, chosenLayout, nextPage, writeToLog)) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 40), - ], - ), - ), - const SizedBox(height: 20), - ], - ); -} diff --git a/lib/functions/locale.dart b/lib/functions/locale.dart deleted file mode 100644 index eb3569e..0000000 --- a/lib/functions/locale.dart +++ /dev/null @@ -1,169 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/locales/locales.dart'; -import 'package:jade_gui/classes/location.dart'; - -Local chosenLocation = locations[0]; -Location chosenRegion = locations[0].location[0]; - -String getChosenLocation() { - return chosenLocation.name; -} - -Location getSelectedLocPack() { - return chosenRegion; -} - -Widget regionTemplate(variant, chosenLayout, nextPage, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - chosenRegion = variant; - writeToLog( - "Chosen Region: ${chosenRegion.location.replaceAll("_", " ")}"); - nextPage(); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: Text( - variant.location.replaceAll("_", " "), - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); -} - -Widget locationTemplate(location, setChosenLocation, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setChosenLocation(location); - writeToLog( - "Chosen location: ${location.name.replaceAll("_", " ")}"); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 30, 30, 30), - shadowColor: const Color.fromARGB(100, 30, 30, 30), - padding: const EdgeInsets.all(10), - ), - child: Text( - location.name.replaceAll("_", " "), - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); -} - -Widget locale(nextPage, showRegion, choseLocation, setChosenLocation, - Local chosenLocation, writeToLog) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'Please select a Time zone', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - const SizedBox(width: 40), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: locations - .map((keymap) => locationTemplate( - keymap, setChosenLocation, writeToLog)) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 50), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: chosenLocation.location - .map((map) => regionTemplate( - map, chosenLocation, nextPage, writeToLog)) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 40), - ], - ), - ), - const SizedBox(height: 20), - ], - ); -} diff --git a/lib/functions/misc.dart b/lib/functions/misc.dart deleted file mode 100644 index e891a7c..0000000 --- a/lib/functions/misc.dart +++ /dev/null @@ -1,393 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:adwaita_icons/adwaita_icons.dart'; -import 'package:flutter_svg/svg.dart'; - -final _formKey = GlobalKey(); -RegExp hostnameRegex = RegExp( - r'^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$'); -Widget misc( - setIpv6, - setHostname, - setTimeshift, - ipv6, - hostname, - timeshift, - setRootUser, - enableRoot, - setRootPass, - setConfirmRootPass, - rootPass, - confirmRootPass, - enableFlatpak, - setFlatpak, - setKernel, - String selectedKernel, - next) { - bool flatpak = true; - List availableKernels = [ - "linux", - "linux-lts", - "linux-zen", - "linux-hardened", - ]; - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - //const SizedBox(height: 2), - const Text( - 'Misc Settings', - style: TextStyle( - fontSize: 60, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 90), - Form( - key: _formKey, - autovalidateMode: AutovalidateMode.always, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(width: 20), - SizedBox( - width: 600, - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 10), - TextFormField( - autovalidateMode: AutovalidateMode.always, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Hostname', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Enter your hostname', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - style: const TextStyle(color: Colors.white), - onChanged: (String? value) { - setHostname(value); - }, - validator: (String? value) { - return (value != "" && - value != null && - !hostnameRegex.hasMatch(value)) - ? 'Bad Hostname, may not contain spaces, uppercase, or special characters' - : null; - }, - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: - "Enables the root user, who has access to everything in the system", - child: CheckboxListTile( - title: const Text('Enable root user', - style: TextStyle(color: Colors.white)), - value: enableRoot, - onChanged: (bool? value) { - setRootUser(value!); - }, - secondary: Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: const Text( - '#', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - ), - ), - ), - Visibility( - child: const SizedBox(height: 10), visible: enableRoot), - Visibility( - visible: enableRoot, - child: TextFormField( - //obscureText: true, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Password for root user', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Password for the root user', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - style: const TextStyle( - color: Colors.white, - ), - obscureText: true, - - onChanged: (String? value) { - setRootPass(value); - }, - ), - ), - Visibility( - child: const SizedBox(height: 10), visible: enableRoot), - Visibility( - visible: enableRoot, - child: TextFormField( - //obscureText: true, - autovalidateMode: AutovalidateMode.always, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Repeat root password', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Repeat root password', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - style: const TextStyle( - color: Colors.white, - ), - obscureText: true, - - onChanged: (String? value) { - setConfirmRootPass(value); - }, - validator: (String? value) { - return (value != rootPass) - ? 'Password does not match' - : null; - }, - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: "Enables ipv6", - child: CheckboxListTile( - title: const Text('Enable ipv6', - style: TextStyle(color: Colors.white)), - value: ipv6, - onChanged: (bool? value) { - setIpv6(value!); - }, - secondary: Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: const Text( - 'v6', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: - "Enables timeshift to automatically make backups", - child: CheckboxListTile( - title: const Text('Enable timeshift', - style: TextStyle(color: Colors.white)), - value: timeshift, - onChanged: (bool? value) { - setTimeshift(value!); - }, - secondary: Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: - const Icon(Icons.restore, color: Colors.black), - ), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: "Installs flatpak and enables flathub", - child: CheckboxListTile( - title: const Text('Enable flatpak', - style: TextStyle(color: Colors.white)), - value: enableFlatpak, - onChanged: (bool? value) { - setFlatpak(value!); - }, - secondary: Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: const AdwaitaIcon( - AdwaitaIcons.package_x_generic, - color: Colors.black, - ), - ), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: "Installs a different kernel", - child: Row( - children: [ - const SizedBox(width: 15), - Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: - SvgPicture.asset( - 'assets/tux_monochrome.svg', - color: Colors.black, - height: 25, - width: 25, - ), - ), - const SizedBox(width: 15), - const Text('Kernel to install', - style: TextStyle(color: Colors.white, fontSize: 17)), - const Spacer(), - DropdownButton( - icon: const Icon(Icons.arrow_downward), - elevation: 16, - style: const TextStyle(color: Colors.deepPurple), - dropdownColor: const Color.fromARGB(255, 23, 23, 23), - underline: Container( - height: 2, - color: Colors.deepPurpleAccent, - ), - value: selectedKernel, - onChanged: (String? value) { - setKernel(value); - }, - items: availableKernels.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value, - style: const TextStyle(color: Colors.white)), - ); - }).toList(), - ), - ], - ), - ), - ), - const SizedBox(height: 10), - ], - ), - ), - ), - const SizedBox(width: 10), - ], - ), - ), - const SizedBox(height: 90), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - next(); - }, - child: const Text( - 'Next', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); -} diff --git a/lib/functions/partition.dart b/lib/functions/partition.dart deleted file mode 100644 index b51bf2f..0000000 --- a/lib/functions/partition.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/functions/partitioning/auto.dart'; -import 'package:jade_gui/functions/partitioning/manual.dart'; - -Widget partitioning( - disks, - setState, - setPartition, - next, - setPartitionInfo, - selectedPartition, - partitionInfo, - runningPart, - setRunningPart, - runningInfo, - setRunningInfo, - doManualPartitioning, - setManual, - runningPartMan, - runningInfoMan, - setRunningPartMan, - setRunningInfoMan, - setPartitions, - partitions, - setPartitionMountPoint, - setFilesystem, - efi) { - if (doManualPartitioning) { - setRunningInfoMan(false); - return manualPartitioning( - partitions, - setPartitions, - runningPartMan, - setRunningPartMan, - runningInfoMan, - setRunningInfoMan, - setPartitionMountPoint, - setManual, - next, - setFilesystem, - efi, - selectedPartition, - disks, - setState, - runningPart, - setRunningPart, - setPartition, - ); - } else { - setRunningInfo(false); - setRunningPart(false); - return autoPartitioning( - disks, - setState, - setPartition, - next, - setPartitionInfo, - selectedPartition, - partitionInfo, - runningPart, - setRunningPart, - runningInfo, - setRunningInfo, - setManual); - } -} diff --git a/lib/functions/partitioning/auto.dart b/lib/functions/partitioning/auto.dart deleted file mode 100644 index f55a6af..0000000 --- a/lib/functions/partitioning/auto.dart +++ /dev/null @@ -1,255 +0,0 @@ -import 'dart:async'; -import 'dart:io'; -import 'package:flutter/material.dart'; - -Future getDiskInfo( - currPartition, setState, runningInfo, setRunningInfo) async { - if (!runningInfo) { - final String partitionInfo = await Process.run( - "/opt/jade_gui/scripts/getDiskInfo.sh", ['$currPartition']) - .then((ProcessResult results) { - return results.stdout; - }); - setState(partitionInfo); - setRunningInfo(true); - } -} - -Future getDisk(setState, runningDisk, setRunningDisk) async { - if (!runningDisk) { - final String disks = await Process.run( - "/opt/jade_gui/scripts/getDisks.sh", [], - runInShell: true) - .then((ProcessResult result) { - return result.stdout; - }); - setState(disks); - setRunningDisk(true); - } -} - -Widget diskTemplate(disk, setDisk, setDiskInfo, runningInfo, setRunningInfo) { - if (disk != "") { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setDisk(disk); - getDiskInfo(disk, setDiskInfo, runningInfo, setRunningInfo); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: Text( - disk, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - ], - ); - } else { - return const SizedBox(height: 0); - } -} - -Widget autoPartitioning( - disks, - setState, - setDisk, - next, - setDiskInfo, - selectedPartition, - diskInfo, - runningPart, - setRunningPart, - runningInfo, - setRunningInfo, - setManual) { - return FutureBuilder( - future: getDisk(setState, runningPart, setRunningPart), - builder: (BuildContext context, AsyncSnapshot snapshot) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'Please select a disk to install to', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(width: 100), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: disks - .split('\n') - .map( - (disk) => diskTemplate(disk, setDisk, setDiskInfo, - runningInfo, setRunningInfo), - ) - .toList(), - ), - ), - ), - ), - const SizedBox(width: 100), - Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - children: [ - const Text( - 'Currently chosen Disk: ', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - Text( - selectedPartition, - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 5), - Text( - 'Size: $diskInfo', - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 5), - const Image(image: AssetImage('assets/disk.png')), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setManual(true); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: - const Color.fromARGB(0, 169, 0, 255), - shadowColor: - const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: const Text( - "Manual Partitioning", - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ], - ), - ), - ], - ), - const SizedBox(width: 40), - ], - ), - ), - const SizedBox(height: 20), - const SizedBox(width: 60), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - next(); - }, - child: const Text( - 'Next', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: - const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); - }, - ); -} diff --git a/lib/functions/partitioning/manual.dart b/lib/functions/partitioning/manual.dart deleted file mode 100644 index 7c56c2b..0000000 --- a/lib/functions/partitioning/manual.dart +++ /dev/null @@ -1,400 +0,0 @@ -import 'dart:async'; -import 'dart:io'; -import 'package:flutter/material.dart'; -import 'package:jade_gui/functions/partitioning/auto.dart'; - -Future launchGparted() async { - await Process.start('pkexec', ['/usr/bin/gparted']); -} - -Future launchShell() async { - await Process.start('gnome-terminal', ['--', 'bash']); -} - -Widget partitionTemplate(partition, runningInfo, setRunningInfo, mountpoints, - setPartitionMountpoint, filesystems, setFilesystem, efi) { - if (partition().partition != "") { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: Row( - children: [ - Text( - partition().partition, - style: const TextStyle( - fontWeight: FontWeight.bold, color: Colors.white), - ), - Expanded( - child: Container(), - ), - DropdownButton( - value: partition().mountpoint, - icon: const Icon(Icons.arrow_downward), - elevation: 16, - style: const TextStyle(color: Colors.deepPurple), - dropdownColor: const Color.fromARGB(255, 23, 23, 23), - underline: Container( - height: 2, - color: Colors.deepPurpleAccent, - ), - onChanged: (String? newValue) { - setPartitionMountpoint( - partition(), newValue == "" ? "none" : newValue); - }, - items: - mountpoints.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value, - style: const TextStyle(color: Colors.white)), - ); - }).toList(), - ), - const SizedBox(width: 10), - DropdownButton( - value: partition().filesystem, - icon: const Icon(Icons.arrow_downward), - elevation: 16, - style: const TextStyle(color: Colors.deepPurple), - dropdownColor: const Color.fromARGB(255, 23, 23, 23), - underline: Container( - height: 2, - color: Colors.deepPurpleAccent, - ), - onChanged: (String? newValue) { - setFilesystem( - partition(), newValue == "" ? "none" : newValue); - }, - items: - filesystems.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value, - style: const TextStyle(color: Colors.white)), - ); - }).toList(), - ), - ], - )), - const SizedBox(height: 10), - ], - ); - } else { - return const SizedBox(height: 0); - } -} - -/*mkfs.bfs mkfs.cramfs mkfs.ext3 mkfs.fat mkfs.msdos mkfs.xfs -mkfs.btrfs mkfs.ext2 mkfs.ext4 mkfs.minix mkfs.vfat */ - -Widget manualPartitioning( - partitions, - setState, - runningPart, - setRunningPart, - runningInfo, - setRunningInfo, - setPartitionMountpoint, - setManual, - next, - setFilesystem, - efi, - disk, - disks, - setDisks, - runningDisk, - setRunningDisk, - setPartition) { - var mountpoints = [ - "none", - "/", - "/boot", - "/boot/efi", - "/home", - "/opt", - "/tmp", - "/usr", - "/var", - "unakite" - ]; - var filesystems = [ - "don't format", - "bfs", - "cramfs", - "ext3", - "fat", - "msdos", - "xfs", - "btrfs", - "ext2", - "ext4", - "minix", - "vfat" - ]; - getDisk(setDisks, runningDisk, setRunningDisk); - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - 'Please select a disk to install to', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(width: 100), - Expanded( - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: SingleChildScrollView( - primary: false, - child: Column( - children: [ - Column( - children: partitions - .map( - (partition) => partitionTemplate(() { - return partition; - }, - runningInfo, - setRunningInfo, - mountpoints, - setPartitionMountpoint, - filesystems, - setFilesystem, - efi), - ) - .toList(), - ), - ], - ), - ), - ), - ), - const SizedBox(width: 100), - Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - padding: const EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - children: [ - const Text( - 'Select partitions', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - Visibility( - visible: !efi, - child: const Text( - 'Bootloader Device:', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - ), - const SizedBox(height: 6), - Visibility( - visible: !efi, - child: Container( - padding: const EdgeInsets.fromLTRB(5, 2, 2, 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: DropdownButton( - value: disk, - icon: const Icon(Icons.arrow_downward), - elevation: 16, - style: const TextStyle(color: Colors.deepPurple), - dropdownColor: - const Color.fromARGB(255, 23, 23, 23), - underline: Container( - height: 2, - color: Colors.deepPurpleAccent, - ), - onChanged: (String? newValue) { - setPartition(newValue!); - }, - items: disks - .split('\n') - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value, - style: - const TextStyle(color: Colors.white)), - ); - }).toList(), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - launchShell(); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: - const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: const Text( - "Launch terminal", - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - launchGparted(); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: - const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: const Text( - "Launch gParted", - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(255, 30, 30, 30), - ), - child: ElevatedButton( - onPressed: () { - setManual(false); - }, - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: - const Color.fromARGB(0, 169, 0, 255), - shadowColor: const Color.fromARGB(0, 169, 0, 255), - padding: const EdgeInsets.all(10), - ), - child: const Text( - "Auto Partitioning", - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - ), - ], - ), - ), - ], - ), - const SizedBox(width: 40), - ], - ), - ), - const SizedBox(height: 20), - const SizedBox(width: 60), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - next(); - }, - child: const Text( - 'Next', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); -} diff --git a/lib/functions/summary.dart b/lib/functions/summary.dart deleted file mode 100644 index 3586c5e..0000000 --- a/lib/functions/summary.dart +++ /dev/null @@ -1,340 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/classes/desktop.dart'; -import 'package:jade_gui/classes/location.dart'; -import 'dart:io'; - -Widget infoTextTemplate(infoSection, infoText) { - return Text( - '$infoSection: $infoText', - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ); -} - -Future getDiskType(setState, disk, running, setRunning) async { - if (!running) { - final String partitions = - await Process.run("/opt/jade_gui/scripts/getDiskType.sh", [disk]) - .then((ProcessResult result) { - return result.stdout; - }); - setState(partitions); - setRunning(); - } -} - -String diskType(String disk, String diskType) { - if (disk.contains("sd") && diskType.contains("0")) { - return 'SSD'; - } else if (disk.contains("sd") && diskType.contains("1")) { - return 'HDD'; - } else if (disk.contains("nvme") && diskType.contains("0")) { - return 'NVME SSD'; - } else if (disk.contains("nvme") && diskType.contains("1")) { - return 'NVME HDD'; - } else if (disk.contains("vd")) { - return 'Virtual Disk'; - } else { - return 'Unknown, report at https://git.tar.black/crystal/jade-gui'; - } -} - -Widget summary( - Location locale, - String keymap, - String layout, - String username, - bool enableSudo, - bool enableRoot, - Desktop desktop, - String disk, - bool isEfi, - String bootloader, - String hostname, - bool ipv6, - bool enableTimeshift, - bool enableFlatpak, - String rotational, - String diskSize, - setDiskType, - nextPage, - running, - setRunning, - partitions, -) { - getDiskType(setDiskType, disk, running, setRunning); - return Column( - children: [ - const Text( - 'Installation Summary', - style: TextStyle( - fontSize: 50, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - Expanded( - child: GridView.count( - crossAxisCount: 3, - padding: const EdgeInsets.all(20), - shrinkWrap: true, - crossAxisSpacing: 10, - mainAxisSpacing: 10, - //mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - //const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "Location:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - infoTextTemplate("Region", locale.region), - const SizedBox(height: 10), - infoTextTemplate("Location", locale.location), - const SizedBox(height: 10), - infoTextTemplate("locale", locale.locale), - ], - ), - ), - //const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "Keyboard:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - infoTextTemplate("Keymap", keymap), - const SizedBox(height: 10), - infoTextTemplate("Layout", layout), - ], - ), - ), - //const SizedBox(height: 0), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "User:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - infoTextTemplate("Username", username), - const SizedBox(height: 10), - infoTextTemplate("Enable sudo", enableSudo.toString()), - const SizedBox(height: 10), - infoTextTemplate("Enable root", enableRoot.toString()), - ], - ), - ), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "Desktop:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - Text( - desktop.name, - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - ], - ), - ), - //const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "Disk:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - infoTextTemplate("Disk", disk), - const SizedBox(height: 10), - infoTextTemplate("Disk Size", diskSize), - const SizedBox(height: 10), - infoTextTemplate("Disk Type", diskType(disk, rotational)), - const SizedBox(height: 10), - infoTextTemplate("Boot Type", isEfi ? "UEFI" : "Legacy") - ], - ), - ), - //const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text( - "Misc:", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 10), - infoTextTemplate("Hostname", hostname), - const SizedBox(height: 10), - infoTextTemplate("Enable IPv6", ipv6.toString()), - const SizedBox(height: 10), - infoTextTemplate( - "Enable timeshift", enableTimeshift.toString()), - const SizedBox(height: 10), - infoTextTemplate( - "Install flatpak,", enableFlatpak.toString()), - ], - ), - ), - ], - ), - ), - const SizedBox(width: 60), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - nextPage(); - }, - child: const Text( - 'Install', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); -} diff --git a/lib/functions/users.dart b/lib/functions/users.dart deleted file mode 100644 index 669888d..0000000 --- a/lib/functions/users.dart +++ /dev/null @@ -1,225 +0,0 @@ -import 'package:flutter/material.dart'; - -final _formKey = GlobalKey(); -RegExp userRegex = RegExp(r'^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$'); -Widget users(setState, enableSudo, setPass, setConfirmPass, clearPass, - confirmPassword, setUsername, username, next) { - return Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const SizedBox(height: 40), - const Text( - 'Create a new user', - style: TextStyle( - fontSize: 60, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255)), - ), - const SizedBox(height: 20), - Container( - height: 125, - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey, - boxShadow: [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: const Icon( - Icons.person, - size: 125, - ), - ), - const SizedBox(width: 10), - Form( - key: _formKey, - autovalidateMode: AutovalidateMode.always, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(width: 20), - SizedBox( - width: 600, - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 10), - TextFormField( - autovalidateMode: AutovalidateMode.always, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Username', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Enter your username', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - style: const TextStyle(color: Colors.white), - onChanged: (String? value) { - setUsername(value); - }, - validator: (String? value) { - return (value != "" && - value != null && - !userRegex.hasMatch(value)) - ? 'Bad username, may not contain spaces, uppercase, or special characters' - : null; - }, - ), - const SizedBox(height: 10), - TextFormField( - //obscureText: true, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Password', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Enter your password', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - obscureText: true, - style: const TextStyle( - color: Colors.white, - ), - onChanged: (String? value) { - setPass(value); - }, - ), - const SizedBox(height: 10), - TextFormField( - //obscureText: true, - autovalidateMode: AutovalidateMode.always, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Repeat password', - labelStyle: TextStyle(color: Colors.white), - hintText: 'Repeat your password', - hintStyle: TextStyle(color: Colors.white), - iconColor: Colors.white, - focusColor: Color.fromARGB(100, 169, 0, 255), - hoverColor: Colors.blue, - prefixIconColor: Colors.white, - suffixIconColor: Colors.white, - ), - obscureText: true, - - style: const TextStyle( - color: Colors.white, - ), - onChanged: (String? value) { - setConfirmPass(value); - }, - validator: (String? value) { - return (value != clearPass) - ? 'Password does not match' - : null; - }, - ), - const SizedBox(height: 10), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - border: Border.all(color: Colors.black45), - color: const Color.fromARGB(100, 30, 30, 30), - ), - child: Tooltip( - message: - 'Allows the user to gain root access using sudo', - child: CheckboxListTile( - title: const Text('Enable sudo for user', - style: TextStyle(color: Colors.white)), - value: enableSudo, - onChanged: (bool? value) { - setState(value!); - }, - secondary: Container( - decoration: const BoxDecoration( - shape: BoxShape.circle, - color: Colors.white, - ), - padding: const EdgeInsets.fromLTRB(10, 10, 10, 13), - child: const Text( - '#', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - ), - ), - ), - ), - const SizedBox(height: 10), - //const SizedBox(height: 10), - ], - ), - ), - ), - const SizedBox(width: 10), - ], - ), - ), - const SizedBox(width: 60), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - children: [ - TextButton( - onPressed: () { - next(); - }, - child: const Text( - 'Next', - ), - style: TextButton.styleFrom( - primary: Colors.white, - backgroundColor: const Color.fromARGB(255, 169, 0, 255), - minimumSize: const Size(100, 50), - padding: const EdgeInsets.all(10), - ), - ), - const SizedBox(height: 10), - ], - ), - const SizedBox(width: 30), - ], - ), - const SizedBox(height: 7) - ], - ), - ], - ); -} diff --git a/lib/functions/welcome.dart b/lib/functions/welcome.dart deleted file mode 100644 index 67efad8..0000000 --- a/lib/functions/welcome.dart +++ /dev/null @@ -1,184 +0,0 @@ -import 'package:flutter/material.dart'; -import 'dart:io'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:open_url/open_url.dart'; -import 'dart:math'; - -String getKey(int length, String key, setState) { - if (key == "" || key.length < length) { - const ch = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890'; - Random r = Random(); - String key = String.fromCharCodes( - Iterable.generate(length, (_) => ch.codeUnitAt(r.nextInt(ch.length)))); - setState(key); - print(key); - return key; - } - print(key); - return key; -} - -Widget welcome( - next, - connected, - localIp, - key, - setState, -) { - List ipSplit = localIp.split('.'); - String name = "crystal" + ipSplit.last; - return Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox(height: 50), - const Text( - 'Welcome to Crystal Linux', - style: TextStyle( - fontSize: 30, - fontWeight: FontWeight.bold, - color: Color.fromARGB(255, 169, 0, 255), - ), - ), - const SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ElevatedButton( - style: TextButton.styleFrom( - primary: const Color.fromARGB(0, 23, 23, 23), - backgroundColor: const Color.fromARGB(0, 23, 23, 23), - elevation: 0, - padding: EdgeInsets.zero, - ), - onPressed: () { - exit(0); - }, - child: Container( - width: 500, - height: 500, - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: const [ - SizedBox(height: 20), - Text("Try Crystal Linux without installing", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.white)), - SizedBox(height: 5), - Image( - image: AssetImage( - 'assets/crystal-logo-minimal.png', - ), - height: 400, - fit: BoxFit.scaleDown, - ), - ], - ), - ), - ), - const SizedBox(width: 20), - ElevatedButton( - style: TextButton.styleFrom( - primary: const Color.fromARGB(0, 23, 23, 23), - backgroundColor: const Color.fromARGB(0, 23, 23, 23), - elevation: 0, - padding: EdgeInsets.zero, - ), - onPressed: connected ? next : null, - child: Container( - width: 500, - height: 500, - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border.all(color: Colors.black), - color: const Color.fromARGB(255, 30, 30, 30), - boxShadow: const [ - BoxShadow( - color: Colors.black, - blurRadius: 2, - offset: Offset(-2, 3), - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - const SizedBox(height: 20), - const Text("Start the installation", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.white)), - const SizedBox(height: 5), - const Image( - image: AssetImage( - 'assets/jade_logo.png', - ), - height: 400, - fit: BoxFit.scaleDown, - ), - Visibility( - visible: !connected, - child: const Text( - "You are not connected to the internet!", - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.bold, - color: Colors.red), - ), - ), - ], - ), - ), - ), - ], - ), - const SizedBox(height: 20), - const Text( - "Starting Crystal linux without installing will not change anything on your computer,", - style: TextStyle(fontSize: 20, color: Colors.white)), - const Text( - "it's recommended to try that first to see if everything works", - style: TextStyle(fontSize: 20, color: Colors.white)), - const SizedBox(height: 20), - Tooltip( - message: "The qr code to scan for jade_batch, click to find out more.", - child: ElevatedButton( - onPressed: () { - openUrl("https://wiki.getcryst.al/index.php/Jade_batch"); - }, - style: TextButton.styleFrom( - primary: const Color.fromARGB(0, 23, 23, 23), - backgroundColor: const Color.fromARGB(0, 23, 23, 23), - elevation: 0, - padding: EdgeInsets.zero, - ), - child: QrImage( - data: "{\"ip\":\"$localIp\",\"name\":\"$name\",\"key\":\"" + - getKey(32, key, setState) + - "\"}", - embeddedImage: const AssetImage("assets/jade_logo.png"), - foregroundColor: Colors.white, - size: 150.150, - ), - ), - ), - ], - ); -} diff --git a/lib/locales/africa.dart b/lib/locales/africa.dart deleted file mode 100644 index 4f352c7..0000000 --- a/lib/locales/africa.dart +++ /dev/null @@ -1,269 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List africa = const [ - Location( - region: "Africa", - location: "Abidjan", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Accra", - locale: "en_GH.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Addis_Ababa", - locale: "en_ET.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Algiers", - locale: "ar_DZ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Asmara", - locale: "en_ER.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Bamako", - locale: "fr_ML.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Bangui", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Banjul", - locale: "en_GM.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Bissau", - locale: "pt_GW.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Blantyre", - locale: "en_MW.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Brazzaville", - locale: "fr_CD.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Bujumbura", - locale: "fr_BI.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Cairo", - locale: "ar_EG.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Casablanca", - locale: "ar_MA.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Ceuta", - locale: "es_ES.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Conakry", - locale: "fr_GN.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Dakar", - locale: "fr_SN.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Dar_es_Salaam", - locale: "en_TZ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Djibouti", - locale: "fr_DJ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Douala", - locale: "fr_CM.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "El_Aaiun", - locale: "ar_EH.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Freetown", - locale: "en_SL.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Gaborone", - locale: "en_BW.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Harare", - locale: "en_ZW.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Johannesburg", - locale: "en_ZA.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Juba", - locale: "en_SS.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Kampala", - locale: "en_UG.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Khartoum", - locale: "", - ), - Location( - region: "Africa", - location: "Kigali", - locale: "en_RW.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Kinshasa", - locale: "fr_CD.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Lagos", - locale: "en_NG.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Libreville", - locale: "fr_GA.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Lome", - locale: "fr_TG.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Luanda", - locale: "pt_AO.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Lubumbashi", - locale: "fr_CD.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Lusaka", - locale: "en_ZM.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Malabo", - locale: "fr_GQ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Maputo", - locale: "en_MZ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Maseru", - locale: "en_LS.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Mbabane", - locale: "en_SZ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Mogadishu", - locale: "en_SO.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Monrovia", - locale: "en_LR.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Nairobi", - locale: "en_KE.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Ndjamena", - locale: "fr_TD.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Niamey", - locale: "fr_NE.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Nouakchott", - locale: "ar_MR.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Ouagadougou", - locale: "fr_BF.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Porto-Novo", - locale: "fr_BJ.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Sao_Tome", - locale: "pt_ST.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Timbuktu", - locale: "fr_ML.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Tripoli", - locale: "ar_LY.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Tunis", - locale: "fr_TN.UTF-8 UTF-8", - ), - Location( - region: "Africa", - location: "Windhoek", - locale: "en_NA.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/america.dart b/lib/locales/america.dart deleted file mode 100644 index 342244c..0000000 --- a/lib/locales/america.dart +++ /dev/null @@ -1,724 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List america = const [ - Location( - region: "America", - location: "Adak", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Anchorage", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Antigua", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Araguaina", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Argentina", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Aruba", - locale: "nl_NL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Asuncion", - locale: "es_PY.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Atikokan", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Atka", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Bahia", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Bahia_Banderas", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Barbados", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Belem", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Belize", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Blanc-Sablon", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Boa_Vista", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Bogota", - locale: "es_CO.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Boise", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Buenos_Aires", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cambridge_Bay", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Campo_Grande", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cancun", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Caracas", - locale: "es_VE.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Catamarca", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cayenne", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cayman", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Chicago", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Chihuahua", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Coral_Harbour", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cordoba", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Costa_Rica", - locale: "es_ES.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Creston", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Cuiaba", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Curacao", - locale: "nl_NL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Danmarkshavn", - locale: "da_DK.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Dawson", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Dawson_Creek", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Denver", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Detroit", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Dominica", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Edmonton", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Eirunepe", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "El_Salvador", - locale: "es_SV.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Ensenada", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Fort_Nelson", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Fort_Wayne", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Fortaleza", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Glace_Bay", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Godthab", - locale: "da_DK.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Goose_Bay", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Grand_Turk", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Grenada", - locale: "en_GD.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Guadeloupe", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Guatemala", - locale: "es_GT.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Guayaquil", - locale: "es_EC.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Guyana", - locale: "en_GY.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Halifax", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Havana", - locale: "es_CU.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Hermosillo", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Indiana", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Indianapolis", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Inuvik", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Iqaluit", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Jamaica", - locale: "en_JM.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Jujuy", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Juneau", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Kentucky", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Knox_IN", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Kralendijk", - locale: "nl_NL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "La_Paz", - locale: "es_BO.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Lima", - locale: "es_PE.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Los_Angeles", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Louisville", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Lower_Princes", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Maceio", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Managua", - locale: "es_NI.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Manaus", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Marigot", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Martinique", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Matamoros", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Mazatlan", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Mendoza", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Menominee", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Merida", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Metlakatla", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Mexico_City", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Miquelon", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Moncton", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Monterrey", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Montevideo", - locale: "es_UY.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Montreal", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Montserrat", - locale: "en_MS.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Nassau", - locale: "en_BS.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "New_York", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Nipigon", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Nome", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Noronha", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "North_Dakota", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Nuuk", - locale: "en_GL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Ojinaga", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Panama", - locale: "es_PA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Pangnirtung", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Paramaribo", - locale: "nl_SR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Phoenix", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Port-au-Prince", - locale: "fr_HT.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Porto_Acre", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Port_of_Spain", - locale: "en_TT.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Porto_Velho", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Puerto_Rico", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Punta_Arenas", - locale: "es_CL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Rainy_River", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Rankin_Inlet", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Recife", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Regina", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Resolute", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Rio_Branco", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Rosario", - locale: "es_AR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Santa_Isabel", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Santarem", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Santiago", - locale: "es_CL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Santo_Domingo", - locale: "es_DO.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Sao_Paulo", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Scoresbysund", - locale: "da_DK.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Shiprock", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Sitka", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Barthelemy", - locale: "fr_BL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Johns", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Kitts", - locale: "en_KN.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Lucia", - locale: "en_LC.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Thomas", - locale: "en_VI.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "St_Vincent", - locale: "en_VC.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Swift_Current", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Tegucigalpa", - locale: "es_HN.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Thule", - locale: "en_GL.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Thunder_Bay", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Tijuana", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Toronto", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Tortola", - locale: "en_VG.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Vancouver", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Virgin", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Whitehorse", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Winnipeg", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Yakutat", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "America", - location: "Yellowknife", - locale: "en_CA.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/antarctica.dart b/lib/locales/antarctica.dart deleted file mode 100644 index 288272c..0000000 --- a/lib/locales/antarctica.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List antarctica = const [ - Location( - region: "Antarctica", - location: "Casey", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Davis", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "DumontDurville", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Macquarie", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Mawson", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "McMurdo", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Palmer", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Rothera", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "South Pole", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Syowa", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Troll", - locale: "en_AQ.UTF-8 UTF-8", - ), - Location( - region: "Antarctica", - location: "Vostok", - locale: "en_AQ.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/arctic.dart b/lib/locales/arctic.dart deleted file mode 100644 index f088f28..0000000 --- a/lib/locales/arctic.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List arctic = const [ - Location( - region: "Arctic", - location: "Longyearbyen", - locale: "no_NO.UTF-8 UTF-8", - ) -]; diff --git a/lib/locales/asia.dart b/lib/locales/asia.dart deleted file mode 100644 index 9117368..0000000 --- a/lib/locales/asia.dart +++ /dev/null @@ -1,494 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List asia = const [ - Location( - region: "Asia", - location: "Aden", - locale: "ar_SA.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Almaty", - locale: "kk_KZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Amman", - locale: "ar_JO.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Anadyr", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Aqtau", - locale: "kk_KZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Aqtobe", - locale: "kk_KZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ashgabat", - locale: "tk_TM.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ashkhabad", - locale: "tk_TM.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Atyrau", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Baghdad", - locale: "ar_IQ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Bahrain", - locale: "ar_BH.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Baku", - locale: "az_AZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Bangkok", - locale: "th_TH.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Barnaul", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Beirut", - locale: "ar_LB.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Bishkek", - locale: "ky_KG.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Brunei", - locale: "ms_BN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Chita", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Choibalsan", - locale: "mn_MN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Chongqing", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Chungking", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Colombo", - locale: "si_LK.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Dacca", - locale: "bn_BD.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Damascus", - locale: "ar_SY.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Dhaka", - locale: "bn_BD.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Dili", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Dubai", - locale: "ar_AE.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Dushanbe", - locale: "tg_TJ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Famagusta", - locale: "tr_TR.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Gaza", - locale: "ar_PS.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Harbin", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Hebron", - locale: "ar_PS.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ho_Chi_Minh", - locale: "vi_VN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Hong_Kong", - locale: "zh_HK.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Hovd", - locale: "mn_MN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Irkutsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Istanbul", - locale: "tr_TR.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Jakarta", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Jayapura", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Jerusalem", - locale: "he_IL.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kabul", - locale: "fa_AF.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kamchatka", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Karachi", - locale: "ur_PK.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kashgar", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kathmandu", - locale: "ne_NP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Katmandu", - locale: "ne_NP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Khandyga", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kolkata", - locale: "hi_IN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Krasnoyarsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kuala_Lumpur", - locale: "ms_MY.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kuching", - locale: "ms_MY.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Kuwait", - locale: "ar_KW.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Macao", - locale: "zh_MO.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Macau", - locale: "zh_MO.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Magadan", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Makassar", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Manila", - locale: "tl_PH.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Muscat", - locale: "ar_OM.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Nicosia", - locale: "el_CY.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Novokuznetsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Novosibirsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Omsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Oral", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Phnom_Penh", - locale: "kh_KH.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Pontianak", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Pyongyang", - locale: "ko_KP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Qatar", - locale: "ar_QA.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Qostanay", - locale: "kk_KZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Qyzylorda", - locale: "kk_KZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Rangoon", - locale: "my_MM.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Riyadh", - locale: "ar_SA.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Saigon", - locale: "vi_VN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Sakhalin", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Samarkand", - locale: "uz_UZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Seoul", - locale: "ko_KR.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Shanghai", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Singapore", - locale: "en_SG.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Srednekolymsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Taipei", - locale: "zh_TW.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tashkent", - locale: "uz_UZ.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tbilisi", - locale: "ka_GE.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tehran", - locale: "fa_IR.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tel_Aviv", - locale: "he_IL.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Thimbu", - locale: "ne_NP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Thimphu", - locale: "ne_NP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tokyo", - locale: "ja_JP.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Tomsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ujung_Pandang", - locale: "id_ID.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ulaanbaatar", - locale: "mn_MN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ulan_Bator", - locale: "mn_MN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Urumqi", - locale: "zh_CN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Ust-Nera", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Vientiane", - locale: "vi_VN.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Vladivostok", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Yakutsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Yangon", - locale: "my_MM.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Yekaterinburg", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Asia", - location: "Yerevan", - locale: "hy_AM.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/atlantic.dart b/lib/locales/atlantic.dart deleted file mode 100644 index 373f54e..0000000 --- a/lib/locales/atlantic.dart +++ /dev/null @@ -1,64 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List atlantic = const [ - Location( - region: "atlantic", - location: "Azores", - locale: "pt_PT.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Bermuda", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Canary", - locale: "es_ES.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Cape_Verde", - locale: "pt_PT.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Faeroe", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Faroe", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Jan_Mayen", - locale: "nb_NO.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Madeira", - locale: "pt_PT.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Reykjavik", - locale: "is_IS.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "South_Georgia", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "Stanley", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "atlantic", - location: "St_Helena", - locale: "en_GB.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/australia.dart b/lib/locales/australia.dart deleted file mode 100644 index f1e53b4..0000000 --- a/lib/locales/australia.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List australia = const [ - Location( - region: "Australia", - location: "Adelaide", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Brisbane", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Broken_Hill", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Canberra", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Currie", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Darwin", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Eucla", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Hobart", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Lindeman", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Lord_Howe", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Melbourne", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Perth", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Queensland", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Sydney", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Tasmania", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Victoria", - locale: "en_AU.UTF-8 UTF-8", - ), - Location( - region: "Australia", - location: "Yancowinna", - locale: "en_AU.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/brazil.dart b/lib/locales/brazil.dart deleted file mode 100644 index 0c834e0..0000000 --- a/lib/locales/brazil.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List brazil = const [ - Location( - region: "Brazil", - location: "Acre", - locale: "pt_BR.UTF-8 UTF-8", - ), - Location( - region: "Brazil", - location: "DeNoronha", - locale: "pt_BR.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/canada.dart b/lib/locales/canada.dart deleted file mode 100644 index 73a206d..0000000 --- a/lib/locales/canada.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List canada = const [ - Location( - region: "canada", - location: "Atlantic", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Central", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Eastern", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Mountain", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Newfoundland", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Pacific", - locale: "en_CA.UTF-8 UTF-8", - ), - Location( - region: "canada", - location: "Yukon", - locale: "en_CA.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/chile.dart b/lib/locales/chile.dart deleted file mode 100644 index fd5fe3c..0000000 --- a/lib/locales/chile.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List chile = const [ - Location( - region: "Chile", - location: "Continental", - locale: "es_CL.UTF-8 UTF-8", - ), - Location( - region: "Chile", - location: "EasterIsland", - locale: "es_CL.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/europe.dart b/lib/locales/europe.dart deleted file mode 100644 index d7ed0b6..0000000 --- a/lib/locales/europe.dart +++ /dev/null @@ -1,314 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List europe = const [ - Location( - region: "Europe", - location: "Amsterdam", - locale: "nl_NL.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Andorra", - locale: "ca_ES.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Athens", - locale: "el_GR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Belfast", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Belgrade", - locale: "sr_RS.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Berlin", - locale: "de_DE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Bratislava", - locale: "sk_SK.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Brussels", - locale: "nl_BE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Bucharest", - locale: "ro_RO.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Budapest", - locale: "hu_HU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Busingen", - locale: "de_DE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Chisinau", - locale: "ro_RO.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Copenhagen", - locale: "da_DK.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Dublin", - locale: "en_IE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Gibraltar", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Guernsey", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Helsinki", - locale: "fi_FI.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Isle_of_Man", - locale: "en_IM.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Istanbul", - locale: "tr_TR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Jersey", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Kaliningrad", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Kiev", - locale: "uk_UA.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Kirov", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Lisbon", - locale: "pt_PT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Ljubljana", - locale: "sl_SI.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "London", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Luxembourg", - locale: "fr_LU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Madrid", - locale: "es_ES.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Malta", - locale: "en_GB.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Mariehamn", - locale: "sv_SE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Minsk", - locale: "be_BY.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Monaco", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Moscow", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Nicosia", - locale: "el_GR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Oslo", - locale: "no_NO.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Paris", - locale: "fr_FR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Podgorica", - locale: "sr_RS.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Prague", - locale: "cs_CZ.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Riga", - locale: "lv_LV.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Rome", - locale: "it_IT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Samara", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "San_Marino", - locale: "it_IT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Sarajevo", - locale: "bs_BA.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Saratov", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Simferopol", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Skopje", - locale: "mk_MK.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Sofia", - locale: "bg_BG.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Stockholm", - locale: "sv_SE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Tallinn", - locale: "et_EE.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Tirane", - locale: "sq_AL.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Tiraspol", - locale: "ro_RO.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Ulyanovsk", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Uzhgorod", - locale: "uk_UA.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Vaduz", - locale: "de_AT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Vatican", - locale: "it_IT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Vienna", - locale: "de_AT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Vilnius", - locale: "lt_LT.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Volgograd", - locale: "ru_RU.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Warsaw", - locale: "pl_PL.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Zagreb", - locale: "hr_HR.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Zaporozhye", - locale: "uk_UA.UTF-8 UTF-8", - ), - Location( - region: "Europe", - location: "Zurich", - locale: "de_CH.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/indian.dart b/lib/locales/indian.dart deleted file mode 100644 index 1a9afbe..0000000 --- a/lib/locales/indian.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List indian = const [ - Location( - region: "Indian", - location: "Antananarivo", - locale: "fr_MG.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Chagos", - locale: "en_IO.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Christmas", - locale: "en_CX.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Cocos", - locale: "en_CC.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Comoro", - locale: "fr_KM.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Kerguelen", - locale: "fr_TF.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Mahe", - locale: "en_SC.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Maldives", - locale: "en_MV.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Mauritius", - locale: "en_MU.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Mayotte", - locale: "fr_YT.UTF-8 UTF-8", - ), - Location( - region: "Indian", - location: "Reunion", - locale: "fr_RE.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/locales.dart b/lib/locales/locales.dart deleted file mode 100644 index 9c82ded..0000000 --- a/lib/locales/locales.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:jade_gui/locales/arctic.dart'; -import 'package:jade_gui/locales/africa.dart'; -import 'package:jade_gui/locales/america.dart'; -import 'package:jade_gui/locales/antarctica.dart'; -import 'package:jade_gui/locales/asia.dart'; -import 'package:jade_gui/locales/atlantic.dart'; -import 'package:jade_gui/locales/australia.dart'; -import 'package:jade_gui/locales/brazil.dart'; -import 'package:jade_gui/locales/canada.dart'; -import 'package:jade_gui/locales/chile.dart'; -import 'package:jade_gui/locales/europe.dart'; -import 'package:jade_gui/locales/indian.dart'; -import 'package:jade_gui/locales/mexico.dart'; -import 'package:jade_gui/locales/pacific.dart'; -import 'package:jade_gui/classes/location.dart'; - -class Local { - List location = const [Location()]; - String name = ""; - - Local(this.location, this.name); -} - -List locations = [ - Local(africa, "Africa"), - Local(america, "America"), - Local(antarctica, "Antarctica"), - Local(arctic, "Arctic"), - Local(asia, "Asia"), - Local(atlantic, "Atlantic"), - Local(australia, "Australia"), - Local(brazil, "Brazil"), - Local(canada, "Canada"), - Local(chile, "Chile"), - Local(europe, "Europe"), - Local(indian, "Indian"), - Local(mexico, "Mexico"), - Local(pacific, "Pacific"), -]; diff --git a/lib/locales/mexico.dart b/lib/locales/mexico.dart deleted file mode 100644 index 3fd4286..0000000 --- a/lib/locales/mexico.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List mexico = const [ - Location( - region: "Mexico", - location: "BajaNorte", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "Mexico", - location: "BajaSur", - locale: "es_MX.UTF-8 UTF-8", - ), - Location( - region: "Mexico", - location: "General", - locale: "es_MX.UTF-8 UTF-8", - ), -]; diff --git a/lib/locales/pacific.dart b/lib/locales/pacific.dart deleted file mode 100644 index 10a293b..0000000 --- a/lib/locales/pacific.dart +++ /dev/null @@ -1,219 +0,0 @@ -import 'package:jade_gui/classes/location.dart'; - -List pacific = const [ - Location( - region: "Pacific", - location: "Apia", - locale: "en_WS.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Auckland", - locale: "en_NZ.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Bougainville", - locale: "en_PG.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Chatham", - locale: "en_NZ.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Chuuk", - locale: "en_FM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Easter", - locale: "en_CL.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Efate", - locale: "en_VU.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Enderbury", - locale: "en_KI.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Fakaofo", - locale: "en_TK.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Fiji", - locale: "en_FJ.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Funafuti", - locale: "en_TV.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Galapagos", - locale: "en_EC.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Gambier", - locale: "en_PF.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Guadalcanal", - locale: "en_SB.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Guam", - locale: "en_GU.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Honolulu", - locale: "en_US.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Johnston", - locale: "en_UM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Kiritimati", - locale: "en_KI.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Kosrae", - locale: "en_FM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Kwajalein", - locale: "en_MH.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Majuro", - locale: "en_MH.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Marquesas", - locale: "en_PF.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Midway", - locale: "en_UM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Nauru", - locale: "en_NR.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Niue", - locale: "en_NU.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Norfolk", - locale: "en_NF.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Noumea", - locale: "en_NC.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Pago_Pago", - locale: "en_AS.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Palau", - locale: "en_PW.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Pitcairn", - locale: "en_PN.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Pohnpei", - locale: "en_FM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Ponape", - locale: "en_FM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Port_Moresby", - locale: "en_PG.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Rarotonga", - locale: "en_CK.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Saipan", - locale: "en_MP.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Samoa", - locale: "en_AS.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Tahiti", - locale: "en_PF.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Tarawa", - locale: "en_KI.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Tongatapu", - locale: "en_TO.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Truk", - locale: "en_FM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Wake", - locale: "en_UM.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Wallis", - locale: "en_WF.UTF-8 UTF-8", - ), - Location( - region: "Pacific", - location: "Yap", - locale: "en_FM.UTF-8 UTF-8", - ), -]; diff --git a/lib/main.dart b/lib/main.dart deleted file mode 100644 index 04412a9..0000000 --- a/lib/main.dart +++ /dev/null @@ -1,866 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jade_gui/functions/welcome.dart'; -import 'package:jade_gui/functions/locale.dart'; -import 'package:jade_gui/functions/keyboard.dart'; -import 'package:jade_gui/functions/users.dart'; -import 'package:jade_gui/functions/desktop.dart'; -import 'package:jade_gui/functions/partition.dart'; -import 'package:jade_gui/functions/summary.dart'; -import 'package:jade_gui/functions/misc.dart'; -import 'package:jade_gui/functions/install.dart'; -import 'package:jade_gui/classes/keymap.dart'; -import 'package:jade_gui/classes/desktop.dart'; -import 'package:jade_gui/desktops/desktops.dart'; -import 'package:jade_gui/classes/partition.dart'; -import 'package:window_size/window_size.dart'; - -import 'dart:io'; - -Map env = Platform.environment; - -Future checkIsEfi( - setState, - runningEfi, - setRunningEfi, -) async { - if (!runningEfi) { - final String scriptOutput = await Process.run( - "/opt/jade_gui/scripts/checkEfi.sh", [], - runInShell: true) - .then((ProcessResult result) { - return result.stdout; - }); - bool isEfi = scriptOutput == "UEFI\n" ? true : false; - debugPrint(isEfi.toString()); - debugPrint(scriptOutput); - - setState(isEfi); - setRunningEfi(); - } -} - -Future getPartition(setState, runningPart, setRunningPart) async { - if (!runningPart) { - final String partitions = await Process.run( - "/opt/jade_gui/scripts/getPartitions.sh", [], - runInShell: true) - .then((ProcessResult result) { - return result.stdout; - }); - var parts = []; - for (int i = 0; i < partitions.split("\n").length; i++) { - if (partitions.split("\n")[i] != "") { - parts.add(Partition(partition: partitions.split("\n")[i])); - } - } - setState(parts); - setRunningPart(true); - } -} - -Future checkConnected( - setState, -) async { - final String scriptOutput = await Process.run( - "/opt/jade_gui/scripts/checkNetwork.sh", - [], - runInShell: true, - ).then((ProcessResult result) { - return result.stdout; - }); - bool connected = scriptOutput.contains("disconnected") ? false : true; - setState(connected); -} - -Future writeToLog(String message) async { - await File('${env["HOME"]}/jade_log.txt') - .readAsString() - .then((String contents) { - File("jade_log.txt").writeAsString(contents + "\n" + message); - }); -} - -void setWindowSize() { - setWindowMinSize(const Size(0, 0)); - setWindowMaxSize(const Size(1300, 870)); -} - -localIP(setState) async { - for (var interface in await NetworkInterface.list()) { - for (var addr in interface.addresses) { - if (!addr.address.contains(":")) { - setState(addr.address); - } - } - } -} - -void main() => runApp( - const MaterialApp( - debugShowCheckedModeBanner: false, - home: Jadegui(), - ), - ); - -Future setPassword(clearPass, setState) async { - final String password = - await Process.run("openssl", ["passwd", "-crypt", clearPass]) - .then((ProcessResult result) { - return result.stdout; - }); - debugPrint(password); - setState(password.replaceAll("\n", "")); -} - -Future startWebsocket(key, running, setRunning) async { - if (!running && key != "") { - Process.run("/opt/jade_gui/scripts/websocket.py", [key], runInShell: true) - .then((ProcessResult result) { - return result.stdout; - }); - setRunning(true); - } -} - -class Jadegui extends StatefulWidget { - const Jadegui({Key? key}) : super(key: key); - - @override - _JadeguiState createState() => _JadeguiState(); -} - -class _JadeguiState extends State { - var file = File('${env["HOME"]}/jade_log.txt').writeAsString(""); - int _selectedIndex = 0; - bool nextpage = false; - bool choseLayout = false; - bool choseRegion = false; - bool enableSudo = true; - bool enableRoot = false; - bool isEfi = false; - bool ipv6 = false; - bool enableTimeshift = true; - bool enableFlatpak = true; - bool connected = false; - bool manualPartitioning = false; - bool enableUnakite = true; - bool running = false; - bool runningInfo = false; - bool runningPart = false; - bool runningInfoMan = false; - bool runningPartMan = false; - bool runningSum = false; - bool runningEfi = false; - bool runningWebsocket = false; - String clearPass = ""; - String password = ""; - String confirmPassword = ""; - String username = ""; - String rootPass = ""; - String confirmRootPass = ""; - String disks = ""; - String selectedDisk = ""; - String diskInfo = ""; - String _diskType = ""; - String hostname = ""; - String output = ""; - String unakiteRoot = ""; - String crystalRoot = ""; - String unakiteEfiDir = ""; - String unakiteBootDev = ""; - String ip = ""; - String key = ""; - String selectedKernel = "linux"; - Desktop currDesktop = desktops[0]; - Keymap chosenLayout = Keymap(); - List partitions = []; - - @override - Widget build(BuildContext context) { - startWebsocket(key, runningWebsocket, (value) { - setState(() { - runningWebsocket = value; - }); - }); - localIP((value) { - setState(() { - ip = value; - }); - }); - getPartition( - (value) { - setState(() { - partitions = value; - }); - }, - runningPart, - (value) { - setState(() { - runningPart = value; - }); - }); - setWindowSize(); - checkConnected( - (value) { - setState(() { - connected = value; - }); - }, - ); - return Scaffold( - backgroundColor: const Color.fromARGB(255, 23, 23, 23), - body: Row( - children: [ - NavigationRail( - backgroundColor: const Color.fromARGB(255, 27, 27, 27), - selectedIndex: _selectedIndex, - onDestinationSelected: (int index) { - setState(() { - _selectedIndex = index; - }); - }, - labelType: NavigationRailLabelType.selected, - destinations: const [ - NavigationRailDestination( - icon: Icon( - Icons.home_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.home, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Welcome', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.location_on_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.location_on, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Location', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.keyboard_alt_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.keyboard, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Keymap', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.person_add_alt_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.person_add_alt, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Users', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.desktop_windows_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.desktop_windows, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Desktop', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.miscellaneous_services_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.miscellaneous_services, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Misc', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.pie_chart_outline, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.pie_chart, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Partitioning', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.summarize_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.summarize, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Summary', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - NavigationRailDestination( - icon: Icon( - Icons.download_outlined, - color: Color.fromARGB(255, 169, 0, 255), - ), - selectedIcon: Icon( - Icons.download, - color: Color.fromARGB(255, 169, 0, 255), - ), - label: Text( - 'Installing', - style: TextStyle( - color: Color.fromARGB(100, 255, 255, 255), - fontWeight: FontWeight.bold), - ), - ), - ], - ), - const VerticalDivider(thickness: 1, width: 1), - // This is the main content. - Expanded( - child: condition(), - ), - ], - ), - ); - } - - bool loadnextpage(region) { - bool next = false; - if (region != "") { - setState(() { - next = true; - }); - } else { - setState(() { - next = true; - }); - } - return next; - } - - Widget condition() { - Widget widget; - double logicWidth = 1300; - double logicHeight = 870; - switch (_selectedIndex) { - case 0: - widget = SizedBox( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: welcome( - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - connected, - ip, - key, - (value) { - setState(() { - key = value; - }); - }, - ), - ), - ), - ); - break; - case 1: - widget = locale( - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - () { - setState(() { - choseRegion = true; - }); - }, - choseRegion, - (location) { - setState(() { - chosenLocation = location; - }); - }, - chosenLocation, - (value) { - writeToLog(value); - }, - ); - //writeToLog("locale: $region"); - - break; - case 2: - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: keyboard( - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - () { - setState(() { - choseLayout = true; - }); - }, - choseLayout, - (layout) { - setState(() { - chosenLayout = layout; - }); - }, - chosenLayout, - (value) { - writeToLog(value); - }, - ), - ), - ), - ); - break; - case 3: - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: users( - (value) { - setState(() { - enableSudo = value; - writeToLog("Enable sudo: $enableSudo"); - }); - }, - enableSudo, - (String? value) { - setState(() { - if (value != null) { - setPassword(value, (String encPass) { - setState(() { - password = encPass; - clearPass = value; - }); - }); - } - }); - }, - (value) { - setState(() { - confirmPassword = value; - }); - }, - clearPass, - confirmPassword, - (value) { - setState(() { - username = value; - writeToLog("Username: $username"); - }); - }, - username, - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - ), - ), - ), - ); - break; - case 4: - clearPass = ""; - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: desktopView( - currDesktop, - (selectedDesktop) { - setState(() { - currDesktop = selectedDesktop; - writeToLog("Desktop: ${selectedDesktop.name}"); - }); - }, - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - ), - ), - ), - ); - break; - case 5: - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: misc( - (value) { - setState(() { - ipv6 = value; - writeToLog("IPv6: $ipv6"); - }); - }, - (value) { - setState(() { - hostname = value; - writeToLog("Hostname: $hostname"); - }); - }, - (value) { - setState(() { - enableTimeshift = value; - writeToLog("Enable timeshift: $enableTimeshift"); - }); - }, - ipv6, - hostname, - enableTimeshift, - (value) { - setState(() { - enableRoot = value; - writeToLog("Enable root: $enableRoot"); - }); - }, - enableRoot, - (String? value) { - setState(() { - if (value != null) { - rootPass = value; - } - }); - }, - (value) { - setState(() { - confirmRootPass = value; - }); - }, - rootPass, - confirmRootPass, - enableFlatpak, - (value) { - setState(() { - enableFlatpak = value; - writeToLog("Enable flatpak: $enableFlatpak"); - }); - }, - (value) { - setState(() { - selectedKernel = value; - }); - }, - selectedKernel, - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - ), - ), - ), - ); - break; - case 6: - checkIsEfi( - (value) { - setState(() { - isEfi = value; - }); - writeToLog("Is efi: $isEfi"); - }, - runningEfi, - () { - setState(() { - runningEfi = true; - }); - }); - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: partitioning( - disks, - (value) { - setState(() { - disks = value; - writeToLog("Disks:widget $disks"); - }); - }, - (value) { - setState(() { - selectedDisk = value; - writeToLog("Selected disk: $selectedDisk"); - }); - }, - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - (value) { - setState(() { - diskInfo = value; - writeToLog("Partition info: $diskInfo"); - }); - }, - selectedDisk, - diskInfo, - runningPart, - (value) { - setState(() { - runningPart = value; - }); - }, - runningInfo, - (value) { - setState(() { - runningInfo = value; - }); - }, - manualPartitioning, - (value) { - setState(() { - manualPartitioning = value; - }); - }, - runningInfoMan, - runningPartMan, - (value) { - setState(() { - runningPartMan = value; - }); - }, - (value) { - setState(() { - runningInfoMan = value; - }); - }, - (value) { - setState(() { - partitions = value; - }); - }, - partitions, - (partition, value) { - setState(() { - partition.mountpoint = value; - if (value == "/boot/efi" && isEfi) { - partition.filesystem = "vfat"; - unakiteEfiDir = value; - unakiteBootDev = partition.partition; - } else if (value == "/boot") { - unakiteEfiDir = value; - unakiteBootDev = partition.partition; - } else if (value == "/") { - crystalRoot = partition.partition; - } else if (value == "unakite") { - unakiteRoot = partition.partition; - partition.filesystem = "btrfs"; - } - }); - }, - (partition, value) { - setState(() { - if (partition.mountpoint != "unakite") { - partition.filesystem = value; - } - }); - }, - isEfi), - ), - ), - ); - break; - case 7: - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: summary( - getSelectedLocPack(), - getChosenLayout(), - getChosenVariant(), - username, - enableSudo, - enableRoot, - currDesktop, - selectedDisk, - isEfi, - "grub-efi", - hostname, - ipv6, - enableTimeshift, - enableFlatpak, - _diskType, - diskInfo, - (value) { - setState(() { - _diskType = value; - }); - }, - () { - setState(() { - _selectedIndex = _selectedIndex + 1; - }); - }, - runningSum, - () { - setState(() { - runningSum = true; - }); - }, - partitions, - ), - ), - ), - ); - break; - case 8: - widget = SizedBox.expand( - child: FittedBox( - fit: BoxFit.contain, - alignment: Alignment.center, - child: SizedBox( - width: logicWidth, - height: logicHeight, - child: install( - getSelectedLocPack(), - getChosenLayout(), - getChosenVariant(), - username, - password, - enableSudo, - rootPass, - currDesktop, - selectedDisk, - isEfi, - isEfi ? "grub-efi" : "grub-legacy", - hostname, - ipv6, - enableTimeshift, - enableFlatpak, - enableUnakite, - unakiteRoot, - unakiteBootDev, - unakiteEfiDir, - crystalRoot, - (value) { - setState(() { - if (value.compareTo(output) == 1) { - writeToLog(value.replaceAll(output, "")); - } - output = output + "\n" + value; - }); - }, - output, - running, - (value) { - setState(() { - running = value; - }); - }, - writeToLog, - partitions, - manualPartitioning, - ), - ), - ), - ); - break; - default: - widget = const Text( - 'You should not see this, report this at https://git.tar.black/crystal/jade_gui', - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.bold, - color: Colors.red, - ), - ); - } - - // Finally returning a Widget - return widget; - } -} diff --git a/linux/.gitignore b/linux/.gitignore deleted file mode 100644 index d3896c9..0000000 --- a/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -flutter/ephemeral diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt deleted file mode 100644 index 06ea31f..0000000 --- a/linux/CMakeLists.txt +++ /dev/null @@ -1,116 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(runner LANGUAGES CXX) - -set(BINARY_NAME "jade_gui") -set(APPLICATION_ID "com.example.jade_gui") - -cmake_policy(SET CMP0063 NEW) - -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Configure build options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - -# Flutter library and tool build rules. -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Application build -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) -apply_standard_settings(${BINARY_NAME}) -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) -add_dependencies(${BINARY_NAME} flutter_assemble) -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() diff --git a/linux/flutter/CMakeLists.txt b/linux/flutter/CMakeLists.txt deleted file mode 100644 index 33fd580..0000000 --- a/linux/flutter/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 9f8c703..0000000 --- a/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) window_size_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin"); - window_size_plugin_register_with_registrar(window_size_registrar); -} diff --git a/linux/flutter/generated_plugin_registrant.h b/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47..0000000 --- a/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake deleted file mode 100644 index 12c7443..0000000 --- a/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - window_size -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/linux/main.cc b/linux/main.cc deleted file mode 100644 index e7c5c54..0000000 --- a/linux/main.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} diff --git a/linux/my_application.cc b/linux/my_application.cc deleted file mode 100644 index 5ea8e0c..0000000 --- a/linux/my_application.cc +++ /dev/null @@ -1,104 +0,0 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "jade_gui"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "jade_gui"); - } - - gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); -} diff --git a/linux/my_application.h b/linux/my_application.h deleted file mode 100644 index 72271d5..0000000 --- a/linux/my_application.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/main-page-screenshot.png b/main-page-screenshot.png new file mode 100644 index 0000000..5462289 Binary files /dev/null and b/main-page-screenshot.png differ diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..970e0bc --- /dev/null +++ b/meson.build @@ -0,0 +1,23 @@ +project('jade_gui', + version: '0.1.0', + meson_version: '>= 0.59.0', + default_options: [ 'warning_level=2', + 'werror=false', + ], +) + +i18n = import('i18n') + +gnome = import('gnome') + + + +subdir('data') +subdir('src') +subdir('po') + +gnome.post_install( + glib_compile_schemas: true, + gtk_update_icon_cache: true, + update_desktop_database: true, +) diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..e69de29 diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 0000000..79c2026 --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,8 @@ +data/al.getcryst.jadegui.desktop.in +data/al.getcryst.jadegui.appdata.xml.in +data/al.getcryst.jadegui.gschema.xml +src/window.ui + +src/main.py +src/window.py + diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..dbe79db --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext('jade_gui', preset: 'glib') diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 587fff1..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,373 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - adwaita_icons: - dependency: "direct main" - description: - name: adwaita_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.9.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.16.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - open_url: - dependency: "direct main" - description: - name: open_url - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.12" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.4" - process_run: - dependency: "direct main" - description: - name: process_run - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3+2" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - qr: - dependency: transitive - description: - name: qr - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - qr_flutter: - dependency: "direct main" - description: - name: qr_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0+2" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.4" - window_size: - dependency: "direct main" - description: - path: "plugins/window_size" - ref: a738913c8ce2c9f47515382d40827e794a334274 - resolved-ref: a738913c8ce2c9f47515382d40827e794a334274 - url: "https://github.com/google/flutter-desktop-embedding.git" - source: git - version: "0.1.0" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+1" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" -sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=2.11.0-0.1.pre" diff --git a/pubspec.yaml b/pubspec.yaml deleted file mode 100644 index 1f581ad..0000000 --- a/pubspec.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: jade_gui -description: A new Flutter project. - -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 - -environment: - sdk: ">=2.15.1 <3.0.0" - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - process_run: ^0.12.3+2 - path_provider: ^2.0.9 - window_size: - git: - url: https://github.com/google/flutter-desktop-embedding.git - path: plugins/window_size - ref: a738913c8ce2c9f47515382d40827e794a334274 - adwaita_icons: ^0.2.1 - qr_flutter: ^4.0.0 - open_url: ^2.0.0 - flutter_svg: ^1.1.0 - - -dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^1.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - assets/ - - assets/desktops/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/save b/save deleted file mode 100644 index dd6d052..0000000 --- a/save +++ /dev/null @@ -1 +0,0 @@ -/nix/store/mi38zzxcylfc1jwnbbjyln959k1yjl9b-coreutils-9.0/bin/env diff --git a/scripts/checkEfi.sh b/scripts/checkEfi.sh deleted file mode 100755 index 55e5901..0000000 --- a/scripts/checkEfi.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS diff --git a/scripts/checkNetwork.sh b/scripts/checkNetwork.sh deleted file mode 100755 index 320380e..0000000 --- a/scripts/checkNetwork.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -ping -c2 getcryst.al -q > /dev/null -if [[ $? -eq 0 ]]; then - echo "connected" -else - echo "disconnected" -fi diff --git a/scripts/getDiskInfo.sh b/scripts/getDiskInfo.sh deleted file mode 100755 index 4cd49b7..0000000 --- a/scripts/getDiskInfo.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -lsblk -pdo SIZE $1 | grep -v SIZE diff --git a/scripts/getDiskType.sh b/scripts/getDiskType.sh deleted file mode 100755 index 01f6376..0000000 --- a/scripts/getDiskType.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -lsblk -d -o rota $1 | grep -v ROTA \ No newline at end of file diff --git a/scripts/getDisks.sh b/scripts/getDisks.sh deleted file mode 100755 index 3497363..0000000 --- a/scripts/getDisks.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr diff --git a/scripts/getPartitions.sh b/scripts/getPartitions.sh deleted file mode 100755 index a221695..0000000 --- a/scripts/getPartitions.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -blkid -o device | grep -v zram | grep -v loop | grep -v sr \ No newline at end of file diff --git a/scripts/jadeTest.sh b/scripts/jadeTest.sh deleted file mode 100755 index cfb7e36..0000000 --- a/scripts/jadeTest.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/bash -echo $(cat $1) \ No newline at end of file diff --git a/scripts/jadeemu.sh b/scripts/jadeemu.sh deleted file mode 100755 index 13e45b2..0000000 --- a/scripts/jadeemu.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/bash -whoami -sleep 0.1 -echo "[LOG] doing thing" -sleep 0.1 -echo "[ERROR] failed doing thing" -sleep 1 -echo "[LOG]" -sleep 0.1 -echo "[ERROR]" -sleep 1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 -echo "[LOG]" -sleep 0.1 diff --git a/scripts/jadewrapper.sh b/scripts/jadewrapper.sh deleted file mode 100755 index 0eff9c9..0000000 --- a/scripts/jadewrapper.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist -jade config /tmp/jade.json \ No newline at end of file diff --git a/scripts/websocket.py b/scripts/websocket.py deleted file mode 100755 index f5c05a9..0000000 --- a/scripts/websocket.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/python -import asyncio -import websockets -import json -import subprocess -import os -import sys -from Crypto.Cipher import AES -from Crypto.Util.Padding import unpad, pad -from base64 import b64decode, b64encode - -def decrypt(message, key, iv): - aes = None - aes = AES.new(key, AES.MODE_CBC, iv) - return unpad(aes.decrypt(b64decode(message)), AES.block_size).decode('utf-8') - -def encrypt(message, key, iv): - aes = None - aes = AES.new(key, AES.MODE_CBC, iv) - return b64encode(aes.encrypt(pad(message.encode('utf-8'), AES.block_size))).decode('utf-8') - -# create handler for each connection -async def handler(websocket): - aeskey = bytes(sys.argv[1], 'utf-8') - data = await websocket.recv() - print(data); - parsed = json.loads(data) - print(parsed['iv']) - iv = b64decode(bytes(parsed['iv'], 'utf-8')) - print(iv) - print(len(iv)) - msgType = decrypt(parsed['type'], aeskey, iv) - if msgType == "get": - search = decrypt(parsed['search'], aeskey, iv) - if search == "disks": - partitions = subprocess.check_output(["bash", "-c", "lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr"]).decode("utf-8") - await websocket.send(json.dumps({"type": "response", "data": partitions})) - elif search == "diskType": - disk = decrypt(parsed['disk'], aeskey, iv) - diskType = subprocess.check_output(["bash", "-c", "lsblk -d -o rota "+disk+" | grep -v ROTA"]) - await websocket.send(json.dumps({"type": "response", "data": diskType.decode("utf-8").strip()})) - elif search == "diskSize": - disk = decrypt(parsed['disk'], aeskey, iv) - diskSize = subprocess.check_output(["bash", "-c", "lsblk -pdo size "+disk+" | grep -v SIZE"]) - await websocket.send(json.dumps({"type": "response", "data": diskSize.decode("utf-8").strip()})) - elif search == "isEfi": - if os.path.exists("/sys/firmware/efi"): - await websocket.send(json.dumps({"type": "response", "data": "UEFI"})) - else: - await websocket.send(json.dumps({"type": "response", "data": "BIOS"})) - elif search == "encryptPass": - data = decrypt(parsed['pass'], aeskey, iv) - password = subprocess.check_output(["bash", "-c", "openssl passwd -crypt "+data]) - await websocket.send(json.dumps({"type": "response", "data": password.decode("utf-8").strip()})) - elif msgType == "send": - command = decrypt(parsed['command'], aeskey, iv) - if command == "installConfig": - data = decrypt(parsed['data'], aeskey, iv) - config = open('/tmp/jade.json', 'w') - config.write(data) - config.close() - subprocess.check_output(["gnome-terminal", "--", "/bin/bash -c", "/usr/bin/sudo /usr/bin/jade config /tmp/jade.json"]) - await websocket.send(json.dumps({"type": "response", "data": "Finished Installing"})) - else: - await websocket.send(json.dumps({"type": encrypt("response", aeskey, iv), "data": encrypt("Invalid Request", aeskey, iv)})) -ip = subprocess.check_output(["bash", "-c", "hostname -i | awk '{print $3}'"]).decode("utf-8").strip() -start_server = websockets.serve(handler, ip, 8080) -asyncio.get_event_loop().run_until_complete(start_server) -asyncio.get_event_loop().run_forever() - diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/classes/__init__.py b/src/classes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/classes/install_prefs.py b/src/classes/install_prefs.py new file mode 100644 index 0000000..c3689e9 --- /dev/null +++ b/src/classes/install_prefs.py @@ -0,0 +1,94 @@ +# install_prefs.py +# +# Copyright 2022 +# +# 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 3 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, see . +# +# SPDX-License-Identifier: GPL-3.0-only + +from jade_gui.utils import disks +import json + +class InstallPrefs: + def __init__( + self, + timezone, + layout, + variant, + username, + password, + enable_sudo, + disk, + hostname, + ipv_enabled, + timeshift_enable, + desktop, + ): + self.timezone = timezone + self.layout = layout + self.variant = variant + self.username = username + self.password = password + self.enable_sudo = enable_sudo + self.disk = disk.disk + self.hostname = hostname if len(hostname) != 0 else "crystal" + self.ipv_enabled = ipv_enabled + self.timeshift_enable = timeshift_enable + self.desktop = desktop + self.is_efi = disks.get_uefi() + self.bootloader_type = "grub-efi" if self.is_efi else "grub-legacy" + self.bootloader_location = "/boot/efi" if self.is_efi else self.disk + + def generate_json(self): + prefs = { + "partition": { + "device": self.disk, + "mode": "Auto", + "efi": self.is_efi, + "partitions": "", + }, + "bootloader": { + "type": self.bootloader_type, + "location": self.bootloader_location, + }, + "locale": { + "locale": [ + self.timezone.locale + ], + "keymap": self.layout.country_shorthand, + "timezone": self.timezone.region+"/"+self.timezone.location, + }, + "networking": { + "hostname": self.hostname, + "ipv6": self.ipv_enabled, + }, + "users": [ + { + "name": self.username, + "password": self.password, + "hasroot": self.enable_sudo, + }, + ], + "rootpass": self.password, + "desktop": self.desktop.lower(), + "unakite": { + "enable": False, + "root": "/dev/null", + "oldroot": self.disk, + "efidir": "/dev/null", + "bootdev": "/dev/null", + }, + "kernel": "linux" + } + return json.dumps(prefs) diff --git a/src/classes/keymap.py b/src/classes/keymap.py new file mode 100644 index 0000000..9b1f43f --- /dev/null +++ b/src/classes/keymap.py @@ -0,0 +1,24 @@ +# keymap.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +class keymap: + def __init__(self, layout, variant, backend_layout): + self.layout = layout + self.variant = variant + self.backend_layout = backend_layout diff --git a/src/classes/locale.py b/src/classes/locale.py new file mode 100644 index 0000000..e397e03 --- /dev/null +++ b/src/classes/locale.py @@ -0,0 +1,24 @@ +# locale.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +class locale: + def __init__(self, locales, region, location): + self.locales = locales + self.region = region + self.location = location diff --git a/src/classes/meson.build b/src/classes/meson.build new file mode 100644 index 0000000..812d62a --- /dev/null +++ b/src/classes/meson.build @@ -0,0 +1,10 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +classesdir = join_paths(pkgdatadir, 'jade_gui/classes') + +jade_gui_sources = [ + '__init__.py', + 'locale.py', + 'keymap.py', + 'install_prefs.py', +] +install_data(jade_gui_sources, install_dir: classesdir) \ No newline at end of file diff --git a/src/crystal-logo-minimal.png b/src/crystal-logo-minimal.png new file mode 100644 index 0000000..2cdb962 Binary files /dev/null and b/src/crystal-logo-minimal.png differ diff --git a/src/desktops.py b/src/desktops.py new file mode 100644 index 0000000..6c2a70a --- /dev/null +++ b/src/desktops.py @@ -0,0 +1,14 @@ +desktops = [ + "Onyx", + "Gnome", + "Kde", + "Budgie", + "Mate", + "Cinnamon", + "Lxqt", + "Sway", + "i3-gaps", + "Herbstluftwm", + "Awesome", + "bspwm" +] diff --git a/src/functions/__init__.py b/src/functions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/functions/desktop_screen.py b/src/functions/desktop_screen.py new file mode 100644 index 0000000..ee7504f --- /dev/null +++ b/src/functions/desktop_screen.py @@ -0,0 +1,60 @@ +# desktop_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/desktop_screen.ui') +class DesktopScreen(Adw.Bin): + __gtype_name__ = 'DesktopScreen' + + list_desktops = Gtk.Template.Child() + next_page_button = Gtk.Template.Child() + + chosen_desktop = "" + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + + self.list_desktops.connect("row-selected", self.selected_desktop) + self.next_page_button.connect("clicked", self.carousel_next) + + def carousel_next(self, widget): + if self.move_to_summary: + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.window.summary_screen, True) + else: + self.carousel.scroll_to(self.next_page, True) + + def carousel_next_summary(self, widget): + self.next_page.move_to_summary=True + self.carousel.scroll_to(self.next_page, True) + + def selected_desktop(self, widget, row): + if row is not None: + print(row.get_title()) + self.chosen_desktop = row.get_title() + row.select_button.set_active(True) + else: + print("row is none!!") diff --git a/src/functions/finished_screen.py b/src/functions/finished_screen.py new file mode 100644 index 0000000..bb12688 --- /dev/null +++ b/src/functions/finished_screen.py @@ -0,0 +1,29 @@ +# desktop_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/finished_screen.ui') +class FinishedScreen(Adw.Bin): + __gtype_name__='FinishedScreen' + + def __init__(self, window, application, **kwargs): + super().__init__(**kwargs) diff --git a/src/functions/install_screen.py b/src/functions/install_screen.py new file mode 100644 index 0000000..ec04e23 --- /dev/null +++ b/src/functions/install_screen.py @@ -0,0 +1,47 @@ +# installer_Screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +import subprocess, os +import asyncio +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/install_screen.ui') +class InstallScreen(Adw.Bin): + __gtype_name__="InstallScreen" + + log_text = Gtk.Template.Child() + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + + def install(self): + prefs = self.window.summary_screen.installprefs.generate_json() + with open(os.getenv("HOME")+"/test.log", "wb") as f: + process = subprocess.Popen(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/install.sh"], stdout=subprocess.PIPE) + for c in iter(lambda: process.stdout.read(1), b""): + log=c + GLib.idle_add(self.update_output, c.decode("utf-8")) + f.write(c) + + def update_output(self, message): + log=self.log_text.get_label() + new_log=f"{log}{message}" + self.log_text.set_label(new_log) diff --git a/src/functions/keyboard_screen.py b/src/functions/keyboard_screen.py new file mode 100644 index 0000000..795ed7c --- /dev/null +++ b/src/functions/keyboard_screen.py @@ -0,0 +1,111 @@ +# keyboard_Screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + + +from jade_gui.locales.locales_list import locations +from jade_gui.widgets.variant import KeyboardVariant +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/keyboard_screen.ui') +class KeyboardScreen(Adw.Bin): + __gtype_name__ = 'KeyboardScreen' + + layout_event_controller = Gtk.EventControllerKey.new() + variant_event_controller = Gtk.EventControllerKey.new() + + keyboard_carousel = Gtk.Template.Child() + list_keyboard_layouts = Gtk.Template.Child() + list_keyboard_variants = Gtk.Template.Child() + keyboard_layouts = Gtk.Template.Child() + keyboard_variants = Gtk.Template.Child() + layout_search = Gtk.Template.Child() + layout_entry_search = Gtk.Template.Child() + variant_search = Gtk.Template.Child() + variant_entry_search = Gtk.Template.Child() + + layout = None + variant = "" + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + self.list_keyboard_layouts.connect("row-selected", self.selected_layout) + self.list_keyboard_variants.connect("row-selected", self.selected_variant) + self.layout_event_controller.connect("key-released", self.search_layouts) + self.variant_event_controller.connect("key-released", self.search_variants) + self.layout_entry_search.add_controller(self.layout_event_controller) + self.variant_entry_search.add_controller(self.variant_event_controller) + + def search_layouts(self, *args): + terms = self.layout_entry_search.get_text() + self.list_keyboard_layouts.set_filter_func(self.filter_text, terms) + + def search_variants(self, *args): + print("in variant") + terms = self.variant_entry_search.get_text() + self.list_keyboard_variants.set_filter_func(self.filter_text, terms) + + def selected_layout(self, widget, row, *args): + if row is not None or row is not self.layout_entry_search: + if self.layout is not None: + for n in range(len(self.layout.variants)): + print(n) + print(self.list_keyboard_variants.get_row_at_index(n)) + if self.list_keyboard_variants.get_row_at_index(n) is not None: + self.list_keyboard_variants.remove(self.list_keyboard_variants.get_row_at_index(n)) + self.layout = row + for variant in row.variants: + self.list_keyboard_variants.append(KeyboardVariant(window=self.window, country=row.country, country_shorthand=row.country_shorthand, variant=variant, *args)) + self.keyboard_carousel.scroll_to(self.keyboard_variants, True) + else: + print("row is none!! layout") + + def selected_variant(self, widget, row): + if row is not None or row is not self.variant_entry_search: + self.variant = row + self.carousel_next() + else: + print("row is none!! variant") + + def carousel_next(self): + if self.move_to_summary: + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.window.summary_screen, True) + else: + self.carousel.scroll_to(self.next_page, True) + + def carousel_next_summary(self, widget): + self.next_page.move_to_summary=True + self.carousel.scroll_to(self.next_page, True) + + @staticmethod + def filter_text(row, terms=None): + try: + text = row.get_title() + text = text.lower() + row.get_subtitle().lower() + if terms.lower() in text: + return True + except: + print("exception") + return True + return False diff --git a/src/functions/meson.build b/src/functions/meson.build new file mode 100644 index 0000000..8d5a230 --- /dev/null +++ b/src/functions/meson.build @@ -0,0 +1,16 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +functionsdir = join_paths(pkgdatadir, 'jade_gui/functions') + +jade_gui_sources = [ + '__init__.py', + 'keyboard_screen.py', + 'timezone_screen.py', + 'user_screen.py', + 'desktop_screen.py', + 'misc_screen.py', + 'partition_screen.py', + 'summary_screen.py', + 'install_screen.py', + 'finished_screen.py', +] +install_data(jade_gui_sources, install_dir: functionsdir) \ No newline at end of file diff --git a/src/functions/misc_screen.py b/src/functions/misc_screen.py new file mode 100644 index 0000000..2360623 --- /dev/null +++ b/src/functions/misc_screen.py @@ -0,0 +1,59 @@ +# misc_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/misc_screen.ui') +class MiscScreen(Adw.Bin): + __gtype_name__ = "MiscScreen" + + hostname_entry = Gtk.Template.Child() + ipv_switch = Gtk.Template.Child() + timeshift_switch = Gtk.Template.Child() + #theme_switch = Gtk.Template.Child() + next_page_button = Gtk.Template.Child() + + hostname = "crystal" + ipv_enabled = False + crystal_theming_enabled = False + timeshift_enabled = True + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + self.next_page_button.connect("clicked", self.carousel_next) + + def carousel_next(self, widget): + self.hostname = self.hostname_entry.get_text() + self.ipv_enabled = self.ipv_switch.get_state() + #self.crystal_theming_enabled = self.theme_switch.get_state() + self.timeshift_enabled = self.timeshift_switch.get_state() + if self.move_to_summary: + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.window.summary_screen, True) + else: + self.carousel.scroll_to(self.next_page, True) + + def carousel_next_summary(self, widget): + self.next_page.move_to_summary=True + self.carousel.scroll_to(self.next_page, True) diff --git a/src/functions/partition_screen.py b/src/functions/partition_screen.py new file mode 100644 index 0000000..d537d3d --- /dev/null +++ b/src/functions/partition_screen.py @@ -0,0 +1,52 @@ +# partition_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/partition_screen.ui') +class PartitionScreen(Adw.Bin): + __gtype_name__ = "PartitionScreen" + + partition_list = Gtk.Template.Child() + next_page_button = Gtk.Template.Child() + #custom_partition = Gtk.Template.Child() + + selected_partition = None + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + self.next_page_button.connect("clicked", self.carousel_next) + self.partition_list.connect("row_selected", self.row_selected) + + def row_selected(self, widget, row): + if row is not None: + print(row.get_title()) + row.select_button.set_active(True) + self.selected_partition = row + else: + print("row is none!!") + + def carousel_next(self, widget): + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.next_page, True) diff --git a/src/functions/summary_screen.py b/src/functions/summary_screen.py new file mode 100644 index 0000000..90da21a --- /dev/null +++ b/src/functions/summary_screen.py @@ -0,0 +1,112 @@ +# summary_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +import subprocess +from jade_gui.utils import disks +from jade_gui.classes.install_prefs import InstallPrefs +from jade_gui.utils.threading import RunAsync +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/summary_screen.ui') +class SummaryScreen(Adw.Bin): + __gtype_name__ = "SummaryScreen" + + next_page_button = Gtk.Template.Child() + + timezone_label = Gtk.Template.Child() + timezone_button = Gtk.Template.Child() + keyboard_label = Gtk.Template.Child() + keyboard_button = Gtk.Template.Child() + username_label = Gtk.Template.Child() + username_button = Gtk.Template.Child() + sudo_label = Gtk.Template.Child() + sudo_button = Gtk.Template.Child() + root_label = Gtk.Template.Child() + root_button = Gtk.Template.Child() + desktop_label = Gtk.Template.Child() + desktop_button = Gtk.Template.Child() + partition_label = Gtk.Template.Child() + partition_button = Gtk.Template.Child() + uefi_label = Gtk.Template.Child() + ipv_label = Gtk.Template.Child() + ipv_button = Gtk.Template.Child() + timeshift_label = Gtk.Template.Child() + timeshift_button = Gtk.Template.Child() + #unakite_label = Gtk.Template.Child() + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.main_carousel = main_carousel + self.next_page = next_page + self.next_page_button.connect("clicked", self.carousel_next) + + def carousel_next(self, widget): + self.main_carousel.scroll_to(self.next_page, True) + #(self.window.installer_screen.install()) + subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/savePrefs.sh '"+self.installprefs.generate_json()+"'"], capture_output=False) + RunAsync(self.window.installer_screen.install) + + def initialize(self): + self.timezone_button.connect("clicked", self.window.nextPage) + self.keyboard_button.connect("clicked", self.window.timezone_screen.carousel_next_summary) + self.username_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) + self.sudo_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) + self.root_button.connect("clicked", self.window.keyboard_screen.carousel_next_summary) + self.desktop_button.connect("clicked", self.window.user_screen.carousel_next_summary) + self.partition_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) + self.ipv_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) + self.timeshift_button.connect("clicked", self.window.desktop_screen.carousel_next_summary) + + self.timezone_label.set_title(self.window.timezone_screen.chosen_timezone.region+"/"+self.window.timezone_screen.chosen_timezone.location) + self.timezone_label.set_subtitle(self.window.timezone_screen.chosen_timezone.locale) + + self.keyboard_label.set_title(self.window.keyboard_screen.layout.country) + self.keyboard_label.set_subtitle(self.window.keyboard_screen.variant.variant) + + self.username_label.set_title(self.window.user_screen.username) + self.sudo_label.set_title("sudo enabled" if self.window.user_screen.sudo_enabled else "sudo disabled") + self.root_label.set_title("root enabled" if self.window.user_screen.root_enabled else "root disabled") + + self.desktop_label.set_title(self.window.desktop_screen.chosen_desktop) + + self.partition_label.set_title(self.window.partition_screen.selected_partition.disk) + self.partition_label.set_subtitle(self.window.partition_screen.selected_partition.disk_size) + self.uefi_label.set_title("UEFI" if disks.get_uefi() else "Legacy BIOS") + + self.ipv_label.set_title("ipv6 enabled" if self.window.misc_screen.ipv_enabled else "ipv6 disabled") + self.timeshift_label.set_title("timeshift enabled" if self.window.misc_screen.timeshift_enabled else "timeshift disabled") + #self.theme_label.set_title("Crystal theming enabled" if self.window.misc_screen.crystal_theming_enabled else "Crystal theming disabled") + #self.unakite_label.set_title("Unakite enabled "+"enabled" if self.window.misc_screen.) + + self.installprefs = InstallPrefs( + timezone=self.window.timezone_screen.chosen_timezone, + layout=self.window.keyboard_screen.layout, + variant=self.window.keyboard_screen.variant, + username=self.window.user_screen.username, + password=self.window.user_screen.password, + enable_sudo=self.window.user_screen.sudo_enabled, + disk=self.window.partition_screen.selected_partition, + hostname=self.window.misc_screen.hostname, + ipv_enabled=self.window.misc_screen.ipv_enabled, + timeshift_enable=self.window.misc_screen.timeshift_enabled, + desktop=self.window.desktop_screen.chosen_desktop, + ) + diff --git a/src/functions/timezone_screen.py b/src/functions/timezone_screen.py new file mode 100644 index 0000000..1701b39 --- /dev/null +++ b/src/functions/timezone_screen.py @@ -0,0 +1,81 @@ +# timezone_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/timezone_screen.ui') +class TimezoneScreen(Adw.Bin): + __gtype_name__ = 'TimezoneScreen' + + event_controller = Gtk.EventControllerKey.new() + + ### Page and widgets on timezone screen + list_timezones = Gtk.Template.Child() + timezone_entry_search = Gtk.Template.Child() + timezone_search = Gtk.Template.Child() + + chosen_timezone = None + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + + self.event_controller.connect("key-released", self.search_timezones) + self.timezone_entry_search.add_controller(self.event_controller) + self.list_timezones.connect("row-selected", self.selected_timezone) + + def selected_timezone(self, widget, row): + print(row) + if row is not None or row is not self.timezone_search: + print(row.get_title()) + self.chosen_timezone = row + self.carousel_next() + else: + print("row is none!!") + + def carousel_next(self): + if self.move_to_summary: + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.window.summary_screen, True) + else: + self.carousel.scroll_to(self.next_page, True) + + def carousel_next_summary(self): + self.next_page.move_to_summary=True + self.carousel.scroll_to(self.next_page, True) + + def search_timezones(self, *args): + terms = self.timezone_entry_search.get_text() + self.list_timezones.set_filter_func(self.filter_timezones, terms) + + @staticmethod + def filter_timezones(row, terms=None): + try: + text = row.get_title() + text = text.lower() + row.get_subtitle().lower() + if terms.lower() in text: + return True + except: + return True + return False diff --git a/src/functions/user_screen.py b/src/functions/user_screen.py new file mode 100644 index 0000000..e1f0e13 --- /dev/null +++ b/src/functions/user_screen.py @@ -0,0 +1,112 @@ +# user_screen.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + + +from gi.repository import Gtk, Adw +from gettext import gettext as _ +import re + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/user_screen.ui') +class UserScreen(Adw.Bin): + __gtype_name__ = "UserScreen" + + username_entry = Gtk.Template.Child() + password_entry = Gtk.Template.Child() + password_confirmation = Gtk.Template.Child() + enable_sudo_switch = Gtk.Template.Child() + enable_root_switch = Gtk.Template.Child() + next_page_button = Gtk.Template.Child() + + username = "" + sudo_enabled = True + root_enabled = True + move_to_summary = False + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.carousel = main_carousel + self.next_page = next_page + self.sudo_enabled = True + self.root_enabled = True + self.enable_root_switch.set_active(self.root_enabled) + self.enable_sudo_switch.set_active(self.sudo_enabled) + self.username_entry.connect('changed', self.username_passes_regex) + self.enable_root_switch.connect('state-set', self.enable_root_user) + self.enable_sudo_switch.connect('state-set', self.enable_sudo) + self.password_entry.connect('changed', self.verify_password) + self.password_confirmation.connect('changed', self.verify_password) + self.next_page_button.connect('clicked', self.carousel_next) + + def username_passes_regex(self, widget): + input = self.username_entry.get_text() + print(input) + if not re.search("^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$", input): + print("Invalid username!") + self.username_entry.add_css_class('error') + self.next_page.set_sensitive(False) + else: + print("Valid username!") + self.username_entry.remove_css_class('error') + self.next_page.set_sensitive(True) + self.username = input + + def enable_root_user(self, widget, switch_state): + print("root") + print(self.root_enabled) + print(switch_state) + if switch_state == False and not self.sudo_enabled: + self.root_enabled = switch_state + self.sudo_enabled = not switch_state + self.enable_sudo_switch.set_active(not switch_state) + else: + self.root_enabled = switch_state + + + + def enable_sudo(self, widget, switch_state): + print("sudo") + print(self.root_enabled) + print(switch_state) + if switch_state == False and not self.root_enabled: + self.sudo_enabled = switch_state + self.root_enabled = not switch_state + self.enable_root_switch.set_active(not switch_state) + else: + self.sudo_enabled = switch_state + + def verify_password(self, widget): + if self.password_entry.get_text() == self.password_confirmation.get_text(): + self.next_page.set_sensitive(True) + self.password_confirmation.remove_css_class('error') + self.password = self.password_entry.get_text() + elif self.password_entry.get_text() != self.password_confirmation.get_text(): + self.next_page.set_sensitive(False) + self.password_confirmation.add_css_class('error') + + def carousel_next(self, widget): + if self.move_to_summary: + self.window.summary_screen.initialize() + self.carousel.scroll_to(self.window.summary_screen, True) + else: + self.carousel.scroll_to(self.next_page, True) + + def carousel_next_summary(self, widget): + self.next_page.move_to_summary=True + self.carousel.scroll_to(self.next_page, True) diff --git a/src/gtk/help-overlay.blp b/src/gtk/help-overlay.blp new file mode 100644 index 0000000..90ee78f --- /dev/null +++ b/src/gtk/help-overlay.blp @@ -0,0 +1,24 @@ +using Gtk 4.0; + +ShortcutsWindow help_overlay { + modal: true; + + ShortcutsSection { + section-name: "shortcuts"; + max-height: 10; + + ShortcutsGroup { + title: C_("shortcut window", "General"); + + ShortcutsShortcut { + title: C_("shortcut window", "Show Shortcuts"); + action-name: "win.show-help-overlay"; + } + + ShortcutsShortcut { + title: C_("shortcut window", "Quit"); + action-name: "app.quit"; + } + } + } +} diff --git a/src/jade_gui.gresource.xml b/src/jade_gui.gresource.xml new file mode 100644 index 0000000..6962c6a --- /dev/null +++ b/src/jade_gui.gresource.xml @@ -0,0 +1,22 @@ + + + + window.ui + widgets/timezone.ui + widgets/layout.ui + widgets/variant.ui + widgets/desktop.ui + widgets/disk.ui + pages/keyboard_screen.ui + pages/timezone_screen.ui + pages/user_screen.ui + pages/desktop_screen.ui + pages/misc_screen.ui + pages/partition_screen.ui + pages/summary_screen.ui + pages/install_screen.ui + pages/finished_screen.ui + gtk/help-overlay.ui + crystal-logo-minimal.png + + diff --git a/src/jade_gui.in b/src/jade_gui.in new file mode 100755 index 0000000..d4987bc --- /dev/null +++ b/src/jade_gui.in @@ -0,0 +1,48 @@ +#!@PYTHON@ + +# jade_gui.in + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +import os +import sys +import signal +import locale +import gettext + +VERSION = '@VERSION@' +pkgdatadir = '@pkgdatadir@' +localedir = '@localedir@' + +sys.path.insert(1, pkgdatadir) +signal.signal(signal.SIGINT, signal.SIG_DFL) +locale.bindtextdomain('jade_gui', localedir) +locale.textdomain('jade_gui') +gettext.install('jade_gui', localedir) + +if __name__ == '__main__': + import gi + + from gi.repository import Gio + resource = Gio.Resource.load(os.path.join(pkgdatadir, 'jade_gui.gresource')) + icons = Gio.Resource.load(os.path.join(pkgdatadir, 'jade_gui_resources.gresource')) + resource._register() + icons._register() + + from jade_gui import main + sys.exit(main.main(VERSION)) diff --git a/lib/Keymaps/keymaps.dart b/src/keymaps.py similarity index 61% rename from lib/Keymaps/keymaps.dart rename to src/keymaps.py index 5118b8c..839beb0 100644 --- a/lib/Keymaps/keymaps.dart +++ b/src/keymaps.py @@ -1,31 +1,31 @@ -import 'package:jade_gui/classes/keymap.dart'; +from jade_gui.classes.keymap import keymap -List keymaps = [ - Keymap( - layout: "Afghanistan", - backLayout: "Af", - variant: [ +keymaps = [ + keymap( + layout="Afghanistan", + backend_layout="Af", + variant=[ "normal", "fa-olpc", "olpc-ps", "ps", - "uz", + "uz", "uz-olpc", ], ), - Keymap( - layout: "Albania", - backLayout: "al", - variant: [ + keymap( + layout="Albania", + backend_layout="al", + variant=[ "normal", "plisi", "veqilharxhi", ], ), - Keymap( - layout: "Armenia", - backLayout: "am", - variant: [ + keymap( + layout="Armenia", + backend_layout="am", + variant=[ "normal", "eastern", "eastern-alt", @@ -34,10 +34,10 @@ List keymaps = [ "western", ], ), - Keymap( - layout: "Arabic", - backLayout: "ara", - variant: [ + keymap( + layout="Arabic", + backend_layout="ara", + variant=[ "normal", "azerty", "azerty_digits", @@ -49,35 +49,35 @@ List keymaps = [ "qwerty_digits", ], ), - Keymap( - layout: "Austria", - backLayout: "at", - variant: [ + keymap( + layout="Austria", + backend_layout="at", + variant=[ "normal", "mac", "nodeadkeyrs", ], ), - Keymap( - layout: "Australia", - backLayout: "au", - variant: [ + keymap( + layout="Australia", + backend_layout="au", + variant=[ "normal", "", ], ), - Keymap( - layout: "Azerbaijan", - backLayout: "az", - variant: [ + keymap( + layout="Azerbaijan", + backend_layout="az", + variant=[ "normal", "cyrillic", ], ), - Keymap( - layout: "Bosnia and Herzegovina", - backLayout: "ba", - variant: [ + keymap( + layout="Bosnia and Herzegovina", + backend_layout="ba", + variant=[ "normal", "alternatequotes", "unicode", @@ -85,18 +85,18 @@ List keymaps = [ "us", ], ), - Keymap( - layout: "Bangladesh", - backLayout: "bd", - variant: [ + keymap( + layout="Bangladesh", + backend_layout="bd", + variant=[ "normal", "probhat", ], ), - Keymap( - layout: "Belgium", - backLayout: "be", - variant: [ + keymap( + layout="Belgium", + backend_layout="be", + variant=[ "normal", "iso-alternate", "nodeadkeys", @@ -105,20 +105,20 @@ List keymaps = [ "wang", ], ), - Keymap( - layout: "Bulgaria", - backLayout: "bg", - variant: [ + keymap( + layout="Bulgaria", + backend_layout="bg", + variant=[ "normal", "bas_phonetic", "bekl", "phonetic", ], ), - Keymap( - layout: "Brazil", - backLayout: "br", - variant: [ + keymap( + layout="Brazil", + backend_layout="br", + variant=[ "normal", "dvorak", "nativo", @@ -128,26 +128,26 @@ List keymaps = [ "thinkpad", ], ), - Keymap( - layout: "Bhutan", - backLayout: "bt", - variant: [ + keymap( + layout="Bhutan", + backend_layout="bt", + variant=[ "normal", "latin", ], ), - Keymap( - layout: "Botswana", - backLayout: "bw", - variant: [ + keymap( + layout="Botswana", + backend_layout="bw", + variant=[ "normal", "", ], ), - Keymap( - layout: "Belarus", - backLayout: "by", - variant: [ + keymap( + layout="Belarus", + backend_layout="by", + variant=[ "normal", "intl", "latin", @@ -155,10 +155,10 @@ List keymaps = [ "ru", ], ), - Keymap( - layout: "Canada", - backLayout: "ca", - variant: [ + keymap( + layout="Canada", + backend_layout="ca", + variant=[ "normal", "eng", "fr-dvorak", @@ -169,18 +169,18 @@ List keymaps = [ "multix", ], ), - Keymap( - layout: "Democratic Republic of Congo", - backLayout: "cd", - variant: [ + keymap( + layout="Democratic Republic of Congo", + backend_layout="cd", + variant=[ "normal", "", ], ), - Keymap( - layout: "Switzerland", - backLayout: "ch", - variant: [ + keymap( + layout="Switzerland", + backend_layout="ch", + variant=[ "normal", "de_mac", "de_nodeadkeys", @@ -190,10 +190,10 @@ List keymaps = [ "legacy", ], ), - Keymap( - layout: "Cameroon", - backLayout: "cm", - variant: [ + keymap( + layout="Cameroon", + backend_layout="cm", + variant=[ "normal", "azerty", "dvorak", @@ -202,10 +202,10 @@ List keymaps = [ "qwerty", ], ), - Keymap( - layout: "China", - backLayout: "cn", - variant: [ + keymap( + layout="China", + backend_layout="cn", + variant=[ "normal", "altgr-pinyin", "mon_manchu_galik", @@ -220,10 +220,10 @@ List keymaps = [ "ug", ], ), - Keymap( - layout: "Czechia", - backLayout: "cz", - variant: [ + keymap( + layout="Czechia", + backend_layout="cz", + variant=[ "normal", "bksl", "dvorak-ucw", @@ -234,10 +234,10 @@ List keymaps = [ "ucw", ], ), - Keymap( - layout: "Germany", - backLayout: "de", - variant: [ + keymap( + layout="Germany", + backend_layout="de", + variant=[ "normal", "T3", "deadacute", @@ -260,10 +260,10 @@ List keymaps = [ "us", ], ), - Keymap( - layout: "Denmark", - backLayout: "dk", - variant: [ + keymap( + layout="Denmark", + backend_layout="dk", + variant=[ "normal", "dvorak", "mac", @@ -272,10 +272,10 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "Algeria", - backLayout: "dz", - variant: [ + keymap( + layout="Algeria", + backend_layout="dz", + variant=[ "normal", "ar", "azerty-deadkeys", @@ -284,20 +284,20 @@ List keymaps = [ "qwerty-us-deadkeys", ], ), - Keymap( - layout: "Estonia", - backLayout: "ee", - variant: [ + keymap( + layout="Estonia", + backend_layout="ee", + variant=[ "normal", "dvorak", "nodeadkeys", "us", ], ), - Keymap( - layout: "Spain", - backLayout: "es", - variant: [ + keymap( + layout="Spain", + backend_layout="es", + variant=[ "normal", "ast", "cat", @@ -308,18 +308,18 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "Ethiopia", - backLayout: "et", - variant: [ + keymap( + layout="Ethiopia", + backend_layout="et", + variant=[ "normal", "", ], ), - Keymap( - layout: "Finland", - backLayout: "fi", - variant: [ + keymap( + layout="Finland", + backend_layout="fi", + variant=[ "normal", "normal" "classic", @@ -329,18 +329,18 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "Faroe Islands", - backLayout: "fo", - variant: [ + keymap( + layout="Faroe Islands", + backend_layout="fo", + variant=[ "normal", "nodeadkeys", ], ), - Keymap( - layout: "France", - backLayout: "fr", - variant: [ + keymap( + layout="France", + backend_layout="fr", + variant=[ "normal", "afnor", "azerty", @@ -361,10 +361,10 @@ List keymaps = [ "us", ], ), - Keymap( - layout: "Great Britian", - backLayout: "gb", - variant: [ + keymap( + layout="Great Britian", + backend_layout="gb", + variant=[ "normal", "colemak", "colemak_dh", @@ -377,10 +377,10 @@ List keymaps = [ "pl", ], ), - Keymap( - layout: "Georgia", - backLayout: "ge", - variant: [ + keymap( + layout="Georgia", + backend_layout="ge", + variant=[ "normal", "ergonomic", "mess", @@ -388,10 +388,10 @@ List keymaps = [ "ru", ], ), - Keymap( - layout: "Ghana", - backLayout: "gh", - variant: [ + keymap( + layout="Ghana", + backend_layout="gh", + variant=[ "normal", "akan", "avn", @@ -403,18 +403,18 @@ List keymaps = [ "hausa", ], ), - Keymap( - layout: "Guinea", - backLayout: "gn", - variant: [ + keymap( + layout="Guinea", + backend_layout="gn", + variant=[ "normal", "", ], ), - Keymap( - layout: "Greece", - backLayout: "gr", - variant: [ + keymap( + layout="Greece", + backend_layout="gr", + variant=[ "normal", "extended", "nodeadkeys", @@ -422,10 +422,10 @@ List keymaps = [ "simple", ], ), - Keymap( - layout: "Croatia", - backLayout: "hr", - variant: [ + keymap( + layout="Croatia", + backend_layout="hr", + variant=[ "normal", "alternatequotes", "unicode", @@ -433,10 +433,10 @@ List keymaps = [ "us", ], ), - Keymap( - layout: "Hungary", - backLayout: "hu", - variant: [ + keymap( + layout="Hungary", + backend_layout="hu", + variant=[ "normal", "101_qwerty_comma_dead", "101_qwerty_comma_nodead", @@ -459,18 +459,18 @@ List keymaps = [ "standard", ], ), - Keymap( - layout: "Indonesia", - backLayout: "id", - variant: [ + keymap( + layout="Indonesia", + backend_layout="id", + variant=[ "normal", "phoneticx", ], ), - Keymap( - layout: "Ireland", - backLayout: "ie", - variant: [ + keymap( + layout="Ireland", + backend_layout="ie", + variant=[ "normal", "CloGaelach", "UnicodeExpert", @@ -478,20 +478,20 @@ List keymaps = [ "ogam_is434", ], ), - Keymap( - layout: "Israel", - backLayout: "il", - variant: [ + keymap( + layout="Israel", + backend_layout="il", + variant=[ "normal", "biblical", "lyx", "phonetic", ], ), - Keymap( - layout: "India", - backLayout: "in", - variant: [ + keymap( + layout="India", + backend_layout="in", + variant=[ "normal", "ben", "ben_baishakhi", @@ -533,10 +533,10 @@ List keymaps = [ "urd-winkeys", ], ), - Keymap( - layout: "Iraq", - backLayout: "iq", - variant: [ + keymap( + layout="Iraq", + backend_layout="iq", + variant=[ "normal", "ku", "ku_alt", @@ -544,10 +544,10 @@ List keymaps = [ "ku_f", ], ), - Keymap( - layout: "Iran", - backLayout: "ir", - variant: [ + keymap( + layout="Iran", + backend_layout="ir", + variant=[ "normal", "ku", "ku_alt", @@ -556,10 +556,10 @@ List keymaps = [ "pes_keypad", ], ), - Keymap( - layout: "Iceland", - backLayout: "is", - variant: [ + keymap( + layout="Iceland", + backend_layout="is", + variant=[ "normal", "ku", "ku_alt", @@ -568,10 +568,10 @@ List keymaps = [ "pes_keypad", ], ), - Keymap( - layout: "Italy", - backLayout: "it", - variant: [ + keymap( + layout="Italy", + backend_layout="it", + variant=[ "normal", "fur", "geo", @@ -584,10 +584,10 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "Japan", - backLayout: "jp", - variant: [ + keymap( + layout="Japan", + backend_layout="jp", + variant=[ "normal", "OADG109A", "dvorak", @@ -596,42 +596,42 @@ List keymaps = [ "mac", ], ), - Keymap( - layout: "Kenya", - backLayout: "ke", - variant: [ + keymap( + layout="Kenya", + backend_layout="ke", + variant=[ "normal", "kik", ], ), - Keymap( - layout: "Kyrgyzstan", - backLayout: "kg", - variant: [ + keymap( + layout="Kyrgyzstan", + backend_layout="kg", + variant=[ "normal", "phonetic", ], ), - Keymap( - layout: "Cambodia", - backLayout: "kh", - variant: [ + keymap( + layout="Cambodia", + backend_layout="kh", + variant=[ "normal", "", ], ), - Keymap( - layout: "The Republic of Korea", - backLayout: "kr", - variant: [ + keymap( + layout="The Republic of Korea", + backend_layout="kr", + variant=[ "normal", "kr104", ], ), - Keymap( - layout: "Kazakhstan", - backLayout: "kz", - variant: [ + keymap( + layout="Kazakhstan", + backend_layout="kz", + variant=[ "normal", "ext", "kazrus", @@ -639,28 +639,28 @@ List keymaps = [ "ruskaz", ], ), - Keymap( - layout: "Laos", - backLayout: "la", - variant: [ + keymap( + layout="Laos", + backend_layout="la", + variant=[ "normal", "stea", ], ), - Keymap( - layout: "Sri Lanka", - backLayout: "lk", - variant: [ + keymap( + layout="Sri Lanka", + backend_layout="lk", + variant=[ "normal", "tam_TAB", "tam_unicode", "us", ], ), - Keymap( - layout: "Lithuania", - backLayout: "lt", - variant: [ + keymap( + layout="Lithuania", + backend_layout="lt", + variant=[ "normal", "ibm", "lekp", @@ -671,10 +671,10 @@ List keymaps = [ "us", ], ), - Keymap( - layout: "Lativa", - backLayout: "lv", - variant: [ + keymap( + layout="Lativa", + backend_layout="lv", + variant=[ "normal", "adapted", "apostrophe", @@ -684,10 +684,10 @@ List keymaps = [ "tilde", ], ), - Keymap( - layout: "Morocco", - backLayout: "ma", - variant: [ + keymap( + layout="Morocco", + backend_layout="ma", + variant=[ "normal", "french", "tifinagh", @@ -698,18 +698,18 @@ List keymaps = [ "tifinagh-phonetic", ], ), - Keymap( - layout: "Moldova", - backLayout: "md", - variant: [ + keymap( + layout="Moldova", + backend_layout="md", + variant=[ "normal", "gag", ], ), - Keymap( - layout: "Montenegro", - backLayout: "me", - variant: [ + keymap( + layout="Montenegro", + backend_layout="me", + variant=[ "normal", "cyrillic", "cyrillicalternatequotes", @@ -720,90 +720,90 @@ List keymaps = [ "latinyz", ], ), - Keymap( - layout: "Republic of North Macedonia", - backLayout: "mk", - variant: [ + keymap( + layout="Republic of North Macedonia", + backend_layout="mk", + variant=[ "normal", "nodeadkeys", ], ), - Keymap( - layout: "Mali", - backLayout: "ml", - variant: [ + keymap( + layout="Mali", + backend_layout="ml", + variant=[ "normal", "fr-oss", "us-intl", "us-mac", ], ), - Keymap( - layout: "Myanmar", - backLayout: "mm", - variant: [ + keymap( + layout="Myanmar", + backend_layout="mm", + variant=[ "normal", "zawgyi", ], ), - Keymap( - layout: "Mongolia", - backLayout: "mn", - variant: [ + keymap( + layout="Mongolia", + backend_layout="mn", + variant=[ "normal", "", ], ), - Keymap( - layout: "Malta", - backLayout: "mt", - variant: [ + keymap( + layout="Malta", + backend_layout="mt", + variant=[ "normal", "alt-gb", "alt-us", "us", ], ), - Keymap( - layout: "Maldives", - backLayout: "mv", - variant: [ + keymap( + layout="Maldives", + backend_layout="mv", + variant=[ "normal", "", ], ), - Keymap( - layout: "Malaysia", - backLayout: "my", - variant: [ + keymap( + layout="Malaysia", + backend_layout="my", + variant=[ "normal", "phonetic", ], ), - Keymap( - layout: "Nigeria", - backLayout: "ng", - variant: [ + keymap( + layout="Nigeria", + backend_layout="ng", + variant=[ "normal", "hausa", "igbo", "yoruba", ], ), - Keymap( - layout: "Netherlands", - backLayout: "nl", - variant: [ + keymap( + layout="Netherlands", + backend_layout="nl", + variant=[ "normal", "mac", "std", "us", ], ), - Keymap( - layout: "Norway", - backLayout: "no", - variant: [ + keymap( + layout="Norway", + backend_layout="no", + variant=[ "normal", "colemak", "dvorak", @@ -815,18 +815,18 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "Nepal", - backLayout: "np", - variant: [ + keymap( + layout="Nepal", + backend_layout="np", + variant=[ "normal", "", ], ), - Keymap( - layout: "Philippines", - backLayout: "ph", - variant: [ + keymap( + layout="Philippines", + backend_layout="ph", + variant=[ "normal", "capewell-dvorak", "capewell-dvorak-bay", @@ -839,10 +839,10 @@ List keymaps = [ "qwerty-bay", ], ), - Keymap( - layout: "Pakistan", - backLayout: "pk", - variant: [ + keymap( + layout="Pakistan", + backend_layout="pk", + variant=[ "normal", "ara", "snd", @@ -850,10 +850,10 @@ List keymaps = [ "urd-nla", ], ), - Keymap( - layout: "Poland", - backLayout: "pl", - variant: [ + keymap( + layout="Poland", + backend_layout="pl", + variant=[ "normal", "csb", "dvorak", @@ -866,10 +866,10 @@ List keymaps = [ "szl", ], ), - Keymap( - layout: "Portugal", - backLayout: "pt", - variant: [ + keymap( + layout="Portugal", + backend_layout="pt", + variant=[ "normal", "mac", "mac_nodeadkeys", @@ -879,19 +879,19 @@ List keymaps = [ "nodeadkeys", ], ), - Keymap( - layout: "Romania", - backLayout: "ro", - variant: [ + keymap( + layout="Romania", + backend_layout="ro", + variant=[ "normal", "std", "winkeys", ], ), - Keymap( - layout: "Serbia", - backLayout: "rs", - variant: [ + keymap( + layout="Serbia", + backend_layout="rs", + variant=[ "normal", "alternatequotes", "latin", @@ -903,10 +903,10 @@ List keymaps = [ "yz", ], ), - Keymap( - layout: "Russia", - backLayout: "ru", - variant: [ + keymap( + layout="Russia", + backend_layout="ru", + variant=[ "normal", "bak", "chm", @@ -933,10 +933,10 @@ List keymaps = [ "xal", ], ), - Keymap( - layout: "Sweden", - backLayout: "se", - variant: [ + keymap( + layout="Sweden", + backend_layout="se", + variant=[ "normal", "dvorak", "mac", @@ -950,45 +950,45 @@ List keymaps = [ "us_dvorak", ], ), - Keymap( - layout: "Slovenia", - backLayout: "si", - variant: [ + keymap( + layout="Slovenia", + backend_layout="si", + variant=[ "normal", "alternatequotes", "us", ], ), - Keymap( - layout: "Slovakia", - backLayout: "sk", - variant: [ + keymap( + layout="Slovakia", + backend_layout="sk", + variant=[ "normal", "bksl", "qwerty", "qwerty_bksl", ], ), - Keymap( - layout: "Senegal", - backLayout: "sn", - variant: [ + keymap( + layout="Senegal", + backend_layout="sn", + variant=[ "normal", "", ], ), - Keymap( - layout: "Sierra Leone", - backLayout: "sl", - variant: [ + keymap( + layout="Sierra Leone", + backend_layout="sl", + variant=[ "normal", "", ], ), - Keymap( - layout: "Syria", - backLayout: "sy", - variant: [ + keymap( + layout="Syria", + backend_layout="sy", + variant=[ "normal", "ku", "ku_alt", @@ -997,43 +997,43 @@ List keymaps = [ "syc_phonetic", ], ), - Keymap( - layout: "Togo", - backLayout: "tg", - variant: [ + keymap( + layout="Togo", + backend_layout="tg", + variant=[ "normal", "", ], ), - Keymap( - layout: "Thailand", - backLayout: "th", - variant: [ + keymap( + layout="Thailand", + backend_layout="th", + variant=[ "normal", "pat", "tis", ], ), - Keymap( - layout: "Tajikistan", - backLayout: "tj", - variant: [ + keymap( + layout="Tajikistan", + backend_layout="tj", + variant=[ "normal", "legacy", ], ), - Keymap( - layout: "Turkmenistan", - backLayout: "tm", - variant: [ + keymap( + layout="Turkmenistan", + backend_layout="tm", + variant=[ "normal", "alt", ], ), - Keymap( - layout: "Turkey", - backLayout: "tr", - variant: [ + keymap( + layout="Turkey", + backend_layout="tr", + variant=[ "normal", "alt", "crh", @@ -1050,27 +1050,27 @@ List keymaps = [ "otkf", ], ), - Keymap( - layout: "Taiwan", - backLayout: "tw", - variant: [ + keymap( + layout="Taiwan", + backend_layout="tw", + variant=[ "normal", "indigenous", "saisiyat", ], ), - Keymap( - layout: "Tanzania", - backLayout: "tz", - variant: [ + keymap( + layout="Tanzania", + backend_layout="tz", + variant=[ "normal", "", ], ), - Keymap( - layout: "Ukraine", - backLayout: "ua", - variant: [ + keymap( + layout="Ukraine", + backend_layout="ua", + variant=[ "normal", "homophonic", "legacy", @@ -1081,10 +1081,10 @@ List keymaps = [ "winkeys", ], ), - Keymap( - layout: "United States of America", - backLayout: "us", - variant: [ + keymap( + layout="United States of America", + backend_layout="us", + variant=[ "normal", "alt-intl", "altgr-intl", @@ -1113,29 +1113,30 @@ List keymaps = [ "workman-intl", ], ), - Keymap( - layout: "Uzbekistan", - backLayout: "uz", - variant: [ + keymap( + layout="Uzbekistan", + backend_layout="uz", + variant=[ "normal", "latin", ], ), - Keymap( - layout: "Vietnam", - backLayout: "vn", - variant: [ + keymap( + layout="Vietnam", + backend_layout="vn", + variant=[ "normal", "fr", "us", ], ), - Keymap( - layout: "South Africa", - backLayout: "za", - variant: [ + keymap( + layout="South Africa", + backend_layout="za", + variant=[ "normal", "", ], ) -]; +] + diff --git a/src/locales/__init__.py b/src/locales/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/africa.py b/src/locales/africa.py new file mode 100644 index 0000000..81479af --- /dev/null +++ b/src/locales/africa.py @@ -0,0 +1,270 @@ +from jade_gui.classes.locale import locale + +africa = [ + locale( + region="Africa", + location="Abidjan", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Accra", + locales="en_GH.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Addis_Ababa", + locales="en_ET.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Algiers", + locales="ar_DZ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Asmara", + locales="en_ER.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Bamako", + locales="fr_ML.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Bangui", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Banjul", + locales="en_GM.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Bissau", + locales="pt_GW.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Blantyre", + locales="en_MW.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Brazzaville", + locales="fr_CD.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Bujumbura", + locales="fr_BI.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Cairo", + locales="ar_EG.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Casablanca", + locales="ar_MA.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Ceuta", + locales="es_ES.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Conakry", + locales="fr_GN.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Dakar", + locales="fr_SN.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Dar_es_Salaam", + locales="en_TZ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Djibouti", + locales="fr_DJ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Douala", + locales="fr_CM.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="El_Aaiun", + locales="ar_EH.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Freetown", + locales="en_SL.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Gaborone", + locales="en_BW.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Harare", + locales="en_ZW.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Johannesburg", + locales="en_ZA.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Juba", + locales="en_SS.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Kampala", + locales="en_UG.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Khartoum", + locales="", + ), + locale( + region="Africa", + location="Kigali", + locales="en_RW.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Kinshasa", + locales="fr_CD.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Lagos", + locales="en_NG.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Libreville", + locales="fr_GA.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Lome", + locales="fr_TG.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Luanda", + locales="pt_AO.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Lubumbashi", + locales="fr_CD.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Lusaka", + locales="en_ZM.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Malabo", + locales="fr_GQ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Maputo", + locales="en_MZ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Maseru", + locales="en_LS.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Mbabane", + locales="en_SZ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Mogadishu", + locales="en_SO.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Monrovia", + locales="en_LR.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Nairobi", + locales="en_KE.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Ndjamena", + locales="fr_TD.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Niamey", + locales="fr_NE.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Nouakchott", + locales="ar_MR.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Ouagadougou", + locales="fr_BF.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Porto-Novo", + locales="fr_BJ.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Sao_Tome", + locales="pt_ST.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Timbuktu", + locales="fr_ML.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Tripoli", + locales="ar_LY.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Tunis", + locales="fr_TN.UTF-8 UTF-8", + ), + locale( + region="Africa", + location="Windhoek", + locales="en_NA.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/america.py b/src/locales/america.py new file mode 100644 index 0000000..dadb063 --- /dev/null +++ b/src/locales/america.py @@ -0,0 +1,785 @@ +from jade_gui.classes.locale import locale + +america = [ + locale( + region="America", + location="Adak", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Anchorage", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Antigua", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Araguaina", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Buenos_Aires", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Catamarca", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/ComodRivadavia", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Cordoba", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Jujuy", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/La_Rioja", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Mendoza", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Rio_Gallegos", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Salta", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/San_Juan", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/San_Luis", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Tucuman", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Argentina/Ushuaia", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Aruba", + locales="nl_NL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Asuncion", + locales="es_PY.UTF-8 UTF-8", + ), + locale( + region="America", + location="Atikokan", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Atka", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Bahia", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Bahia_Banderas", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Barbados", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="America", + location="Belem", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Belize", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Blanc-Sablon", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Boa_Vista", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Bogota", + locales="es_CO.UTF-8 UTF-8", + ), + locale( + region="America", + location="Boise", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Buenos_Aires", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cambridge_Bay", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Campo_Grande", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cancun", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Caracas", + locales="es_VE.UTF-8 UTF-8", + ), + locale( + region="America", + location="Catamarca", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cayenne", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cayman", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="America", + location="Chicago", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Chihuahua", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Coral_Harbour", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cordoba", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Costa_Rica", + locales="es_ES.UTF-8 UTF-8", + ), + locale( + region="America", + location="Creston", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Cuiaba", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Curacao", + locales="nl_NL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Danmarkshavn", + locales="da_DK.UTF-8 UTF-8", + ), + locale( + region="America", + location="Dawson", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Dawson_Creek", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Denver", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Detroit", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Dominica", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="America", + location="Edmonton", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Eirunepe", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="El_Salvador", + locales="es_SV.UTF-8 UTF-8", + ), + locale( + region="America", + location="Ensenada", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Fort_Nelson", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Fort_Wayne", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Fortaleza", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Glace_Bay", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Godthab", + locales="da_DK.UTF-8 UTF-8", + ), + locale( + region="America", + location="Goose_Bay", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Grand_Turk", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Grenada", + locales="en_GD.UTF-8 UTF-8", + ), + locale( + region="America", + location="Guadeloupe", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Guatemala", + locales="es_GT.UTF-8 UTF-8", + ), + locale( + region="America", + location="Guayaquil", + locales="es_EC.UTF-8 UTF-8", + ), + locale( + region="America", + location="Guyana", + locales="en_GY.UTF-8 UTF-8", + ), + locale( + region="America", + location="Halifax", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Havana", + locales="es_CU.UTF-8 UTF-8", + ), + locale( + region="America", + location="Hermosillo", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Indianapolis", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Inuvik", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Iqaluit", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Jamaica", + locales="en_JM.UTF-8 UTF-8", + ), + locale( + region="America", + location="Jujuy", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Juneau", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Kentucky/Louisville", + locales="en_US.UTF.8 UTF-8" + ), + locale( + region="America", + location="Knox_IN", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Kralendijk", + locales="nl_NL.UTF-8 UTF-8", + ), + locale( + region="America", + location="La_Paz", + locales="es_BO.UTF-8 UTF-8", + ), + locale( + region="America", + location="Lima", + locales="es_PE.UTF-8 UTF-8", + ), + locale( + region="America", + location="Los_Angeles", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Lower_Princes", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Maceio", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Managua", + locales="es_NI.UTF-8 UTF-8", + ), + locale( + region="America", + location="Manaus", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Marigot", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Martinique", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Matamoros", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Mazatlan", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Mendoza", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Menominee", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Merida", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Metlakatla", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Mexico_City", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Miquelon", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Moncton", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Monterrey", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Montevideo", + locales="es_UY.UTF-8 UTF-8", + ), + locale( + region="America", + location="Montreal", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Montserrat", + locales="en_MS.UTF-8 UTF-8", + ), + locale( + region="America", + location="Nassau", + locales="en_BS.UTF-8 UTF-8", + ), + locale( + region="America", + location="New_York", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Nipigon", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Nome", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Noronha", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="North_Dakota/Beulah", + locales="en_US.UTF-8 UTF-8" + ), + locale( + region="America", + location="North_Dakota/Center", + locales="en_US.UTF-8 UTF-8" + ), + locale( + region="America", + location="North_Dakota/New_Salem", + locales="en_US.UTF-8 UTF-8" + ), + locale( + region="America", + location="Nuuk", + locales="en_GL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Ojinaga", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Panama", + locales="es_PA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Pangnirtung", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Paramaribo", + locales="nl_SR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Phoenix", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Port-au-Prince", + locales="fr_HT.UTF-8 UTF-8", + ), + locale( + region="America", + location="Porto_Acre", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Port_of_Spain", + locales="en_TT.UTF-8 UTF-8", + ), + locale( + region="America", + location="Porto_Velho", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Puerto_Rico", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Punta_Arenas", + locales="es_CL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Rainy_River", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Rankin_Inlet", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Recife", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Regina", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Resolute", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Rio_Branco", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Rosario", + locales="es_AR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Santa_Isabel", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Santarem", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Santiago", + locales="es_CL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Santo_Domingo", + locales="es_DO.UTF-8 UTF-8", + ), + locale( + region="America", + location="Sao_Paulo", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="America", + location="Scoresbysund", + locales="da_DK.UTF-8 UTF-8", + ), + locale( + region="America", + location="Shiprock", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Sitka", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Barthelemy", + locales="fr_BL.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Johns", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Kitts", + locales="en_KN.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Lucia", + locales="en_LC.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Thomas", + locales="en_VI.UTF-8 UTF-8", + ), + locale( + region="America", + location="St_Vincent", + locales="en_VC.UTF-8 UTF-8", + ), + locale( + region="America", + location="Swift_Current", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Tegucigalpa", + locales="es_HN.UTF-8 UTF-8", + ), + locale( + region="America", + location="Thule", + locales="en_GL.UTF-8 UTF-8", + ), + locale( + region="America", + location="Thunder_Bay", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Tijuana", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="America", + location="Toronto", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Tortola", + locales="en_VG.UTF-8 UTF-8", + ), + locale( + region="America", + location="Vancouver", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Virgin", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Whitehorse", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Winnipeg", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="America", + location="Yakutat", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="America", + location="Yellowknife", + locales="en_CA.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/antarctica.py b/src/locales/antarctica.py new file mode 100644 index 0000000..3422208 --- /dev/null +++ b/src/locales/antarctica.py @@ -0,0 +1,65 @@ +from jade_gui.classes.locale import locale + +antarctica = [ + locale( + region="Antarctica", + location="Casey", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Davis", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="DumontDurville", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Macquarie", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Mawson", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="McMurdo", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Palmer", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Rothera", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="South_Pole", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Syowa", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Troll", + locales="en_AQ.UTF-8 UTF-8", + ), + locale( + region="Antarctica", + location="Vostok", + locales="en_AQ.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/arctic.py b/src/locales/arctic.py new file mode 100644 index 0000000..32af14c --- /dev/null +++ b/src/locales/arctic.py @@ -0,0 +1,10 @@ +from jade_gui.classes.locale import locale + +arctic = [ + locale( + region="Arctic", + location="Longyearbyen", + locales="no_NO.UTF-8 UTF-8", + ) +] + diff --git a/src/locales/asia.py b/src/locales/asia.py new file mode 100644 index 0000000..44b20fa --- /dev/null +++ b/src/locales/asia.py @@ -0,0 +1,495 @@ +from jade_gui.classes.locale import locale + +asia = [ + locale( + region="Asia", + location="Aden", + locales="ar_SA.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Almaty", + locales="kk_KZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Amman", + locales="ar_JO.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Anadyr", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Aqtau", + locales="kk_KZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Aqtobe", + locales="kk_KZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ashgabat", + locales="tk_TM.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ashkhabad", + locales="tk_TM.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Atyrau", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Baghdad", + locales="ar_IQ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Bahrain", + locales="ar_BH.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Baku", + locales="az_AZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Bangkok", + locales="th_TH.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Barnaul", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Beirut", + locales="ar_LB.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Bishkek", + locales="ky_KG.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Brunei", + locales="ms_BN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Chita", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Choibalsan", + locales="mn_MN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Chongqing", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Chungking", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Colombo", + locales="si_LK.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Dacca", + locales="bn_BD.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Damascus", + locales="ar_SY.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Dhaka", + locales="bn_BD.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Dili", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Dubai", + locales="ar_AE.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Dushanbe", + locales="tg_TJ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Famagusta", + locales="tr_TR.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Gaza", + locales="ar_PS.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Harbin", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Hebron", + locales="ar_PS.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ho_Chi_Minh", + locales="vi_VN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Hong_Kong", + locales="zh_HK.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Hovd", + locales="mn_MN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Irkutsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Istanbul", + locales="tr_TR.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Jakarta", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Jayapura", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Jerusalem", + locales="he_IL.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kabul", + locales="fa_AF.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kamchatka", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Karachi", + locales="ur_PK.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kashgar", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kathmandu", + locales="ne_NP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Katmandu", + locales="ne_NP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Khandyga", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kolkata", + locales="hi_IN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Krasnoyarsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kuala_Lumpur", + locales="ms_MY.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kuching", + locales="ms_MY.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Kuwait", + locales="ar_KW.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Macao", + locales="zh_MO.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Macau", + locales="zh_MO.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Magadan", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Makassar", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Manila", + locales="tl_PH.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Muscat", + locales="ar_OM.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Nicosia", + locales="el_CY.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Novokuznetsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Novosibirsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Omsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Oral", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Phnom_Penh", + locales="kh_KH.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Pontianak", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Pyongyang", + locales="ko_KP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Qatar", + locales="ar_QA.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Qostanay", + locales="kk_KZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Qyzylorda", + locales="kk_KZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Rangoon", + locales="my_MM.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Riyadh", + locales="ar_SA.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Saigon", + locales="vi_VN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Sakhalin", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Samarkand", + locales="uz_UZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Seoul", + locales="ko_KR.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Shanghai", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Singapore", + locales="en_SG.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Srednekolymsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Taipei", + locales="zh_TW.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tashkent", + locales="uz_UZ.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tbilisi", + locales="ka_GE.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tehran", + locales="fa_IR.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tel_Aviv", + locales="he_IL.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Thimbu", + locales="ne_NP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Thimphu", + locales="ne_NP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tokyo", + locales="ja_JP.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Tomsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ujung_Pandang", + locales="id_ID.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ulaanbaatar", + locales="mn_MN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ulan_Bator", + locales="mn_MN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Urumqi", + locales="zh_CN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Ust-Nera", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Vientiane", + locales="vi_VN.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Vladivostok", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Yakutsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Yangon", + locales="my_MM.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Yekaterinburg", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Asia", + location="Yerevan", + locales="hy_AM.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/atlantic.py b/src/locales/atlantic.py new file mode 100644 index 0000000..e2a726a --- /dev/null +++ b/src/locales/atlantic.py @@ -0,0 +1,65 @@ +from jade_gui.classes.locale import locale + +atlantic = [ + locale( + region="atlantic", + location="Azores", + locales="pt_PT.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Bermuda", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Canary", + locales="es_ES.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Cape_Verde", + locales="pt_PT.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Faeroe", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Faroe", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Jan_Mayen", + locales="nb_NO.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Madeira", + locales="pt_PT.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Reykjavik", + locales="is_IS.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="South_Georgia", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="Stanley", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="atlantic", + location="St_Helena", + locales="en_GB.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/australia.py b/src/locales/australia.py new file mode 100644 index 0000000..809cb9d --- /dev/null +++ b/src/locales/australia.py @@ -0,0 +1,90 @@ +from jade_gui.classes.locale import locale + +australia = [ + locale( + region="Australia", + location="Adelaide", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Brisbane", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Broken_Hill", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Canberra", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Currie", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Darwin", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Eucla", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Hobart", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Lindeman", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Lord_Howe", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Melbourne", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Perth", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Queensland", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Sydney", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Tasmania", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Victoria", + locales="en_AU.UTF-8 UTF-8", + ), + locale( + region="Australia", + location="Yancowinna", + locales="en_AU.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/brazil.py b/src/locales/brazil.py new file mode 100644 index 0000000..a45308b --- /dev/null +++ b/src/locales/brazil.py @@ -0,0 +1,15 @@ +from jade_gui.classes.locale import locale + +brazil = [ + locale( + region="Brazil", + location="Acre", + locales="pt_BR.UTF-8 UTF-8", + ), + locale( + region="Brazil", + location="DeNoronha", + locales="pt_BR.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/canada.py b/src/locales/canada.py new file mode 100644 index 0000000..a7f07e7 --- /dev/null +++ b/src/locales/canada.py @@ -0,0 +1,40 @@ +from jade_gui.classes.locale import locale + +canada = [ + locale( + region="canada", + location="Atlantic", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Central", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Eastern", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Mountain", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Newfoundland", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Pacific", + locales="en_CA.UTF-8 UTF-8", + ), + locale( + region="canada", + location="Yukon", + locales="en_CA.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/chile.py b/src/locales/chile.py new file mode 100644 index 0000000..cddc01b --- /dev/null +++ b/src/locales/chile.py @@ -0,0 +1,15 @@ +from jade_gui.classes.locale import locale + +chile = [ + locale( + region="Chile", + location="Continental", + locales="es_CL.UTF-8 UTF-8", + ), + locale( + region="Chile", + location="EasterIsland", + locales="es_CL.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/europe.py b/src/locales/europe.py new file mode 100644 index 0000000..66e5786 --- /dev/null +++ b/src/locales/europe.py @@ -0,0 +1,315 @@ +from jade_gui.classes.locale import locale + +europe = [ + locale( + region="Europe", + location="Amsterdam", + locales="nl_NL.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Andorra", + locales="ca_ES.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Athens", + locales="el_GR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Belfast", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Belgrade", + locales="sr_RS.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Berlin", + locales="de_DE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Bratislava", + locales="sk_SK.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Brussels", + locales="nl_BE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Bucharest", + locales="ro_RO.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Budapest", + locales="hu_HU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Busingen", + locales="de_DE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Chisinau", + locales="ro_RO.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Copenhagen", + locales="da_DK.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Dublin", + locales="en_IE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Gibraltar", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Guernsey", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Helsinki", + locales="fi_FI.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Isle_of_Man", + locales="en_IM.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Istanbul", + locales="tr_TR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Jersey", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Kaliningrad", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Kiev", + locales="uk_UA.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Kirov", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Lisbon", + locales="pt_PT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Ljubljana", + locales="sl_SI.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="London", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Luxembourg", + locales="fr_LU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Madrid", + locales="es_ES.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Malta", + locales="en_GB.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Mariehamn", + locales="sv_SE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Minsk", + locales="be_BY.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Monaco", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Moscow", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Nicosia", + locales="el_GR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Oslo", + locales="no_NO.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Paris", + locales="fr_FR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Podgorica", + locales="sr_RS.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Prague", + locales="cs_CZ.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Riga", + locales="lv_LV.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Rome", + locales="it_IT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Samara", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="San_Marino", + locales="it_IT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Sarajevo", + locales="bs_BA.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Saratov", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Simferopol", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Skopje", + locales="mk_MK.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Sofia", + locales="bg_BG.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Stockholm", + locales="sv_SE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Tallinn", + locales="et_EE.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Tirane", + locales="sq_AL.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Tiraspol", + locales="ro_RO.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Ulyanovsk", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Uzhgorod", + locales="uk_UA.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Vaduz", + locales="de_AT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Vatican", + locales="it_IT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Vienna", + locales="de_AT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Vilnius", + locales="lt_LT.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Volgograd", + locales="ru_RU.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Warsaw", + locales="pl_PL.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Zagreb", + locales="hr_HR.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Zaporozhye", + locales="uk_UA.UTF-8 UTF-8", + ), + locale( + region="Europe", + location="Zurich", + locales="de_CH.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/indian.py b/src/locales/indian.py new file mode 100644 index 0000000..f30c66e --- /dev/null +++ b/src/locales/indian.py @@ -0,0 +1,60 @@ +from jade_gui.classes.locale import locale + +indian = [ + locale( + region="Indian", + location="Antananarivo", + locales="fr_MG.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Chagos", + locales="en_IO.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Christmas", + locales="en_CX.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Cocos", + locales="en_CC.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Comoro", + locales="fr_KM.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Kerguelen", + locales="fr_TF.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Mahe", + locales="en_SC.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Maldives", + locales="en_MV.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Mauritius", + locales="en_MU.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Mayotte", + locales="fr_YT.UTF-8 UTF-8", + ), + locale( + region="Indian", + location="Reunion", + locales="fr_RE.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/locales_list.py b/src/locales/locales_list.py new file mode 100644 index 0000000..1b21e1d --- /dev/null +++ b/src/locales/locales_list.py @@ -0,0 +1,50 @@ +# locales.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from jade_gui.locales.africa import africa +from jade_gui.locales.america import america +from jade_gui.locales.antarctica import antarctica +from jade_gui.locales.arctic import arctic +from jade_gui.locales.asia import asia +from jade_gui.locales.atlantic import atlantic +from jade_gui.locales.australia import australia +from jade_gui.locales.brazil import brazil +from jade_gui.locales.canada import canada +from jade_gui.locales.chile import chile +from jade_gui.locales.europe import europe +from jade_gui.locales.indian import indian +from jade_gui.locales.mexico import mexico +from jade_gui.locales.pacific import pacific + +locations = [ + africa, + america, + antarctica, + arctic, + asia, + atlantic, + australia, + brazil, + canada, + chile, + europe, + indian, + mexico, + pacific +] diff --git a/src/locales/meson.build b/src/locales/meson.build new file mode 100644 index 0000000..d7d9d40 --- /dev/null +++ b/src/locales/meson.build @@ -0,0 +1,22 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +localesdir = join_paths(pkgdatadir, 'jade_gui/locales') + +jade_gui_sources = [ + '__init__.py', + 'africa.py', + 'america.py', + 'antarctica.py', + 'arctic.py', + 'asia.py', + 'atlantic.py', + 'australia.py', + 'brazil.py', + 'canada.py', + 'chile.py', + 'europe.py', + 'indian.py', + 'mexico.py', + 'pacific.py', + 'locales_list.py', +] +install_data(jade_gui_sources, install_dir: localesdir) \ No newline at end of file diff --git a/src/locales/mexico.py b/src/locales/mexico.py new file mode 100644 index 0000000..771eead --- /dev/null +++ b/src/locales/mexico.py @@ -0,0 +1,20 @@ +from jade_gui.classes.locale import locale + +mexico = [ + locale( + region="Mexico", + location="BajaNorte", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="Mexico", + location="BajaSur", + locales="es_MX.UTF-8 UTF-8", + ), + locale( + region="Mexico", + location="General", + locales="es_MX.UTF-8 UTF-8", + ), +] + diff --git a/src/locales/pacific.py b/src/locales/pacific.py new file mode 100644 index 0000000..c11355d --- /dev/null +++ b/src/locales/pacific.py @@ -0,0 +1,220 @@ +from jade_gui.classes.locale import locale + +pacific = [ + locale( + region="Pacific", + location="Apia", + locales="en_WS.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Auckland", + locales="en_NZ.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Bougainville", + locales="en_PG.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Chatham", + locales="en_NZ.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Chuuk", + locales="en_FM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Easter", + locales="en_CL.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Efate", + locales="en_VU.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Enderbury", + locales="en_KI.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Fakaofo", + locales="en_TK.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Fiji", + locales="en_FJ.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Funafuti", + locales="en_TV.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Galapagos", + locales="en_EC.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Gambier", + locales="en_PF.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Guadalcanal", + locales="en_SB.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Guam", + locales="en_GU.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Honolulu", + locales="en_US.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Johnston", + locales="en_UM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Kiritimati", + locales="en_KI.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Kosrae", + locales="en_FM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Kwajalein", + locales="en_MH.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Majuro", + locales="en_MH.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Marquesas", + locales="en_PF.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Midway", + locales="en_UM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Nauru", + locales="en_NR.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Niue", + locales="en_NU.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Norfolk", + locales="en_NF.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Noumea", + locales="en_NC.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Pago_Pago", + locales="en_AS.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Palau", + locales="en_PW.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Pitcairn", + locales="en_PN.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Pohnpei", + locales="en_FM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Ponape", + locales="en_FM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Port_Moresby", + locales="en_PG.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Rarotonga", + locales="en_CK.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Saipan", + locales="en_MP.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Samoa", + locales="en_AS.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Tahiti", + locales="en_PF.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Tarawa", + locales="en_KI.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Tongatapu", + locales="en_TO.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Truk", + locales="en_FM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Wake", + locales="en_UM.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Wallis", + locales="en_WF.UTF-8 UTF-8", + ), + locale( + region="Pacific", + location="Yap", + locales="en_FM.UTF-8 UTF-8", + ), +] + diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..3c6ee7e --- /dev/null +++ b/src/main.py @@ -0,0 +1,83 @@ +# main.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +import sys +import gi + +gi.require_version('Gtk', '4.0') +gi.require_version('Adw', '1') + +from gi.repository import Gtk, Gio, Adw +from .window import JadeGuiWindow, AboutDialog + + +class Jade_guiApplication(Adw.Application): + """The main application singleton class.""" + + + def __init__(self): + super().__init__(application_id='al.getcryst.jadegui', + flags=Gio.ApplicationFlags.FLAGS_NONE) + self.create_action('quit', self.quit, ['q']) + self.create_action('about', self.on_about_action) + self.create_action('preferences', self.on_preferences_action) + + def testResize(self, idk): + self.window.resize(800, 600) + + def do_activate(self): + """Called when the application is activated. + + We raise the application's main window, creating it if + necessary. + """ + win = self.props.active_window + if not win: + win = JadeGuiWindow(application=self) + win.present() + + def on_about_action(self, widget, _): + """Callback for the app.about action.""" + about = AboutDialog(self.props.active_window) + about.present() + + def on_preferences_action(self, widget, _): + """Callback for the app.preferences action.""" + print('app.preferences action activated') + + def create_action(self, name, callback, shortcuts=None): + """Add an application action. + + Args: + name: the name of the action + callback: the function to be called when the action is + activated + shortcuts: an optional list of accelerators + """ + action = Gio.SimpleAction.new(name, None) + action.connect("activate", callback) + self.add_action(action) + if shortcuts: + self.set_accels_for_action(f"app.{name}", shortcuts) + + +def main(version): + """The application's entry point.""" + app = Jade_guiApplication() + return app.run(sys.argv) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..00156aa --- /dev/null +++ b/src/meson.build @@ -0,0 +1,77 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +moduledir = join_paths(pkgdatadir, 'jade_gui') +gnome = import('gnome') + +blueprints = custom_target('blueprints', + input: files( + 'gtk/help-overlay.blp', + 'window.blp', + 'widgets/timezone.blp', + 'widgets/layout.blp', + 'widgets/variant.blp', + 'widgets/desktop.blp', + 'widgets/disk.blp', + 'pages/keyboard_screen.blp', + 'pages/timezone_screen.blp', + 'pages/user_screen.blp', + 'pages/desktop_screen.blp', + 'pages/misc_screen.blp', + 'pages/partition_screen.blp', + 'pages/summary_screen.blp', + 'pages/install_screen.blp', + 'pages/finished_screen.blp', + ), + output: '.', + command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], +) + + + +gnome.compile_resources('jade_gui_resources', + 'resources.gresource.xml', + gresource_bundle: true, + install: true, + install_dir: pkgdatadir, +) + + +gnome.compile_resources('jade_gui', + 'jade_gui.gresource.xml', + dependencies: blueprints, + gresource_bundle: true, + install: true, + install_dir: pkgdatadir, +) + +python = import('python') + +conf = configuration_data() +conf.set('PYTHON', python.find_installation('python3').full_path()) +conf.set('VERSION', meson.project_version()) +conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) +conf.set('pkgdatadir', pkgdatadir) + +configure_file( + input: 'jade_gui.in', + output: 'jade_gui', + configuration: conf, + install: true, + install_dir: get_option('bindir') +) + +subdir('widgets') +subdir('functions') +subdir('classes') +subdir('locales') +subdir('utils') +subdir('scripts') + +jade_gui_sources = [ + '__init__.py', + 'main.py', + 'window.py', + 'keymaps.py', + 'desktops.py', +] + +install_data(jade_gui_sources, install_dir: moduledir) diff --git a/src/pages/desktop_screen.blp b/src/pages/desktop_screen.blp new file mode 100644 index 0000000..f88f15c --- /dev/null +++ b/src/pages/desktop_screen.blp @@ -0,0 +1,36 @@ +using Gtk 4.0; +using Adw 1; + +template DesktopScreen : Adw.Bin { + vexpand: true; + hexpand: true; + Gtk.Box { + vexpand: true; + hexpand: true; + Adw.StatusPage { + title: "Select a desktop"; + description: "You can install more desktops later"; + Adw.PreferencesPage { + Adw. PreferencesGroup { + Gtk.ListBox list_desktops { + hexpand: true; + vexpand: true; + styles ["boxed-list"] + } + } + } + } + Gtk.Overlay { + [overlay] + Gtk.Button next_page_button { + margin-end: 20; + margin-bottom: 20; + label: "Next"; + halign: end; + valign: end; + tooltip-text: "Move to next page"; + styles ["suggested-action"] + } + } + } +} \ No newline at end of file diff --git a/src/pages/finished_screen.blp b/src/pages/finished_screen.blp new file mode 100644 index 0000000..0447bf2 --- /dev/null +++ b/src/pages/finished_screen.blp @@ -0,0 +1,31 @@ +using Gtk 4.0; +using Adw 1; + +template FinishedScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Installation finished!"; + description: "Reboot to finish the installation"; + icon-name: "al.getcryst.jadegui"; + Gtk.Box { + orientation: horizontal; + halign: center; + valign: center; + vexpand: true; + hexpand: true; + + Gtk.Button next_button { + margin-start: 12; + label: "Reboot"; + styles ["suggested-action", "pill"] + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/install_screen.blp b/src/pages/install_screen.blp new file mode 100644 index 0000000..167dd51 --- /dev/null +++ b/src/pages/install_screen.blp @@ -0,0 +1,37 @@ +using Gtk 4.0; +using Adw 1; + +template InstallScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Installing Crystal"; + description: "This may take some time"; + Gtk.Box { + margin-end: 50; + margin-start: 50; + styles ["card"] + Gtk.ScrolledWindow { + margin-start: 12; + margin-end: 12; + min-content-height: 200; + overflow: hidden; + Gtk.Label log_text { + hexpand: true; + vexpand: true; + wrap: true; + selectable: true; + xalign: 0; + yalign: 0; + styles ["monospace", "terminal"] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/keyboard_screen.blp b/src/pages/keyboard_screen.blp new file mode 100644 index 0000000..ede92dc --- /dev/null +++ b/src/pages/keyboard_screen.blp @@ -0,0 +1,63 @@ +using Gtk 4.0; +using Adw 1; + +template KeyboardScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + vexpand: true; + hexpand: true; + //halign: center; + //valign: center; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Next question: keyboard layout?"; + description: "What is it? Huh?"; + Adw.PreferencesPage { + Adw.PreferencesGroup { + hexpand: true; + margin-end: 20; + margin-start: 20; + Adw.Carousel keyboard_carousel { + orientation: horizontal; + vexpand: true; + hexpand: true; + Gtk.Box keyboard_layouts { + margin-end: 1; + margin-start: 1; + orientation: vertical; + hexpand: true; + Gtk.Box layout_search { + margin-bottom: 5; + Gtk.SearchEntry layout_entry_search { + hexpand: true; + placeholder-text: _("Search for a keyboard layout"); + } + } + Gtk.ListBox list_keyboard_layouts { + styles ["boxed-list"] + } + } + Gtk.Box keyboard_variants { + margin-start: 1; + margin-end: 1; + hexpand: true; + orientation: vertical; + Gtk.Box variant_search { + margin-bottom: 5; + Gtk.SearchEntry variant_entry_search { + hexpand: true; + placeholder-text: _("Search for a keyboard variant"); + } + } + Gtk.ListBox list_keyboard_variants { + styles ["boxed-list"] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/misc_screen.blp b/src/pages/misc_screen.blp new file mode 100644 index 0000000..94901a0 --- /dev/null +++ b/src/pages/misc_screen.blp @@ -0,0 +1,63 @@ +using Gtk 4.0; +using Adw 1; + +template MiscScreen : Adw.Bin { + hexpand: true; + vexpand: true; + + Gtk.Box { + vexpand: true; + hexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Miscellaneous"; + description: ""; + Adw.PreferencesPage { + Adw.PreferencesGroup { + Adw.EntryRow hostname_entry { + title: "enter the hostname"; + } + + Gtk.ListBox { + margin-top: 7; + styles [ "boxed-list" ] + Adw.ActionRow { + title: "Enable ipv6"; + Gtk.Switch ipv_switch { + valign: center; + state: false; + } + } + Adw.ActionRow { + title: "Enable timeshift"; + Gtk.Switch timeshift_switch { + valign: center; + state: true; + } + } + /*Adw.ActionRow { + title: "Enable crystal theming"; + Gtk.Switch theme_switch { + valign: center; + state: false; + } + }*/ + } + } + } + } + Gtk.Overlay { + [overlay] + Gtk.Button next_page_button { + margin-end: 20; + margin-bottom: 20; + label: "Next"; + halign: end; + valign: end; + tooltip-text: "Move to next page"; + styles ["suggested-action"] + } + } + } +} \ No newline at end of file diff --git a/src/pages/partition_screen.blp b/src/pages/partition_screen.blp new file mode 100644 index 0000000..4b962c7 --- /dev/null +++ b/src/pages/partition_screen.blp @@ -0,0 +1,52 @@ +using Gtk 4.0; +using Adw 1; + +template PartitionScreen : Adw.Bin { + vexpand: true; + hexpand: true; + + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Now select the disk you want to install crystal on"; + description: "This will wipe the entire disk you selected"; + Adw.PreferencesPage { + Adw.PreferencesGroup { + Gtk.ListBox partition_list { + styles ["boxed-list"] + } + // Gtk.ListBox { + // margin-top: 10; + // Adw.ActionRow { + // title: "I will partition myself"; + // Gtk.Box { + // Gtk.Button custom_partition { + // label: "Continue"; + // margin-top: 5; + // margin-bottom: 5; + // } + // } + // } + // styles ["boxed-list"] + // } + } + } + + } + Gtk.Overlay { + [overlay] + Gtk.Button next_page_button { + margin-end: 20; + margin-bottom: 20; + label: "Next"; + halign: end; + valign: end; + tooltip-text: "Move to next page"; + styles ["suggested-action"] + } + } + } +} \ No newline at end of file diff --git a/src/pages/summary_screen.blp b/src/pages/summary_screen.blp new file mode 100644 index 0000000..475ad0f --- /dev/null +++ b/src/pages/summary_screen.blp @@ -0,0 +1,168 @@ +using Gtk 4.0; +using Adw 1; + +template SummaryScreen : Adw.Bin { + hexpand: true; + vexpand: true; + + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Summary"; + description: "Last chance to verify everything"; + Adw.PreferencesPage { + Adw.PreferencesGroup { + title: "Timezone and Locale"; + Gtk.ListBox timezone_listbox { + selection-mode: none; + Adw.ActionRow timezone_label { + title: "region/location"; + subtitle: "locale"; + Gtk.Button timezone_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + styles ["boxed-list"] + } + } + Adw.PreferencesGroup { + title: "Keyboard Layout"; + Gtk.ListBox keyboard_listbox { + selection-mode: none; + Adw.ActionRow keyboard_label { + title: "layout"; + subtitle: "keymap"; + Gtk.Button keyboard_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + styles ["boxed-list"] + } + } + Adw.PreferencesGroup { + title: "User Settings"; + Gtk.ListBox user_listbox { + selection-mode: none; + Adw.ActionRow username_label { + title: "username"; + Gtk.Button username_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + Adw.ActionRow sudo_label { + title: "sudo enabled/disabled"; + Gtk.Button sudo_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + Adw.ActionRow root_label { + title: "root enabled/disabled"; + Gtk.Button root_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + styles ["boxed-list"] + } + } + Adw.PreferencesGroup { + title: "Desktop"; + Gtk.ListBox desktop_listbox { + selection-mode: none; + Adw.ActionRow desktop_label { + title: "desktop"; + Gtk.Button desktop_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + styles ["boxed-list"] + } + } + Adw.PreferencesGroup { + title: "Partition Settings"; + Gtk.ListBox partition_listbox { + selection-mode: none; + Adw.ActionRow partition_label { + title: "selected install partition"; + subtitle: "Disk size"; + Gtk.Button partition_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + Adw.ActionRow uefi_label { + title: "legacy bios/uefi"; + } + styles ["boxed-list"] + } + } + Adw.PreferencesGroup { + title: "Miscellaneous Settings"; + Gtk.ListBox misc_listbox { + selection-mode: none; + Adw.ActionRow ipv_label { + title: "ipv6 enabled/disabled"; + Gtk.Button ipv_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + Adw.ActionRow timeshift_label { + title: "timeshift enabled/disabled"; + Gtk.Button timeshift_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + /*Adw.ActionRow theme_label { + title: "crystal theming enaled/disabled"; + Gtk.Button theme_button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + } + Adw.ActionRow unakite_label { + title: "unakite enaled/disabled"; + Gtk.Button { + valign: center; + halign: center; + icon-name: "document-edit-symbolic"; + } + }*/ + styles ["boxed-list"] + } + } + } + } + Gtk.Overlay { + [overlay] + Gtk.Button next_page_button { + margin-end: 20; + margin-bottom: 20; + label: "Next"; + halign: end; + valign: end; + tooltip-text: "Move to next page"; + styles ["suggested-action"] + } + } + } +} \ No newline at end of file diff --git a/src/pages/timezone_screen.blp b/src/pages/timezone_screen.blp new file mode 100644 index 0000000..8b622bf --- /dev/null +++ b/src/pages/timezone_screen.blp @@ -0,0 +1,36 @@ +using Gtk 4.0; +using Adw 1; + +template TimezoneScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + vexpand: true; + hexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Let's get started, shall we?"; + description: "What's your curent timezone?"; + Gtk.Box { + orientation: vertical; + Gtk.Box timezone_search { + Gtk.SearchEntry timezone_entry_search { + hexpand: true; + //margin-bottom: 5; + margin-end: 30; + margin-start: 30; + placeholder-text: _("Search for a timezone"); + } + } + Adw.PreferencesPage { + Adw.PreferencesGroup { + Gtk.ListBox list_timezones { + styles ["boxed-list"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/user_screen.blp b/src/pages/user_screen.blp new file mode 100644 index 0000000..fcaf16a --- /dev/null +++ b/src/pages/user_screen.blp @@ -0,0 +1,64 @@ +using Gtk 4.0; +using Adw 1; + +template UserScreen : Adw.Bin { + hexpand: true; + vexpand: true; + + + Gtk.Box { + vexpand: true; + hexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Create your user"; + description: "You can add more users in the settings on the installed system"; + Adw.PreferencesPage { + Adw.PreferencesGroup { + Adw.EntryRow username_entry { + title: "Enter your username"; + } + Adw.EntryRow password_entry { + title: "Enter your password"; + } + Adw.EntryRow password_confirmation { + title: "Repeat your password"; + } + Gtk.ListBox { // TODO: MOVE TO ADVANCED/MISC SECTION??? + margin-top: 7; + styles ["boxed-list"] + Adw.ActionRow { + title: "Enable administrative rights for user"; + subtitle: "Allows the user to use sudo"; + Gtk.Switch enable_sudo_switch { + valign: center; + state: true; + } + } + Adw.ActionRow { + title: "Enable superuser account"; + subtitle: "Allows using the root user"; + Gtk.Switch enable_root_switch { + valign: center; + state: false; + } + } + } + } + } + } + Gtk.Overlay { + [overlay] + Gtk.Button next_page_button { + margin-end: 20; + margin-bottom: 20; + label: "Next"; + halign: end; + valign: end; + tooltip-text: "Move to next page"; + styles ["suggested-action"] + } + } + } +} \ No newline at end of file diff --git a/src/resources.gresource.xml b/src/resources.gresource.xml new file mode 100644 index 0000000..80f1250 --- /dev/null +++ b/src/resources.gresource.xml @@ -0,0 +1,6 @@ + + + + ../data/icons/padlock2-symbolic.svg + + diff --git a/src/scripts/checkEFI.sh b/src/scripts/checkEFI.sh new file mode 100644 index 0000000..413c450 --- /dev/null +++ b/src/scripts/checkEFI.sh @@ -0,0 +1,3 @@ + +#!/usr/bin/bash +flatpak-spawn --host [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS \ No newline at end of file diff --git a/src/scripts/getDiskSize.sh b/src/scripts/getDiskSize.sh new file mode 100644 index 0000000..826fc40 --- /dev/null +++ b/src/scripts/getDiskSize.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +flatpak-spawn --host lsblk -pdbo SIZE $1 | grep -v SIZE \ No newline at end of file diff --git a/src/scripts/getDisks.sh b/src/scripts/getDisks.sh new file mode 100644 index 0000000..7888fdb --- /dev/null +++ b/src/scripts/getDisks.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +flatpak-spawn --host lsblk -pdo name | grep -v zram | grep -v NAME | grep -v loop | grep -v sr \ No newline at end of file diff --git a/src/scripts/install.sh b/src/scripts/install.sh new file mode 100644 index 0000000..d111006 --- /dev/null +++ b/src/scripts/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bash +flatpak-spawn --host pkexec jade /tmp/jade.json +#flatpak-spawn --host echo "hi" +#flatpak-spawn --host pkexec whoami diff --git a/src/scripts/meson.build b/src/scripts/meson.build new file mode 100644 index 0000000..9cfc3b0 --- /dev/null +++ b/src/scripts/meson.build @@ -0,0 +1,11 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +scriptsdir = join_paths(pkgdatadir, 'jade_gui/scripts') + +jade_gui_sources = [ + 'getDisks.sh', + 'getDiskSize.sh', + 'checkEFI.sh', + 'install.sh', + 'savePrefs.sh', +] +install_data(jade_gui_sources, install_dir: scriptsdir) \ No newline at end of file diff --git a/src/scripts/savePrefs.sh b/src/scripts/savePrefs.sh new file mode 100644 index 0000000..665b1c5 --- /dev/null +++ b/src/scripts/savePrefs.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash +#echo $1 +flatpak-spawn --host bash -c "echo $1 > /tmp/jade.json" \ No newline at end of file diff --git a/src/utils/__init__.py b/src/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/utils/disks.py b/src/utils/disks.py new file mode 100644 index 0000000..a98a0c6 --- /dev/null +++ b/src/utils/disks.py @@ -0,0 +1,35 @@ +# exec.py +# +# Copyright 2022 axtlos +# +# 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 3 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, see . +# +# SPDX-License-Identifier: GPL-3.0-only + +import subprocess, math +def get_disks(): + command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDisks.sh"], capture_output=True) + disks=command.stdout.decode('utf-8')[:-1].split('\n') + return disks + +def get_disk_size(disk: str): + command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/getDiskSize.sh "+disk], capture_output=True) + size=command.stdout.decode('utf-8').strip('\n') + print(disk+":"+size) + return str(math.floor(int(size)/1000**3))+" GB" + +def get_uefi(): + command=subprocess.run(["bash", "-c", "bash -- /app/share/jade_gui/jade_gui/scripts/checkEFI.sh"], capture_output=True) + isEfi=True if command.stdout.decode('utf-8').strip('\n') == "UEFI" else False + return isEfi diff --git a/src/utils/meson.build b/src/utils/meson.build new file mode 100644 index 0000000..e2055f6 --- /dev/null +++ b/src/utils/meson.build @@ -0,0 +1,9 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +utilsdir = join_paths(pkgdatadir, 'jade_gui/utils') + +jade_gui_sources = [ + '__init__.py', + 'disks.py', + 'threading.py', +] +install_data(jade_gui_sources, install_dir: utilsdir) \ No newline at end of file diff --git a/src/utils/threading.py b/src/utils/threading.py new file mode 100644 index 0000000..a204b05 --- /dev/null +++ b/src/utils/threading.py @@ -0,0 +1,74 @@ +# This file was taken from bottles with the permission from brombinmirko +# +# threading.py +# +# Copyright 2022 brombinmirko +# +# 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, in version 3 of the License. +# +# 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, see . + +import os +import sys +import threading +import traceback + +from gettext import gettext as _ + +from gi.repository import GLib + + + +class RunAsync(threading.Thread): + """ + This class is used to execute a function asynchronously. + It takes a function, a callback and a list of arguments as input. + """ + + def __init__(self, task_func, callback=None, *args, **kwargs): + if "DEBUG_MODE" in os.environ: + import faulthandler + faulthandler.enable() + + self.source_id = None + assert threading.current_thread() is threading.main_thread() + + super(RunAsync, self).__init__( + target=self.__target, args=args, kwargs=kwargs) + + self.task_func = task_func + + self.callback = callback if callback else lambda r, e: None + self.daemon = kwargs.pop("daemon", True) + + self.start() + + def __target(self, *args, **kwargs): + result = None + error = None + + print(f"DEBUG: Running async job [{self.task_func}].") + + try: + result = self.task_func(*args, **kwargs) + except Exception as exception: + print("ERROR: while running async job: " + f"{self.task_func}\nException: {exception}") + + error = exception + _ex_type, _ex_value, trace = sys.exc_info() + traceback.print_tb(trace) + traceback_info = '\n'.join(traceback.format_tb(trace)) + + print([str(exception), traceback_info]) + self.source_id = GLib.idle_add(self.callback, result, error) + return self.source_id + diff --git a/src/widgets/__init__.py b/src/widgets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/widgets/desktop.blp b/src/widgets/desktop.blp new file mode 100644 index 0000000..99c3ff5 --- /dev/null +++ b/src/widgets/desktop.blp @@ -0,0 +1,11 @@ +using Gtk 4.0; +using Adw 1; + +template DesktopEntry : Adw.ActionRow { + title: "DesktopEntry"; + Gtk.Box { + Gtk.CheckButton select_button { + use-underline: true; + } + } +} \ No newline at end of file diff --git a/src/widgets/desktop.py b/src/widgets/desktop.py new file mode 100644 index 0000000..a6cc597 --- /dev/null +++ b/src/widgets/desktop.py @@ -0,0 +1,34 @@ +# desktop.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/desktop.ui') +class DesktopEntry(Adw.ActionRow): + __gtype_name__ = 'DesktopEntry' + + select_button = Gtk.Template.Child() + + def __init__(self, window, desktop, button_group, application, **kwargs): + super().__init__(**kwargs) + self.window = window + self.set_title(desktop) + self.select_button.set_group(button_group) + diff --git a/src/widgets/disk.blp b/src/widgets/disk.blp new file mode 100644 index 0000000..5e0d37f --- /dev/null +++ b/src/widgets/disk.blp @@ -0,0 +1,12 @@ +using Gtk 4.0; +using Adw 1; + +template DiskEntry : Adw.ActionRow { + title: "Disk"; + subtitle: "disk size"; + Gtk.Box { + Gtk.CheckButton select_button { + use-underline: true; + } + } +} \ No newline at end of file diff --git a/src/widgets/disk.py b/src/widgets/disk.py new file mode 100644 index 0000000..dc76b84 --- /dev/null +++ b/src/widgets/disk.py @@ -0,0 +1,35 @@ +# disk.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/disk.ui') +class DiskEntry(Adw.ActionRow): + __gtype_name__ = 'DiskEntry' + + select_button = Gtk.Template.Child() + + def __init__(self, window, disk, disk_size, button_group, application, **kwargs): + super().__init__(**kwargs) + self.disk = disk + self.disk_size = disk + self.set_title(disk) + self.set_subtitle(disk_size) + self.select_button.set_group(button_group) diff --git a/src/widgets/layout.blp b/src/widgets/layout.blp new file mode 100644 index 0000000..2017e8d --- /dev/null +++ b/src/widgets/layout.blp @@ -0,0 +1,13 @@ +using Gtk 4.0; +using Adw 1; + +template KeyboardLayout : Adw.ActionRow { + title: "Country"; + subtitle: "Country Code"; + Gtk.Box { + spacing: 6; + Gtk.Image { + icon-name: "go-next-symbolic"; + } + } +} \ No newline at end of file diff --git a/src/widgets/layout.py b/src/widgets/layout.py new file mode 100644 index 0000000..5b5709a --- /dev/null +++ b/src/widgets/layout.py @@ -0,0 +1,38 @@ +# layout.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/layout.ui') +class KeyboardLayout(Adw.ActionRow): + __gtype_name__ = 'KeyboardLayout' + + variants=[] + + def __init__(self, window, country, country_shorthand, variants, application, **kwargs): + super().__init__(**kwargs) + + self.country = country + self.country_shorthand = country_shorthand + + self.set_title(country) + self.set_subtitle(country_shorthand) + self.variants = variants + diff --git a/src/widgets/meson.build b/src/widgets/meson.build new file mode 100644 index 0000000..8eda319 --- /dev/null +++ b/src/widgets/meson.build @@ -0,0 +1,12 @@ +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +widgetsdir = join_paths(pkgdatadir, 'jade_gui/widgets') + +jade_gui_sources = [ + '__init__.py', + 'timezone.py', + 'layout.py', + 'variant.py', + 'desktop.py', + 'disk.py' +] +install_data(jade_gui_sources, install_dir: widgetsdir) \ No newline at end of file diff --git a/src/widgets/timezone.blp b/src/widgets/timezone.blp new file mode 100644 index 0000000..79c79f1 --- /dev/null +++ b/src/widgets/timezone.blp @@ -0,0 +1,14 @@ +using Gtk 4.0; +using Adw 1; + +template TimezoneEntry : Adw.ActionRow { + title: "region/location"; + Gtk.Box { + spacing: 6; + Gtk.Label time_label { + valign: center; + label: "Current time"; + styles ["tag", "caption"] + } + } +} \ No newline at end of file diff --git a/src/widgets/timezone.py b/src/widgets/timezone.py new file mode 100644 index 0000000..71adea7 --- /dev/null +++ b/src/widgets/timezone.py @@ -0,0 +1,44 @@ +# timezone.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from datetime import datetime +import pytz +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/timezone.ui') +class TimezoneEntry(Adw.ActionRow): + __gtype_name__ = 'TimezoneEntry' + + time_label = Gtk.Template.Child() + + def __init__(self, window, region, location, locale, application, **kwargs): + super().__init__(**kwargs) + + self.region = region + self.location = location + self.locale = locale + + self.set_title(region+"/"+location) + self.time_label.set_text(self.calculate_time(location=location, region=region)) + + def calculate_time(self, location, region): + timezone = pytz.timezone(region+"/"+location) + datetime_timezone = datetime.now(timezone) + return datetime_timezone.strftime('%H:%M') diff --git a/src/widgets/variant.blp b/src/widgets/variant.blp new file mode 100644 index 0000000..c18d3a1 --- /dev/null +++ b/src/widgets/variant.blp @@ -0,0 +1,7 @@ +using Gtk 4.0; +using Adw 1; + +template KeyboardVariant : Adw.ActionRow { + title: "Variant"; + subtitle: "Country - Country code"; +} \ No newline at end of file diff --git a/src/widgets/variant.py b/src/widgets/variant.py new file mode 100644 index 0000000..3aa85c7 --- /dev/null +++ b/src/widgets/variant.py @@ -0,0 +1,36 @@ +# variant.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk, GLib, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/widgets/variant.ui') +class KeyboardVariant(Adw.ActionRow): + __gtype_name__ = 'KeyboardVariant' + + def __init__(self, window, variant, country, country_shorthand, **kwargs): + super().__init__(**kwargs) + + self.variant = variant + self.country = country + self.country_shorthand = country_shorthand + + self.set_title(variant) + self.set_subtitle(country+" - "+country_shorthand) + diff --git a/src/window.blp b/src/window.blp new file mode 100644 index 0000000..d14d2b6 --- /dev/null +++ b/src/window.blp @@ -0,0 +1,78 @@ +using Gtk 4.0; +using Adw 1; + +template JadeGuiWindow : Gtk.ApplicationWindow { + title: "Jade"; + default-width: 600; + default-height: 600; + resizable: false; + + [titlebar] + Adw.HeaderBar header_bar { + title-widget: Gtk.Box { + Adw.CarouselIndicatorDots { + carousel: carousel; + orientation: horizontal; + } + }; + + [start] + Gtk.Button { + label: "Back"; + //icon-name: ; + } + + styles ["flat"] + } + Gtk.Box { + orientation: horizontal; + vexpand: true; + hexpand: true; + Adw.Carousel carousel { + orientation: horizontal; + vexpand: true; + hexpand: true; + allow-mouse-drag: true; + allow-scroll-wheel: true; + allow-long-swipes: true; + + Gtk.Box welcome_page { + orientation: vertical; + valign: center; + halign: center; + vexpand: true; + hexpand: true; + + Gtk.Image crystal-logo { + resource: "/al/getcryst/jadegui/crystal-logo-minimal.png"; + pixel-size: 200; + margin-bottom: 25; + } + + Gtk.Label welcome { + label: "Welcome to jade"; + use-markup: true; + } + + Gtk.Label letsstart { + label: "Ready to make your Crystal installation... ready?"; + margin-bottom: 28; + } + + Gtk.Box { + orientation: horizontal; + halign: center; + valign: center; + vexpand: true; + hexpand: true; + + Gtk.Button next_button { + margin-start: 12; + label: "YEAH!"; + styles ["suggested-action", "pill"] + } + } + } + } + } +} diff --git a/src/window.py b/src/window.py new file mode 100644 index 0000000..c564994 --- /dev/null +++ b/src/window.py @@ -0,0 +1,158 @@ +# window.py + +# +# Copyright 2022 user + +# +# 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 3 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, see . + +from gi.repository import Gtk +from gi.repository import Gdk +from .widgets.timezone import TimezoneEntry +from .widgets.layout import KeyboardLayout +from .widgets.variant import KeyboardVariant +from .widgets.desktop import DesktopEntry +from .widgets.disk import DiskEntry +from .functions.keyboard_screen import KeyboardScreen +from .functions.timezone_screen import TimezoneScreen +from .functions.user_screen import UserScreen +from .functions.desktop_screen import DesktopScreen +from .functions.misc_screen import MiscScreen +from .functions.partition_screen import PartitionScreen +from .functions.summary_screen import SummaryScreen +from .functions.install_screen import InstallScreen +from .functions.finished_screen import FinishedScreen +from .locales.locales_list import locations +from .keymaps import keymaps +from .desktops import desktops +from .utils import disks + +@Gtk.Template(resource_path='/al/getcryst/jadegui/window.ui') +class JadeGuiWindow(Gtk.ApplicationWindow): + __gtype_name__ = 'JadeGuiWindow' + + event_controller = Gtk.EventControllerKey.new() + carousel = Gtk.Template.Child() + + ### Page and widgets on welcome screen + welcome_page = Gtk.Template.Child() + # quit_button = Gtk.Template.Child() + next_button = Gtk.Template.Child() + + + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.finished_screen = FinishedScreen(window=self, **kwargs) + self.installer_screen = InstallScreen(window=self, main_carousel=self.carousel, next_page=self.finished_screen, **kwargs) + self.summary_screen = SummaryScreen(window=self, main_carousel=self.carousel, next_page=self.installer_screen, **kwargs) + self.partition_screen = PartitionScreen(window=self, main_carousel=self.carousel, next_page=self.summary_screen, **kwargs) + self.misc_screen = MiscScreen(window=self, main_carousel=self.carousel, next_page=self.partition_screen, **kwargs) + self.desktop_screen = DesktopScreen(window=self, main_carousel=self.carousel, next_page=self.misc_screen, **kwargs) + self.user_screen = UserScreen(window=self, main_carousel=self.carousel, next_page=self.desktop_screen, **kwargs) + self.keyboard_screen = KeyboardScreen(window=self, main_carousel=self.carousel, next_page=self.user_screen, **kwargs) + self.timezone_screen = TimezoneScreen(window=self, main_carousel=self.carousel, next_page=self.keyboard_screen, **kwargs) + self.carousel.append(self.timezone_screen) + self.carousel.append(self.keyboard_screen) + self.carousel.append(self.user_screen) + self.carousel.append(self.desktop_screen) + self.carousel.append(self.misc_screen) + self.carousel.append(self.partition_screen) + self.carousel.append(self.summary_screen) + self.carousel.append(self.installer_screen) + self.carousel.append(self.finished_screen) + ### Widgets for first page (welcome screen) + #self.quit_button.connect("clicked", self.confirmQuit) + #self.summary_screen.connect_buttons() + self.next_button.connect("clicked", self.nextPage) + ### --------- + + ### Test timezones + for i in locations: + for locale in i: + # print(locale.region) + # print(locale.location) + # print(locale.locales) + self.timezone_screen.list_timezones.append(TimezoneEntry(window=self, region=locale.region, location=locale.location, locale=locale.locales, **kwargs)) + ### --------- + + ### Test layouts + for keymap in keymaps: + #print(keymap.layout) + #print(keymap.backend_layout) + self.keyboard_screen.list_keyboard_layouts.append(KeyboardLayout(window=self, country=keymap.layout, country_shorthand=keymap.backend_layout, variants=keymap.variant, **kwargs)) + ### --------- + + ### Test desktops + onyx = DesktopEntry(window=self, desktop="Onyx", button_group=None, **kwargs) # Manually specifying onyx since the other entries need a button group to attach to + self.desktop_screen.list_desktops.append(onyx) + self.desktop_screen.chosen_desktop = self.desktop_screen.list_desktops.get_row_at_index(0).get_title() + self.desktop_screen.list_desktops.select_row(onyx) + for desktop in desktops: + if desktop != "Onyx": + #print(desktop) + self.desktop_screen.list_desktops.append(DesktopEntry(window=self, desktop=desktop, button_group=onyx.select_button, **kwargs)) + ### --------- + + ### Test partitions + available_disks = disks.get_disks() + firstdisk = DiskEntry(window=self, disk=available_disks[0], disk_size=disks.get_disk_size(available_disks[0]), button_group=None, **kwargs) + self.partition_screen.partition_list.append(firstdisk) + self.partition_screen.selected_partition = self.partition_screen.partition_list.get_row_at_index(0) + self.partition_screen.partition_list.select_row(firstdisk) + #print(available_disks[0]) + #print(available_disks) + for disk in available_disks: + if disk != available_disks[0]: + #print(disk) + self.partition_screen.partition_list.append(DiskEntry(window=self, disk=disk, disk_size=disks.get_disk_size(disk), button_group=firstdisk.select_button, **kwargs)) + ### --------- + + def nextPage(self, idk): + self.carousel.scroll_to(self.timezone_screen, True) + + def confirmQuit(self, idk): + + def handle_response(_widget, response_id): + if response_id == Gtk.ResponseType.YES: + _widget.destroy() + self.destroy() + elif response_id == Gtk.ResponseType.NO: + _widget.destroy() + + dialog = Gtk.MessageDialog( + transient_for=self, + modal=True, + parent=self, + text=_("Do you want to try\nCrystal without installing?"), + buttons=Gtk.ButtonsType.YES_NO + ) + dialog.connect("response", handle_response) + dialog.present() + + + + + +class AboutDialog(Gtk.AboutDialog): + + def __init__(self, parent): + Gtk.AboutDialog.__init__(self) + self.props.program_name = 'jade_gui' + self.props.version = "0.1.0" + self.props.authors = ['user'] + self.props.copyright = '2022 user' + self.props.logo_icon_name = 'al.getcryst.jadegui' + self.props.modal = True + self.set_transient_for(parent) diff --git a/src/window.ui b/src/window.ui new file mode 100644 index 0000000..9f4f390 --- /dev/null +++ b/src/window.ui @@ -0,0 +1,179 @@ + + + + + diff --git a/subprojects/blueprint-compiler.wrap b/subprojects/blueprint-compiler.wrap new file mode 100644 index 0000000..6e6ee32 --- /dev/null +++ b/subprojects/blueprint-compiler.wrap @@ -0,0 +1,8 @@ +[wrap-git] +directory = blueprint-compiler +url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git +revision = main +depth = 1 + +[provide] +program_names = blueprint-compiler \ No newline at end of file diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index a56d525..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:jade_gui/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const Jadegui()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/web/favicon.png b/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/web/favicon.png and /dev/null differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/web/icons/Icon-192.png and /dev/null differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/web/icons/Icon-512.png and /dev/null differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png deleted file mode 100644 index 1b4d599..0000000 Binary files a/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png deleted file mode 100644 index 73f0670..0000000 Binary files a/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/web/index.html b/web/index.html deleted file mode 100644 index 7da2d80..0000000 --- a/web/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - jade_gui - - - - - - - diff --git a/web/manifest.json b/web/manifest.json deleted file mode 100644 index 29323ba..0000000 --- a/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "jade_gui", - "short_name": "jade_gui", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -}