diff --git a/cnchi/desktop_info.py b/cnchi/desktop_info.py index 546104d9f..888897519 100644 --- a/cnchi/desktop_info.py +++ b/cnchi/desktop_info.py @@ -67,8 +67,7 @@ } ALL_FEATURES = ["aur", "bluetooth", "cups", "chromium", "firefox", "firewall", "flash", - "fonts", "games", "graphic_drivers", "lamp", "lts", "office", - "visual", "smb"] + "games", "graphic_drivers", "lamp", "lts", "office", "visual", "smb"] # Not all desktops have all features EXCLUDED_FEATURES = { diff --git a/cnchi/features_info.py b/cnchi/features_info.py index b185b87bc..b97f11c0f 100644 --- a/cnchi/features_info.py +++ b/cnchi/features_info.py @@ -40,7 +40,6 @@ 'firefox': 'firefox', 'firewall': 'network-server', 'flash': 'flash', - 'fonts': 'preferences-desktop-font', 'games': 'applications-games', 'graphic_drivers': 'gnome-system', 'lamp': 'applications-internet', @@ -62,7 +61,6 @@ def _(message): 'firefox': _("Firefox Web Browser"), 'firewall': _("Uncomplicated Firewall"), 'flash': _("Flash plugins"), - 'fonts': _("Extra Truetype Fonts"), 'games': _("Steam + PlayonLinux"), 'graphic_drivers': _("Graphic drivers (Proprietary)"), 'lamp': _("Apache (or Nginx) + Mariadb + PHP"), @@ -77,7 +75,6 @@ def _(message): 'chromium': _("Open-source web browser from Google."), 'firefox': _("A popular open-source graphical web browser from Mozilla."), 'flash': _("Freeware software normally used for multimedia."), - 'fonts': _("TrueType fonts from the Google Fonts project."), 'graphic_drivers': _("Installs AMD or Nvidia proprietary graphic driver."), 'games': _("Installs Steam and Playonlinux for gaming enthusiasts."), 'lamp': _("Apache (or Nginx) + Mariadb + PHP installation and setup."), @@ -116,14 +113,6 @@ def _(message): 'flash': _("Adobe Flash Player is freeware software for using content created\n" "on the Adobe Flash platform, including viewing multimedia, executing\n" "rich internet applications and streaming video and audio."), - 'fonts': _("Fonts: adobe-source-code-pro, adobe-source-sans-pro, jsmath, lohit\n" - "oldstand, openarch, otf-bitter, otf-goudy, andika, anonymous-pro\n" - "cantarell, cardo, chromeos-fonts, comfortaa, droid, google-fonts\n" - "google-webfonts, inconsolata, kimberly_geswein_print, lekton\n" - "medievalsharp, nova, oldstandard, opensans, oxygen, pt-mono\n" - "pt-sans, roboto, sil-fonts, sortsmillgoudy, source-code-pro\n" - "source-sans-pro, ubuntu-font-family, vollkorn, fira-mono\n" - "fira-sans and lato."), 'games': _("Steam is one of the most popular gaming clients that supports\n" "linux in technology and gaming, while PlayOnLinux\n" "is a very easy manager to setting up games to play\n" diff --git a/cnchi/info.py b/cnchi/info.py index ad86a8987..60eb72515 100755 --- a/cnchi/info.py +++ b/cnchi/info.py @@ -29,7 +29,7 @@ """ Set some Cnchi global constants """ -CNCHI_VERSION = "0.14.256" +CNCHI_VERSION = "0.14.257" CNCHI_WEBSITE = "http://www.antergos.com" CNCHI_RELEASE_STAGE = "production" diff --git a/cnchi/main_window.py b/cnchi/main_window.py index b07c59470..ceaf9e12b 100644 --- a/cnchi/main_window.py +++ b/cnchi/main_window.py @@ -47,6 +47,7 @@ import slides import summary import info +#import mirrors import gi gi.require_version('Gtk', '3.0') @@ -311,6 +312,8 @@ def load_pages(self): self.pages["location"] = location.Location(self.params) self.pages["timezone"] = timezone.Timezone(self.params) + #self.pages["mirrors"] = mirrors.Mirrors(self.params) + if self.settings.get('desktop_ask'): self.pages["keymap"] = keymap.Keymap(self.params) self.pages["desktop"] = desktop.DesktopAsk(self.params) diff --git a/cnchi/mirrors.py b/cnchi/mirrors.py new file mode 100644 index 000000000..c2cc01f34 --- /dev/null +++ b/cnchi/mirrors.py @@ -0,0 +1,283 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# mirrors.py +# +# Copyright © 2013-2017 Antergos +# +# This file is part of Cnchi. +# +# Cnchi 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. +# +# Cnchi 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. +# +# The following additional terms are in effect as per Section 7 of the license: +# +# The preservation of all legal notices and author attributions in +# the material or in the Appropriate Legal Notices displayed +# by works containing it is required. +# +# You should have received a copy of the GNU General Public License +# along with Cnchi; If not, see . + + +""" Let advanced users manage mirrorlist files """ + +import os +import sys +import queue +import time +import logging +import subprocess + +import bootinfo + +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +from gtkbasebox import GtkBaseBox + +import misc.extra as misc + + +class Mirrors(GtkBaseBox): + def __init__(self, params, prev_page="features", next_page=None): + super().__init__(self, params, "mirrors", prev_page, next_page) + + data_dir = self.settings.get("data") + + self.disable_rank_mirrors = params["disable_rank_mirrors"] + + self.listbox_rows = {} + + # Set up list box + self.listbox = self.ui.get_object("listbox") + self.listbox.set_selection_mode(Gtk.SelectionMode.NONE) + self.listbox.set_sort_func(self.listbox_sort_by_name, None) + + # TODO: By default, select automatic mirror list ranking + + def prepare(self, direction): + """ Prepares screen """ + self.translate_ui() + self.show_all() + + self.forward_button.set_sensitive(True) + + def translate_ui(self): + """ Translates screen before showing it """ + self.header.set_subtitle(_("Mirrors Selection")) + + self.forward_button.set_always_show_image(True) + self.forward_button.set_sensitive(True) + + bold_style = '{0}' + + radio = self.ui.get_object("rank_radiobutton") + txt = _("Let Cnchi sort my mirror list (recommended)") + radio.set_label(txt) + radio.set_name('rank_radio_btn') + + radio = self.ui.get_object("leave_radiobutton") + txt = _("Do not touch the mirrors list") + radio.set_label(txt) + radio.set_name('leave_radio_btn') + + radio = self.ui.get_object("user_radiobutton") + txt = _("Let me manage my mirror list (advanced)") + radio.set_label(txt) + radio.set_name('user_radio_btn') + + intro_txt = _("How would you like to proceed?") + intro_label = self.ui.get_object("introduction") + # intro_txt = bold_style.format(intro_txt) + intro_label.set_text(intro_txt) + intro_label.set_name("intro_label") + intro_label.set_hexpand(False) + intro_label.set_line_wrap(True) + intro_label.set_max_width_chars(max_width_chars) + + def add_mirror(self, mirror_url, box): + """ Adds mirror url to listbox row box """ + + # Add mirror switch + object_name = "switch_" + mirror_url + switch = Gtk.Switch.new() + switch.set_name(object_name) + switch.set_property('margin_top', 10) + switch.set_property('margin_bottom', 10) + switch.set_property('margin_end', 10) + switch.connect("notify::active", self.on_switch_activated) + self.listbox_rows[mirror_url].append(switch) + box.pack_end(switch, False, False, 0) + + # Add mirror url label + object_name = mirror_url + label_url = Gtk.Label.new() + label_url.set_halign(Gtk.Align.START) + label_url.set_justify(Gtk.Justification.LEFT) + label_url.set_name(mirror_url) + self.listbox_rows[mirror_url].append(label_url) + box.pack_start(label_url, False, True, 0) + + + def on_switch_activated(self, switch, gparam): + pass + ''' + for feature in self.features: + row = self.listbox_rows[feature] + if row[Features.COL_SWITCH] == switch: + is_active = switch.get_active() + self.settings.set("feature_" + feature, is_active) + ''' + ''' + def fill_listbox(self): + for listbox_row in self.listbox.get_children(): + listbox_row.destroy() + + self.listbox_rows = {} + + # Only add graphic-driver feature if an AMD or Nvidia is detected + if "graphic_drivers" in self.features: + allow = False + if self.detect.amd(): + allow = True + if self.detect.nvidia() and not self.detect.bumblebee(): + allow = True + if not allow: + logging.debug("Removing proprietary graphic drivers feature.") + self.features.remove("graphic_drivers") + + for feature in self.features: + box = Gtk.Box(spacing=20) + box.set_name(feature + "-row") + + self.listbox_rows[feature] = [] + + self.add_feature_icon(feature, box) + self.add_feature_label(feature, box) + self.add_feature_switch(feature, box) + # Add row to our gtklist + self.listbox.add(box) + + self.listbox.show_all() + ''' + + + + + + + + + + + + + + + def store_values(self): + """ Store selected values """ + check = self.ui.get_object("encrypt_checkbutton") + use_luks = check.get_active() + + check = self.ui.get_object("lvm_checkbutton") + use_lvm = check.get_active() + + check = self.ui.get_object("zfs_checkbutton") + use_zfs = check.get_active() + + check = self.ui.get_object("home_checkbutton") + use_home = check.get_active() + + if self.next_page == "installation_automatic": + self.settings.set('use_lvm', use_lvm) + self.settings.set('use_luks', use_luks) + self.settings.set('use_luks_in_root', True) + self.settings.set('luks_root_volume', "cryptAntergos") + self.settings.set('use_zfs', False) + self.settings.set('use_home', use_home) + elif self.next_page == "installation_zfs": + self.settings.set('use_lvm', False) + self.settings.set('use_luks', use_luks) + self.settings.set('use_luks_in_root', False) + self.settings.set('luks_root_volume', "") + self.settings.set('use_zfs', True) + self.settings.set('zfs', True) + self.settings.set('use_home', use_home) + else: + # Set defaults. We don't know these yet. + self.settings.set('use_lvm', False) + self.settings.set('use_luks', False) + self.settings.set('use_luks_in_root', False) + self.settings.set('luks_root_volume', "") + self.settings.set('use_zfs', False) + self.settings.set('use_home', False) + + if not self.settings.get('use_zfs'): + if self.settings.get('use_luks'): + logging.info("Antergos installation will be encrypted using LUKS") + if self.settings.get('use_lvm'): + logging.info("Antergos will be installed using LVM volumes") + if self.settings.get('use_home'): + logging.info("Antergos will be installed using a separate /home volume.") + elif self.settings.get('use_home'): + logging.info("Antergos will be installed using a separate /home partition.") + else: + logging.info("Antergos will be installed using ZFS") + if self.settings.get('use_luks'): + logging.info("Antergos ZFS installation will be encrypted") + if self.settings.get('use_home'): + logging.info("Antergos will be installed using a separate /home volume.") + + if self.next_page == "installation_alongside": + self.settings.set('partition_mode', 'alongside') + elif self.next_page == "installation_advanced": + self.settings.set('partition_mode', 'advanced') + elif self.next_page == "installation_automatic": + self.settings.set('partition_mode', 'automatic') + elif self.next_page == "installation_zfs": + self.settings.set('partition_mode', 'zfs') + + # Check if there are still processes running... + self.wait() + + return True + + def get_next_page(self): + return self.next_page + + def on_automatic_radiobutton_toggled(self, widget): + """ Automatic selected, enable all options """ + if widget.get_active(): + check = self.ui.get_object("zfs_checkbutton") + if check.get_active(): + self.next_page = "installation_zfs" + else: + self.next_page = "installation_automatic" + self.enable_automatic_options(True) + + def on_alongside_radiobutton_toggled(self, widget): + """ Alongside selected, disable all automatic options """ + if widget.get_active(): + self.next_page = "installation_alongside" + self.enable_automatic_options(False) + + def on_advanced_radiobutton_toggled(self, widget): + """ Advanced selected, disable all automatic options """ + if widget.get_active(): + self.next_page = "installation_advanced" + self.enable_automatic_options(False) + + +if __name__ == '__main__': + from test_screen import _, run + + run('Mirrors') diff --git a/cnchi/test_screen.py b/cnchi/test_screen.py index 265cd6fa9..cd4deda01 100644 --- a/cnchi/test_screen.py +++ b/cnchi/test_screen.py @@ -92,6 +92,9 @@ def get_screen(screen_name, params): elif screen_name == "zfs": import zfs screen = zfs.InstallationZFS(params) + elif screen_name == "Mirrors": + import mirrors + screen = mirrors.Mirrors(params) return screen @@ -137,6 +140,7 @@ def run(screen_name): 'main_progressbar': Gtk.ProgressBar.new(), 'header': Gtk.HeaderBar.new(), 'callback_queue': None, + 'disable_rank_mirrors': False, 'alternate_package_list': "", 'process_list': []} diff --git a/data/packages.xml b/data/packages.xml index 037f7e108..ba175617f 100644 --- a/data/packages.xml +++ b/data/packages.xml @@ -585,10 +585,6 @@ pepper-flash flashplugin - - ttf-freefont - ttf-google-fonts - steam-native-runtime steam diff --git a/ui/mirrors.ui b/ui/mirrors.ui new file mode 100644 index 000000000..88105c5ad --- /dev/null +++ b/ui/mirrors.ui @@ -0,0 +1,153 @@ + + + + + True + False + + center + 10 + 0 + 10 + 10 + + vertical + + + True + False + 10 + 8 + center + start + + True + fill + + + False + False + 0 + + + + + True + horizontal + 5 + + + + True + True + False + start + True + True + True--> + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + horizontal + 5 + + + + True + True + False + start + True + True + True + rank_radiobutton + + + + False + True + 1 + + + + + False + True + 11 + + + + + + + True + horizontal + 10 + + + + True + True + False + start + True + True + True + rank_radiobutton + + + + False + True + 1 + + + + + False + True + 13 + + + + + + True + True + True + True + never + in + + + True + True + + + + + True + True + 0 + + + + + diff --git a/update.info b/update.info index e43f5d8dc..a42292352 100644 --- a/update.info +++ b/update.info @@ -1,2 +1,2 @@ -{"version":"0.14.256","files":[ +{"version":"0.14.257","files":[ ]}