Re: [Evolution-hackers] Re: error messages





Well I started looking at an api, but i really don't like it.  But it covers everything we need, I think (almost?):
- need to be able to customise button text (do we also need to use stock icons with non-stock text?  we do currently in some cases).
- need to be able to set primary and secondary texts separately, to make the code cleaner
- need to be able to do synchronous and asynchronous requests

Anyway, this maps almost directly to these calls:

GtkWidget *e_error_dialog_new(GtkWindow *parent, enum _e_error_dialog_t type, const char *button, ...);
- sets up type, parent and buttons
void e_error_dialog_set_primary(EErrorDialog *eed, const char *fmt, ...);
void e_error_dialog_set_secondary(EErrorDialog *eed, const char *fmt, ...);
- sets error text(s)
int e_error_dialog_run_and_close(EErrorDialog *eed);
- combines the error texts into markup and sets the label content, does a gtk_dialog_run, destroys the widget, and returns the button hit.
void e_error_dialog_show(EErrorDialog *eed);
  - combines the error texts into markup and sets the label content, then gtk_widget_show's the widget.

Sigh.  The more I look at this, the more the xml idea looks nice.  The above code isn't much to write (and i've done half of it in under an hour), and I guess its _only_ 4 calls to use in the shortest case, but ...


Michael Zucchi <notzed ximian com>

Ximian Evolution and Free Software Developer


Novell, Inc.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]