On Fri, 2013-03-08 at 14:57 +0100, Martin Sivak wrote:
---
pyanaconda/ui/tui/__init__.py | 15 +++++++++++++--
pyanaconda/ui/tui/simpleline/base.py | 6 ++++--
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py
index 8da9846..d051590 100644
--- a/pyanaconda/ui/tui/__init__.py
+++ b/pyanaconda/ui/tui/__init__.py
@@ -116,7 +116,9 @@ class TextUserInterface(ui.UserInterface):
ENVIRONMENT = "anaconda"
- def __init__(self, storage, payload, instclass):
+ def __init__(self, storage, payload, instclass,
+ productTitle = u"Anaconda", isFinal = True,
+ quitMessage = None):
"""
For detailed description of the arguments see
the parent class.
@@ -129,12 +131,20 @@ class TextUserInterface(ui.UserInterface):
:param instclass: install class reference
:type instclass: instance of install class
+
+ :param productTitle: the name of the product
+ :type productTitle: unicode string
+
The quitMessage parameter could be documented as well with the mention
about the fact it shouldn't be translated (_() is called later on it).
"""
ui.UserInterface.__init__(self, storage, payload, instclass)
self._app = None
self._meh_interface = meh.ui.text.TextIntf()
+ self.productTitle = productTitle
+ self.isFinal = isFinal
+ self.quitMessage = quitMessage
+
basemask = "pyanaconda.ui.tui"
basepath = os.path.dirname(__file__)
updatepath = "/tmp/updates/pyanaconda/ui/tui"
@@ -171,7 +181,8 @@ class TextUserInterface(ui.UserInterface):
"""Construct all the objects required to implement this
interface.
This method must be provided by all subclasses.
"""
- self._app = tui.App(u"Anaconda", yes_or_no_question=YesNoDialog,
queue=communication.hubQ)
+ self._app = tui.App(self.productTitle, yes_or_no_question = YesNoDialog,
+ quit_message = self.quitMessage)
_hubs = self._list_hubs()
# First, grab a list of all the standalone spokes.
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index 131a54a..0dbfa04 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -62,7 +62,8 @@ class App(object):
STOP_MAINLOOP = False
NOP = None
- def __init__(self, title, yes_or_no_question = None, width = 80, queue = None):
+ def __init__(self, title, yes_or_no_question = None, width = 80, queue = None,
+ quit_message = None):
"""
:param title: application title for whenever we need to display app name
:type title: unicode
@@ -78,6 +79,7 @@ class App(object):
self._spacer = "\n".join(2*[width*"="])
self._width = width
self.quit_question = yes_or_no_question
+ self.quit_message = quit_message or u"Do you really want to quit?"
I believe you have to mark the string for translation here with N_().
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic