failed: suggest internet search
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 ###
|
||||
|
||||
|
||||
@@ -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'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user