Re: Mahjongg Patch



Josh Barrow <drleary mac com> writes:
> > Shouldn't the "case" statements in the switch have become some sort of
> > enum value instead of the ints they probably were in the original?
> 
> I'm not *quite* sure what you mean here.  The attached patch doesn't
> have this fixed.

I mean replace this:
  switch (button_num) 
   {
      case 0:
      case 1:

with:

  switch (response_id)
   {
      case SOME_SYMBOLIC_NAME:
      case OTHER_SYMBOLIC_NAME:
 
etc.

> > > +
> > > +	response = gtk_dialog_run (GTK_DIALOG (pref_dialog));
> > > +
> > > +	if (response == GTK_RESPONSE_OK)
> > > +	{
> > > +		apply_preferences();
> > > +	}
> > > +        pref_cancel(NULL, NULL);
> > >  }
> > 
> > 
> > How does this interact with the callbacks that were also connected?
> > (Assuming they're changed to be connected to signals that exist?)
> 
> Not *quite* sure what you mean here.  The attached patch doesn't have
> this fixed.

I believe there were g_signal_connect (pref_dialog, "clicked") type of
connections to this dialog as well. It probably doesn't make sense to
connect those callbacks and also do the gtk_dialog_run().
 
> > 
> > > +
> > > +			gnome_app_ok_cancel_modal (GNOME_APP(window), confirm_text,
> > > +                                           	   confirm_callback,
> > > data);
> > 
> > Wow, this dumb function should have been deprecated. The code should
> > be rewritten probably to just use a dialog with more descriptive
> > buttons, to match the UI guidelines.
> 
> I'm not sure how to go about rewriting this.  Perhaps point me at some
> example code?
> 

The UI guys don't like OK/Cancel dialogs, they want buttons like
"Quit" and "Save", etc. that say what action will be taken. 

Example code is all over what you ported - just a GtkMessageDialog.

Havoc



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