On Mon, 2015-11-23 at 17:29 +0100, Martin Kolman wrote:
Even though the window header is usually hidden during normal
installation
and the title text can't be seen, there are still some cases where
empty window
title looks weird - such as when using Anaconda for dirinstall or
image install,
on some live spins, etc.
So set the title to "Anaconda Installer" to handle these cases and
also
make sure to retranslate it if user changes the language on the
Welcome
spoke.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
pyanaconda/constants.py | 3 +++
pyanaconda/ui/gui/__init__.py | 4 ++--
pyanaconda/ui/gui/spokes/welcome.py | 12 +++++++++++-
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index df1a171..1f319d5 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -189,3 +189,6 @@ X_DISPLAY_NUMBER = 1
PAYLOAD_STATUS_PROBING_STORAGE = N_("Probing storage...")
PAYLOAD_STATUS_PACKAGE_MD = N_("Downloading package metadata...")
PAYLOAD_STATUS_GROUP_MD = N_("Downloading group metadata...")
+
+# Window title text
+WINDOW_TITLE_TEXT = "Anaconda Installer"
This should be enclosed in
N_().
diff --git a/pyanaconda/ui/gui/__init__.py
b/pyanaconda/ui/gui/__init__.py
index aaecc0f..76759c6 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -35,7 +35,7 @@ gi.require_version("GObject", "2.0")
from gi.repository import Gdk, Gtk, AnacondaWidgets, Keybinder,
GdkPixbuf, GLib, GObject
from pyanaconda.i18n import _, C_
-from pyanaconda.constants import IPMI_ABORTED
+from pyanaconda.constants import IPMI_ABORTED, WINDOW_TITLE_TEXT
from pyanaconda import product, iutil, constants
from pyanaconda import threads
@@ -394,7 +394,7 @@ class MainWindow(Gtk.Window):
# a titlebar which contains the __init__.py header text by
default.
# As all Anaconda and Initial Setup usually have a very
distinct title text
# inside the window, the titlebar text is redundant and
should be disabled.
- self.set_title("")
+ self.set_title(_(WINDOW_TITLE_TEXT))
# Set the icon used in the taskbar of window managers that
have a taskbar
# The "anaconda" icon is part of fedora-logos
diff --git a/pyanaconda/ui/gui/spokes/welcome.py
b/pyanaconda/ui/gui/spokes/welcome.py
index 3188496..7a909ba 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -38,7 +38,7 @@ from pyanaconda import flags
from pyanaconda import geoloc
from pyanaconda.i18n import _, C_
from pyanaconda.iutil import is_unsupported_hw, ipmi_report
-from pyanaconda.constants import DEFAULT_LANG, DEFAULT_KEYBOARD,
IPMI_ABORTED
+from pyanaconda.constants import DEFAULT_LANG, DEFAULT_KEYBOARD,
IPMI_ABORTED, WINDOW_TITLE_TEXT
import logging
log = logging.getLogger("anaconda")
@@ -273,6 +273,16 @@ class WelcomeLanguageSpoke(LangLocaleHandler,
StandaloneSpoke):
self.window.set_property("distribution",
distributionText().upper())
self.window.retranslate()
+ # Retranslate the window title text
+ # - it looks like that the main window object is not yet
+ # properly initialized during the first run of the
+ # retranslate method (it is always triggered at startup)
+ # so make sure the object is actually what we think it is
+ # - ignoring this run is OK as the initial title is
+ # already translated to the initial language
+ if hasattr(self.main_window, "set_title"):
+ self.main_window.set_title(_(WINDOW_TITLE_TEXT))
+
def refresh(self):
self._select_locale(self.data.lang.lang)
self._languageEntry.set_text("")
Looks good to me otherwise.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic