i18n: improve title of connection dialog

Instead of using the title of the dialog and prepending the connection
label, create a new title as a single string. This way it is possible to
translate this title as single sentence.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2020-09-17 08:43:59 +02:00 committed by Cole Robinson
parent 519d409718
commit 8fbb985a8c
5 changed files with 6 additions and 7 deletions

View File

@ -53,7 +53,7 @@ class VMMDogtailApp(object):
self.root.find_fuzzy("Edit", "menu").click()
self.root.find_fuzzy("Connection Details", "menu item").click()
win = self.root.find_fuzzy(
"%s Connection Details" % conn_label, "frame")
"%s - Connection Details" % conn_label, "frame")
win.find_fuzzy(tab, "page tab").click()
return win

View File

@ -24,7 +24,7 @@ class VMMCLI(lib.testcase.UITestCase):
def testShowHost(self):
self.app.open(extra_opts=["--show-host-summary"])
lib.utils.check(lambda: self.app.topwin.name == "test testdriver.xml Connection Details")
lib.utils.check(lambda: self.app.topwin.name == "test testdriver.xml - Connection Details")
nametext = self.app.topwin.find_fuzzy("Name:", "text")
lib.utils.check(lambda: nametext.text == "test testdriver.xml")
self.app.topwin.keyCombo("<alt>F4")

View File

@ -166,7 +166,7 @@ class Host(lib.testcase.UITestCase):
# Change the name, verify that title bar changed
win.find("Name:", "text").set_text("FOOBAR")
self.app.root.find("FOOBAR Connection Details", "frame")
self.app.root.find("FOOBAR - Connection Details", "frame")
# Open the manager window
win.find("File", "menu").click()

View File

@ -7,7 +7,7 @@
<property name="width_request">800</property>
<property name="height_request">600</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Connection Details</property>
<property name="title" translatable="no">Connection Details</property>
<property name="default_width">750</property>
<property name="default_height">500</property>
<accel-groups>

View File

@ -35,8 +35,6 @@ class vmmHost(vmmGObjectUI):
vmmGObjectUI.__init__(self, "host.ui", "vmm-host")
self.conn = conn
self._orig_title = self.topwin.get_title()
# Set default window size
w, h = self.conn.get_details_window_size()
if w <= 0:
@ -177,7 +175,8 @@ class vmmHost(vmmGObjectUI):
conn_active = self.conn.is_active()
self.topwin.set_title(
self.conn.get_pretty_desc() + " " + self._orig_title)
_("%(connection)s - Connection Details") %
{"connection": self.conn.get_pretty_desc()})
if not self.widget("overview-name").has_focus():
self.widget("overview-name").set_text(self.conn.get_pretty_desc())