failed: suggest internet search

This commit is contained in:
Peter
2021-04-16 02:14:03 +02:00
parent 23f51c1f7e
commit d62ff1841c
3 changed files with 26 additions and 5 deletions

View File

@@ -47,16 +47,21 @@
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes" comments="Shown as confirmation if installation fails. Expression of minor discontent. Underscore can not be the same as for 'Copy Error Text'.">_Meh.</property>
<object class="GtkButton" id="search_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="halign">center</property>
<property name="action-name">app.quit</property>
<property name="use-underline">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" comments="Shown if installation fails.">Search for Help on the Internet</property>
<property name="use-markup">True</property>
<property name="wrap">True</property>
</object>
</child>
<style>
<class name="destructive-action"/>
<class name="large-button"/>
</style>
</object>

View File

@@ -3,6 +3,7 @@
from gi.repository import Gtk
from .installation_scripting import installation_scripting
from .system_calls import open_internet_search
from .page import Page
@@ -12,9 +13,16 @@ class FailedPage(Gtk.Box, Page):
image_name = 'computer-fail-symbolic'
terminal_box = Gtk.Template.Child()
search_button = Gtk.Template.Child()
def __init__(self, **kwargs):
Gtk.Box.__init__(self, **kwargs)
self.search_button.connect('clicked', self._on_search_button_clicked)
### callbacks ###
def _on_search_button_clicked(self, button):
open_internet_search()
### public methods ###

View File

@@ -30,6 +30,14 @@ def open_disks():
_run_program(['gnome-disks'])
def open_internet_search():
distribution_name = global_state.get_config('distribution_name')
name_snippet = '"' + distribution_name + '" ' if distribution_name else ''
search_text = '{}"failed installation" "os-installer version {}"'.format(
name_snippet, global_state.get_config('version'))
_run_program(['epiphany', '--search', search_text])
def open_wifi_settings():
_run_program(['gnome-control-center', 'wifi'])