From ef72c7c04d4248550a21e24843bcb9e69e95ab1b Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Tue, 5 Jun 2018 13:52:15 +0200 Subject: [PATCH 1/5] "Next" button was not visible in ncurses (bsc#1093358) Wanting to make the LogView widget 1000 lines tall made it - fit the screen - but crowd out the bottom line of buttons Making it shorter but stretchable fixes that. --- src/include/support/dialogs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/support/dialogs.rb b/src/include/support/dialogs.rb index 016545d..c2d7c61 100644 --- a/src/include/support/dialogs.rb +++ b/src/include/support/dialogs.rb @@ -867,7 +867,7 @@ def ContactDialog def GenerateDialog caption = _("Collecting Data") - contents = VBox(LogView(Id(:log), _("Progress"), 1000, 1000)) + contents = VBox(LogView(Id(:log), Opt(:vstretch), _("Progress"), 10, 1000)) Wizard.SetContentsButtons( caption, contents, From e4fe1d35f823e58884e32223dc26ec342f3e6c8d Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Thu, 30 Aug 2018 15:53:03 +0200 Subject: [PATCH 2/5] Factored out a UI helper to make the next fix easier to see --- src/include/support/dialogs.rb | 83 +++++++--------------------------- 1 file changed, 17 insertions(+), 66 deletions(-) diff --git a/src/include/support/dialogs.rb b/src/include/support/dialogs.rb index c2d7c61..3687814 100644 --- a/src/include/support/dialogs.rb +++ b/src/include/support/dialogs.rb @@ -677,6 +677,15 @@ def ExpertDialog Convert.to_symbol(ret) end + # A helper to construct the UI + # @param id [Symbol] + # @param label [String] + # @param key [String] key in Support.options + def input_field(id, label, key) + value = Support.options.fetch(key, "") + Left(InputField(Id(id), label, value)) + end + # Configure2 dialog # @return dialog result def ContactDialog @@ -688,67 +697,13 @@ def ContactDialog Frame( _("Contact Information"), VBox( - Left( - InputField( - Id(:company), - _("Company"), - Ops.get_string( - Support.options, - "VAR_OPTION_CONTACT_COMPANY", - "" - ) - ) - ), - Left( - InputField( - Id(:email), - _("Email Address"), - Ops.get_string(Support.options, "VAR_OPTION_CONTACT_EMAIL", "") - ) - ), - Left( - InputField( - Id(:name), - _("Name"), - Ops.get_string(Support.options, "VAR_OPTION_CONTACT_NAME", "") - ) - ), - Left( - InputField( - Id(:phone), - _("Phone Number"), - Ops.get_string(Support.options, "VAR_OPTION_CONTACT_PHONE", "") - ) - ), - Left( - InputField( - Id(:storeid), - _("Store ID"), - Ops.get_string( - Support.options, - "VAR_OPTION_CONTACT_STOREID", - "" - ) - ) - ), - Left( - InputField( - Id(:terminalid), - _("Terminal ID"), - Ops.get_string( - Support.options, - "VAR_OPTION_CONTACT_TERMINALID", - "" - ) - ) - ), - Left( - InputField( - Id(:gpg_uid), - _("GPG UID"), - Ops.get_string(Support.options, "VAR_OPTION_GPG_UID", "") - ) - ) + input_field(:company, _("Company"), "VAR_OPTION_CONTACT_COMPANY"), + input_field(:email, _("Email Address"), "VAR_OPTION_CONTACT_EMAIL"), + input_field(:name, _("Name"), "VAR_OPTION_CONTACT_NAME"), + input_field(:phone, _("Phone Number"), "VAR_OPTION_CONTACT_PHONE"), + input_field(:storeid, _("Store ID"), "VAR_OPTION_CONTACT_STOREID"), + input_field(:terminalid, _("Terminal ID"), "VAR_OPTION_CONTACT_TERMINALID"), + input_field(:gpg_uid, _("GPG UID"), "VAR_OPTION_GPG_UID") ) ), Frame( @@ -759,11 +714,7 @@ def ContactDialog Id(:target), _("Upload Target"), Builtins.deletechars( - Ops.get_string( - Support.options, - "VAR_OPTION_UPLOAD_TARGET", - "" - ), + Support.options.fetch("VAR_OPTION_UPLOAD_TARGET", ""), "'" ) ) From 8f209bd17ea59a0945a20e529da191432f00c991 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Thu, 30 Aug 2018 15:58:32 +0200 Subject: [PATCH 3/5] Make the Contact Information screen fit in a 80x24 terminal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by splitting a single vertical list of items into 2 columns: ``` ┌Contact Information───────────────────────────────────────────────────────┐ │Company Store ID │ │▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ │ │Email Address Terminal ID │ │▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒ │ │Name GPG UID │ │▒▒▒▒▒ ▒▒▒▒▒▒▒ │ │Phone Number │ │▒▒▒▒▒▒▒▒▒▒▒▒ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────┘ ``` --- src/include/support/dialogs.rb | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/include/support/dialogs.rb b/src/include/support/dialogs.rb index 3687814..93fabb6 100644 --- a/src/include/support/dialogs.rb +++ b/src/include/support/dialogs.rb @@ -696,14 +696,22 @@ def ContactDialog contents = VBox( Frame( _("Contact Information"), - VBox( - input_field(:company, _("Company"), "VAR_OPTION_CONTACT_COMPANY"), - input_field(:email, _("Email Address"), "VAR_OPTION_CONTACT_EMAIL"), - input_field(:name, _("Name"), "VAR_OPTION_CONTACT_NAME"), - input_field(:phone, _("Phone Number"), "VAR_OPTION_CONTACT_PHONE"), - input_field(:storeid, _("Store ID"), "VAR_OPTION_CONTACT_STOREID"), - input_field(:terminalid, _("Terminal ID"), "VAR_OPTION_CONTACT_TERMINALID"), - input_field(:gpg_uid, _("GPG UID"), "VAR_OPTION_GPG_UID") + HBox( + Top( + VBox( + input_field(:company, _("Company"), "VAR_OPTION_CONTACT_COMPANY"), + input_field(:email, _("Email Address"), "VAR_OPTION_CONTACT_EMAIL"), + input_field(:name, _("Name"), "VAR_OPTION_CONTACT_NAME"), + input_field(:phone, _("Phone Number"), "VAR_OPTION_CONTACT_PHONE") + ) + ), + Top( + VBox( + input_field(:storeid, _("Store ID"), "VAR_OPTION_CONTACT_STOREID"), + input_field(:terminalid, _("Terminal ID"), "VAR_OPTION_CONTACT_TERMINALID"), + input_field(:gpg_uid, _("GPG UID"), "VAR_OPTION_GPG_UID") + ) + ) ) ), Frame( From bedb40184e3f6860ab1da387c394241b6cc704c1 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Thu, 30 Aug 2018 15:02:23 +0200 Subject: [PATCH 4/5] version + changelog --- package/yast2-support.changes | 8 ++++++++ package/yast2-support.spec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package/yast2-support.changes b/package/yast2-support.changes index 359e123..f5544a8 100644 --- a/package/yast2-support.changes +++ b/package/yast2-support.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Aug 30 13:01:32 UTC 2018 - mvidner@suse.com + +- In ncurses the "Next" button to submit the gathered information + was not visible (bsc#1093358) +- Made the Contact Information screen fit in a 80x24 terminal +- 3.1.8 + ------------------------------------------------------------------- Fri Jun 16 08:08:10 UTC 2017 - jreidinger@suse.com diff --git a/package/yast2-support.spec b/package/yast2-support.spec index 8dc898a..1dd4213 100644 --- a/package/yast2-support.spec +++ b/package/yast2-support.spec @@ -17,7 +17,7 @@ Name: yast2-support -Version: 3.1.7 +Version: 3.1.8 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build From c61c7e88331f1deb707470bbe33b09161b9b7938 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Fri, 31 Aug 2018 13:31:59 +0200 Subject: [PATCH 5/5] Make the F10 shortcut for Next visible (bsc#1106744) --- src/include/support/dialogs.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/include/support/dialogs.rb b/src/include/support/dialogs.rb index 93fabb6..5c00474 100644 --- a/src/include/support/dialogs.rb +++ b/src/include/support/dialogs.rb @@ -826,7 +826,10 @@ def ContactDialog def GenerateDialog caption = _("Collecting Data") - contents = VBox(LogView(Id(:log), Opt(:vstretch), _("Progress"), 10, 1000)) + contents = VBox( + ReplacePoint(Id(:rp), Empty()), + LogView(Id(:log), Opt(:vstretch), _("Progress"), 10, 1000) + ) Wizard.SetContentsButtons( caption, contents, @@ -875,6 +878,7 @@ def GenerateDialog end else Wizard.EnableNextButton + UI.ReplaceWidget(Id(:rp), Empty()) # work around bsc#1106744 break end ret = Convert.to_symbol(UI.PollInput)