[yast-devel] PATCH: Clean up library to set dialog title and icon

Hi! I wanted to start setting the dialog title for YaST dialogs and found out there is the infastructure prepared on the libyui-side. Just YCP does not use it. This patch improves the Wizard library a bit to do setting both icon and dialog title for the wizard dialog - the values are taken from the .desktop file and are localized. All you need to do in a module now is to replace Wizard::SetDesktopIcon("desktop-file-name"); to Wizard::SetDesktopTitleAndIcon("desktop-file-name"); If you accept the patch, I will go through the modules and start to change them to use the new functionality. Comments welcome! Stano P.S. There is no testsuite at the moment - desktop file reading involves agents (see Lukas' mail about trouble there), also Wizard testsuite is rather non-existent.

Stanislav Visnovsky write:
Hi!
I wanted to start setting the dialog title for YaST dialogs and found out there is the infastructure prepared on the libyui-side. Just YCP does not use it.
This patch improves the Wizard library a bit to do setting both icon and dialog title for the wizard dialog - the values are taken from the .desktop file and are localized.
All you need to do in a module now is to replace
Wizard::SetDesktopIcon("desktop-file-name");
to
Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
Comments welcome!
Stano
P.S. There is no testsuite at the moment - desktop file reading involves agents (see Lukas' mail about trouble there), also Wizard testsuite is rather non-existent.
Patch looks fine, especially refactoring to separate method getLanguage functionality, which looks quite tricky. Own agent inlined to code looks...egh, tricky for me and little decrease readability of code and also increase duplicity. Also redefiniting it everytime looks like wasting for me. Can we store it somewhere and just say register/unregister instead always define it again? Josef -- Josef Reidinger Appliance Toolkit team maintaining parts of webyast and SLMS author of rubygems - studio_api and net_observer (coauthor) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hello, On Sep 15 12:20 Stanislav Visnovsky wrote (excerpt):
All you need to do in a module now is to replace Wizard::SetDesktopIcon("desktop-file-name"); to Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service. If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hi Johannes! On Thursday 15 of September 2011 12:41:04 Johannes Meixner wrote:
Hello,
On Sep 15 12:20 Stanislav Visnovsky wrote (excerpt):
All you need to do in a module now is to replace
Wizard::SetDesktopIcon("desktop-file-name");
to
Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service.
If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change.
So you would prefer not to change the title, correct? I can do the change using the old API if you prefer. Stano -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hello Stanislav, On Sep 15 13:05 Stanislav Visnovsky wrote (excerpt):
On Thursday 15 of September 2011 12:41:04 Johannes Meixner wrote:
On Sep 15 12:20 Stanislav Visnovsky wrote (excerpt):
All you need to do in a module now is to replace
Wizard::SetDesktopIcon("desktop-file-name");
to
Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service.
If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change.
So you would prefer not to change the title, correct? I can do the change using the old API if you prefer.
As far as I see the current printer module dialogs have meaningful titles which match to the dialog header text so that from my point of view everything seems to be o.k. Those titles / header texts have been developed together with Martin Schmidkunz to ensure good usability (in particular to avoid titles / header texts which are meaningless for the user). I would not mind if the dialog title value for YaST dialogs is changed to something better (whathever "better" may mean in this case ;-). But I do care that whatever code there is in the printer module must work for SLE_11, SLE_11_SP1, openSUSE_11.3, openSUSE_11.4, and openSUSE_Factory. By all means I want to avoid that the printer module may somehow fail on those older platforms. I run the newest printer module on my SLED11-SP1 based workstation with day-to-day changing versions of CUPS (from stone age CUPS 1.1.x used in SLE9/10 up to CUPS 1.4.6 in openSUSE:Factory) and additionally with day-to-day changing printer driver packages. I want to be safe that our users can do the same. Bottom line: Any subtle dependency on "new stuff" which might let something fail in the printer module must be avoided. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hi Johannes! On Friday 16 of September 2011 08:59:18 Johannes Meixner wrote:
Hello Stanislav,
On Sep 15 13:05 Stanislav Visnovsky wrote (excerpt):
On Thursday 15 of September 2011 12:41:04 Johannes Meixner wrote:
On Sep 15 12:20 Stanislav Visnovsky wrote (excerpt):
All you need to do in a module now is to replace
Wizard::SetDesktopIcon("desktop-file-name");
to
Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service.
If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change.
So you would prefer not to change the title, correct? I can do the change using the old API if you prefer.
As far as I see the current printer module dialogs have meaningful titles which match to the dialog header text so that from my point of view everything seems to be o.k.
Those titles / header texts have been developed together with Martin Schmidkunz to ensure good usability (in particular to avoid titles / header texts which are meaningless for the user).
My original mail was talking about the 'window titles' - sorry for confusion. I've added 2 screenshots - before and after the change. I think I will send you a patch for consideration, you can then do a decision if you want to include it or not. Does it work for you? Stano

Hello Stanislav, On Sep 16 09:31 Stanislav Visnovsky wrote (excerpt):
My original mail was talking about the 'window titles'
Ah! Just do it if you can implement it so that it also works for SLE11. Otherwise (or if implementation for SLE11 needs unreasonable effort) better leave it as is to be on the safe side (nicer window titles are not important enough to risk a real failure). Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dne 16.9.2011 09:31, Stanislav Visnovsky napsal(a):
Those titles / header texts have been developed together with Martin Schmidkunz to ensure good usability (in particular to avoid titles / header texts which are meaningless for the user).
My original mail was talking about the 'window titles' - sorry for confusion. I've added 2 screenshots - before and after the change. I think I will send you a patch for consideration, you can then do a decision if you want to include it or not. Does it work for you?
Looks good and it's actually helpful :) Thanks Stano! Lukas - -- Lukas Ocilka, Appliances Department, SUSE LINUX s.r.o. MD: Jeff Hawn, Jennifer Guild, Alena Hendrichova -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iD8DBQFOc0vlVSqMdRCqTiwRAs9EAJ4tSoRcPSCGN6Zzf3rHJ45XJ/YQXACglxDo fWaNB6Zd4C5l4oriNuA3b2s= =zc8p -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dne 15.9.2011 12:41, Johannes Meixner napsal(a):
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service.
If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change.
But Johannes, this means we cannot do any backward-incompatible change for anything that is used by the YaST Printer module. IMO we might have to do some incompatible changes in SLE 12. Bye Lukas - -- Lukas Ocilka, Appliances Department, SUSE LINUX s.r.o. MD: Jeff Hawn, Jennifer Guild, Alena Hendrichova -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iD8DBQFOc0/eVSqMdRCqTiwRAtaeAJ9hx3U6bl9opcrGbtcJE1+ATYjKNACfUXxT nBPH/hIVtk2F/6gDrE/kcUU= =PHgN -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hello, On Sep 16 15:32 Lukas Ocilka wrote (excerpt):
Dne 15.9.2011 12:41, Johannes Meixner napsal(a):
I provide the newest printer module also for SLE_11, SLE_11_SP1, openSUSE_11.3, and openSUSE_11.4 via the Printing project in the openSUSE build service.
If Wizard::SetDesktopTitleAndIcon is not available there you would cause a regression by a backward-incomatible change.
But Johannes, this means we cannot do any backward-incompatible change for anything that is used by the YaST Printer module.
IMO we might have to do some incompatible changes in SLE 12.
It depends. What I mean is that I do not use "new stuff" when I can implement the same functionality with what is provided by YaST for SLE11 or when the functionality with is provided by the "new stuff" is not mandatory (the printer module is no rocket science). When the YaST team decides that this or that "old crap" which was present e.g. in SLE11 must be removed (e.g. like "Getting rid of Wizard_hw module") then this is of course o.k. - provided there is a sufficient announcement so that I know about it. Then I can decide how to deal with such a change. E.g. the usage of Wizard_hw in the scanner module was "Changed from old Wizard_hw to new WizardHW design" by me long ago (dated Fri Aug 5 2005 - see the changelog) because Wizard_hw was declared deprecated some time before. In this case I think still supporting deprecated stuff from 2005 up to 2011 is really sufficient time to adapt. Is the same time planned for the incompatible changes for SLE12 ? ;-) The printer module which is provided in SLE11 is more or less the initial state of the rewrite from scratch for openSUSE 11.1 with more or less all its initial issues as described at "Under construction for openSUSE 11.1" in http://en.opensuse.org/Archive:YaST_Printer_redesign All those issues are solved in the current printer module and currently (i.e. for openSUSE 11.4) there is no single issue except a few typos in the help texts, see https://bugzilla.novell.com/show_bug.cgi?id=703201 Therefore if there are major backward-incompatible changes for SLE12 for which there is no backport possible for SLE11 (at least not with reasonable effort) I think I could simply leave the current printer module as is for SLE11. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

Hi! On Thursday 15 of September 2011 12:20:54 Stanislav Visnovsky wrote:
Hi!
I wanted to start setting the dialog title for YaST dialogs and found out there is the infastructure prepared on the libyui-side. Just YCP does not use it.
This patch improves the Wizard library a bit to do setting both icon and dialog title for the wizard dialog - the values are taken from the .desktop file and are localized.
All you need to do in a module now is to replace
Wizard::SetDesktopIcon("desktop-file-name");
to
Wizard::SetDesktopTitleAndIcon("desktop-file-name");
If you accept the patch, I will go through the modules and start to change them to use the new functionality.
I basically adapted all the modules, except for Wagon, dns-server, firewall, registration and live-installer. These have non-trivial workflow control (or code to introduce the title is non-trivial), so I will leave this for now (and actual maintainers might step in ;-) ). Stano -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (4)
-
Johannes Meixner
-
Josef Reidinger
-
Lukas Ocilka
-
Stanislav Visnovsky