summaryrefslogtreecommitdiffstats
path: root/pyanaconda
diff options
context:
space:
mode:
Diffstat (limited to 'pyanaconda')
-rw-r--r--pyanaconda/ui/gui/spokes/keyboard.glade6
-rw-r--r--pyanaconda/ui/gui/spokes/keyboard.py29
-rw-r--r--pyanaconda/ui/gui/spokes/welcome.py4
3 files changed, 31 insertions, 8 deletions
diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade
index 1919a14b8..ae44c21d1 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.glade
+++ b/pyanaconda/ui/gui/spokes/keyboard.glade
@@ -388,7 +388,7 @@ any layout to the top of the list to select it as the default.</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="testingLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
@@ -401,7 +401,7 @@ any layout to the top of the list to select it as the default.</property>
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="testingWindow">
<property name="height_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -421,7 +421,7 @@ any layout to the top of the list to select it as the default.</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="layoutSwitchButton">
+ <object class="GtkLabel" id="layoutSwitchLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index dc1271f5c..50933aa7f 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -32,6 +32,7 @@ from pyanaconda.ui.gui.spokes import NormalSpoke
from pyanaconda.ui.gui.categories.localization import LocalizationCategory
from pyanaconda.ui.gui.utils import enlightbox
from pyanaconda import keyboard
+from pyanaconda import flags
__all__ = ["KeyboardSpoke"]
@@ -202,6 +203,22 @@ class KeyboardSpoke(NormalSpoke):
self._store = self.builder.get_object("addedLayoutStore")
self._add_data_layouts()
+ if not flags.can_touch_runtime_system("test X layouts"):
+ # Disable area for testing layouts as we cannot make
+ # it work without modifying runtime system
+
+ widgets = [self.builder.get_object("testingLabel"),
+ self.builder.get_object("testingWindow"),
+ self.builder.get_object("layoutSwitchLabel")]
+
+ # Use testingLabel's text to explain why this part is not
+ # sensitive.
+ widgets[0].set_text(_("Testing layouts configuration not "
+ "available."))
+
+ for widget in widgets:
+ widget.set_sensitive(False)
+
def refresh(self):
NormalSpoke.refresh(self)
@@ -227,7 +244,8 @@ class KeyboardSpoke(NormalSpoke):
def _addLayout(self, store, name):
store.append([name])
- self._xkl_wrapper.add_layout(name)
+ if flags.can_touch_runtime_system("add runtime X layout"):
+ self._xkl_wrapper.add_layout(name)
def _removeLayout(self, store, itr):
"""
@@ -236,7 +254,8 @@ class KeyboardSpoke(NormalSpoke):
"""
- self._xkl_wrapper.remove_layout(store[itr][0])
+ if flags.can_touch_runtime_system("remove runtime X layout"):
+ self._xkl_wrapper.remove_layout(store[itr][0])
store.remove(itr)
# Signal handlers.
@@ -309,7 +328,8 @@ class KeyboardSpoke(NormalSpoke):
return
store.swap(cur, prev)
- self._flush_layouts_to_X()
+ if flags.can_touch_runtime_system("reorder runtime X layouts"):
+ self._flush_layouts_to_X()
selection.emit("changed")
def on_down_clicked(self, button):
@@ -323,7 +343,8 @@ class KeyboardSpoke(NormalSpoke):
return
store.swap(cur, nxt)
- self._flush_layouts_to_X()
+ if flags.can_touch_runtime_system("reorder runtime X layouts"):
+ self._flush_layouts_to_X()
selection.emit("changed")
def on_preview_clicked(self, button):
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index dac507903..0bd5d90c7 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -35,6 +35,7 @@ from pyanaconda.localization import Language, LOCALE_PREFERENCES, expand_langs
from pyanaconda.product import isFinal, productName, productVersion
from pyanaconda import keyboard
from pyanaconda import timezone
+from pyanaconda import flags
__all__ = ["WelcomeLanguageSpoke", "LanguageSpoke"]
@@ -81,7 +82,8 @@ class LanguageMixIn(object):
for layout in new_layouts:
if layout not in self.data.keyboard.layouts_list:
self.data.keyboard.layouts_list.append(layout)
- self._xklwrapper.add_layout(layout)
+ if flags.can_touch_runtime_system("add runtime X layout"):
+ self._xklwrapper.add_layout(layout)
@property
def completed(self):