[yast-devel] New YCP module: Icon
Hi, I've just finished a short introduction of new YCP Module "Icon" in the openSUSE wiki: http://en.opensuse.org/YaST/Development/Modules/Icon This new YCP module simplifies using icons in your dialogs. By now it only supports 32x32 icons but could be extended if needed. "Icon" YCP module can be found in yast2-2.16.16 and later. Dialogs, especially pop-ups should use icons to emphasize the message to a user. Moreover it's better to use unified icons for the same tasks (one icon for warnings, another one for errors, ...). This is how Icon module deals with it: Icon::Simple ("warning") -> returns UI term Icon::Simple ("error") -> returns UI term Bye Lukas -- Lukas Ocilka, YaST Developer (xn--luk-gla45d) ----------------------------------------------------------------- SUSE LINUX, s. r. o., Lihovarska 1060/12, Praha 9, Czech Republic
On po 3. prosince 2007, Lukas Ocilka wrote:
Hi,
I've just finished a short introduction of new YCP Module "Icon" in the openSUSE wiki: http://en.opensuse.org/YaST/Development/Modules/Icon
Cool!
...
This is how Icon module deals with it: Icon::Simple ("warning") -> returns UI term Icon::Simple ("error") -> returns UI term
Could you create also the shortcuts like Icon::SimpleWarning Icon::SimpleError (or even Icon::Warning etc. if you don't intend to make Icon::Complex) so the naming style of those functions is closer to the one used by Popup/Report modules? Thanks, Jiri -- Jiri Suchomel SUSE LINUX, s.r.o. e-mail: jsuchome@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Praha 9, Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Jiří Suchomel napsal(a):
This is how Icon module deals with it: Icon::Simple ("warning") -> returns UI term Icon::Simple ("error") -> returns UI term
Could you create also the shortcuts like Icon::SimpleWarning Icon::SimpleError
(or even Icon::Warning etc. if you don't intend to make Icon::Complex)
so the naming style of those functions is closer to the one used by Popup/Report modules?
Good idea, thanks. These new functions have been added just now: * Icon::Warning() * Icon::Error() * Icon::Info() --- simple example --- { import "Icon"; textdomain "test"; UI::OpenDialog ( `opt (`decorated), `VBox ( `MarginBox (2,1, `HBox ( `HWeight(1, `VBox (`Label (_("Warning")), Icon::Warning())), `HWeight(1, `VBox (`Label (_("Error")), Icon::Error())), `HWeight(1, `VBox (`Label (_("Info")), Icon::Info())) )), `PushButton (_("&OK")) ) ); UI::UserInput(); UI::CloseDialog(); } --- simple example --- Bye Lukas
Lukas Ocilka napsal(a):
Jiří Suchomel napsal(a):
This is how Icon module deals with it: Icon::Simple ("warning") -> returns UI term Icon::Simple ("error") -> returns UI term Could you create also the shortcuts like Icon::SimpleWarning Icon::SimpleError
(or even Icon::Warning etc. if you don't intend to make Icon::Complex)
Good idea, thanks. These new functions have been added just now:
* Icon::Warning() * Icon::Error() * Icon::Info()
--- simple example --- ... --- simple example ---
BTW: That related wiki page has been updated: http://en.opensuse.org/YaST/Development/Modules/Icon Have a nice day L.
Ter, 2007-12-04 às 09:59 +0100, Lukas Ocilka escreveu:
Jiří Suchomel napsal(a):
This is how Icon module deals with it: Icon::Simple ("warning") -> returns UI term Icon::Simple ("error") -> returns UI term
Could you create also the shortcuts like Icon::SimpleWarning Icon::SimpleError
(or even Icon::Warning etc. if you don't intend to make Icon::Complex)
so the naming style of those functions is closer to the one used by Popup/Report modules?
Good idea, thanks. These new functions have been added just now:
Hi, I would rather you guys let the UI-bridge provide the icons as we are in a better position to honor user's settings. Besides, we might want yast-ncurses to do a colored frames, or do some vertical Warning label or something... So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there. Cheers, Ricardo
* Icon::Warning() * Icon::Error() * Icon::Info()
--- simple example --- { import "Icon";
textdomain "test";
UI::OpenDialog ( `opt (`decorated), `VBox ( `MarginBox (2,1, `HBox ( `HWeight(1, `VBox (`Label (_("Warning")), Icon::Warning())), `HWeight(1, `VBox (`Label (_("Error")), Icon::Error())), `HWeight(1, `VBox (`Label (_("Info")), Icon::Info())) )), `PushButton (_("&OK")) ) ); UI::UserInput(); UI::CloseDialog(); } --- simple example ---
Bye Lukas
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Am Dienstag 04 Dezember 2007 schrieb Ricardo Cruz:
I would rather you guys let the UI-bridge provide the icons as we are in a better position to honor user's settings. Besides, we might want yast-ncurses to do a colored frames, or do some vertical Warning label or something...
So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there.
Sounds right to me. The problem is always that a ycp solution is easy to do for a single developer, while UI provides usually require 3-4 developers to come up with a solution ;( But I'm fine with the current solution too. Greetings, Stephan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Tuesday 04 December 2007 19:59, Ricardo Cruz wrote:
I would rather you guys let the UI-bridge provide the icons as we are in a better position to honor user's settings. Besides, we might want yast-ncurses to do a colored frames, or do some vertical Warning label or something...
I agree: This kind of thing should rather be in the UI level. Yet, since we have that centralized YCP module, I don't see that as very critical.
So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there.
`opt(`warnColor) should be used _very_ sparingly; so far, we only used it for
very critical situations that warrant some extra attention (with "screaming"
colors).
CU
--
Stefan Hundhammer
Stephan Kulow napsal(a):
Am Dienstag 04 Dezember 2007 schrieb Ricardo Cruz:
I would rather you guys let the UI-bridge provide the icons as we are in a better position to honor user's settings. Besides, we might want yast-ncurses to do a colored frames, or do some vertical Warning label or something...
So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there.
Sounds right to me. The problem is always that a ycp solution is easy to do for a single developer, while UI provides usually require 3-4 developers to come up with a solution ;(
But I'm fine with the current solution too.
I've found that it's easier for developers to use Icon::$whatever because it's better understandable for them and thus better-controllable. Of course, Dialog (`opt (`warn)) can be more easily redefined by the UI (ncurses don't support images but could solve it somehow else). I'd vote for having such support in UI. Anyway, Icon YCP module is for a general use, it's not only for warnings, errors and infos it's been intended for a more general use, warnings (etc.) are just extensions. See these examples how Icon:: module can be used: ==Installation Mode dialog== http://en.opensuse.org/Image:YaST-Installation-Mode-Dialog.png ==Progress with Icons== http://en.opensuse.org/Image:YaST-ProgressWithIcons-Example-InProgress.png and many more... Using images should help user to understand faster the meaning of presented information or options. Bye Lukas
Lukas Ocilka napsal(a):
Stephan Kulow napsal(a):
Am Dienstag 04 Dezember 2007 schrieb Ricardo Cruz:
I would rather you guys let the UI-bridge provide the icons as we are in a better position to honor user's settings. Besides, we might want yast-ncurses to do a colored frames, or do some vertical Warning label or something...
So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there.
Sounds right to me. The problem is always that a ycp solution is easy to do for a single developer, while UI provides usually require 3-4 developers to come up with a solution ;(
But I'm fine with the current solution too.
I've found that it's easier for developers to use Icon::$whatever because it's better understandable for them and thus better-controllable.
Of course, Dialog (`opt (`warn)) can be more easily redefined by the UI (ncurses don't support images but could solve it somehow else). I'd vote for having such support in UI.
I forgot one important thing: It's very common that one YaST scripts ones up a Wizard window (with installation steps, for instance) and the rest of scripts, that called by that script, just call SetContents/Buttons. Warning, Info and Error icons don't need to be used *only* in pop-ups created by UI::OpenDialog(). L.
Qua, 2007-12-05 às 12:00 +0100, Stefan Hundhammer escreveu:
So, why not adding some `warn, `error, `info to UI::OpenDialog()? It would also make it nicer for YCP writers. Btw, checkout `warnColor and `errorColor on yast-gtk. It will use your style icon there.
`opt(`warnColor) should be used _very_ sparingly; so far, we only used it for very critical situations that warrant some extra attention (with "screaming" colors).
The yast-qt green color is actually pretty nice. Not scary at all.Anyway, replaced the icon with a skull which should make the user jump off his chair. :P Cheers, Ricardo -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (5)
-
Jiří Suchomel
-
Lukas Ocilka
-
Ricardo Cruz
-
Stefan Hundhammer
-
Stephan Kulow