octave-patch-tracker
[Top][All Lists]
Advanced

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

[Octave-patch-tracker] [patch #7990] Add builtin Qt equivalents of UI di


From: Dan Sebald
Subject: [Octave-patch-tracker] [patch #7990] Add builtin Qt equivalents of UI dialogs, i.e., , qterrordlg, qtinputdlg, etc.
Date: Sun, 21 Apr 2013 10:01:03 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #21, patch #7990 (project octave):

Attached are some fixes and an implementation of questdlg.  I will intersperse
some comments below with the changeset comment.  Please leave this patch
report open because there is one thing I want to test at a later time; the
waitcondition behavior, see if I can break it.

COMMENTS:

* I changed all the conditional tests for platform inside the dialogs to this
format:


  if (isguirunning ())
    __octave_link_XYZ__ ()
  elseif (__have_feature__ ("JAVA"))
    javaMethod ()
  else
    error ();
  endif


It makes sense that "isguirunning" coincides with octave_link".  The other
ways that this was conditioned all seemed to have bugs because the return
condition of some of the dialogs returned values that make the condition pass.
 For example, canceling instead of selecting a button would produce a 0 for
Ok.

* octave-qt-link.cc (octave_qt_link::do_message_dialog):
Change initializer from QString() to QString::fromStdString (dlg).

The icons were missing from the dialogs.

* (octave_qt_link::do_list_dialog): Change std string 'prompt_string' to list
list of std string 'prompt'.

I set the prompt string to accept Rich Text (html) code.  This may not
ultimately be compatible with the definition, but I wanted to just try it to
see what the response is, how well it works etc.  I see that you were trying
to test RTF format with the \alpha value.  (I don't think the list entries
have an RTF or RT "delegate".  Can be done, but tricky.)

Anyway, the cell list structure needs to be carried all the way to the use
because <br> is the carriage return in Rich Text, not n.  I left a define in
the code to control the interpretation.

* Use make_qstring_list (prompt).

Why doesn't this work?:  QStringList::fromStdList (prompt)
Just curious.

* (octave_qt_link::do_input_dialog): Change 'nr' and 'nc' to std list of
float. Use QFloatList::fromStdList (nc).

I changed the nr and nc of the input dialog list sizes to QFloatList instead
of QIntList and then made the listdlg do rounding upward.  If you'd prefer to
use integer list all the way through, feel free to change it back.  Or let me
know and I'll create a separate patch which removes the QFloatList definition,
registration and all.

* errordlg.m (errordlg): Make retval return variable.

The return value wasn't showing up at the command line.

* Add "error" icon as message_dialog input.

Missing icon.

* message_dialog.m (message_dialog): Define default icon, "none".

Was creating error of missing icon variable under certain conditions.

* Remove FIXME note.

I felt that FIXME was more a TODO than a FIXME.  And it is somewhat low
priority, since a terminal based implementation would be kind of clunky.  How
would one handle a long list of items that gets dumped into the pager?  Also,
a programmer could come up with their own question/answer sort of terminal
interaction easily enough.  Lastly, it pretty clear where the terminal-based
implementation would go if someone really wanted to create one.

* listdlg.m (listdlg): Change default selmode from "multiple" to "Multiple".

This was causing problems in a demo.  "multiple" is unrecognized so the list
was turning out to be non-selectable.  I added a check to make sure the user
enters a valid selection mode.  That really should be there in any case.

* Make default prompt {}.

With {""} as the default prompt, the prompt has to be interpretted as a blank
line.  (Imagine that is what the user entered.)  The only way to get no prompt
is to make the cell list empty.

* questdlg.m (questdlg): Add case 0 to switch.

Bug when no inputs beyond the basics.  A scenario not tested by the demos.

* Add error message for default button not matching options. In all cases,
check that default button matches an button option.

Got to have this otherwise it is too easy for the user to type a mistake and
not realize the default isn't set.  These things can be confusing, so I think
it is worth pointing out the error.

* dialog.cc (QUIWidgetCreator::dialog_finished): Remove.
(QUIWidgetCreator::dialog_button_clicked): Test that button pointer nonzero.
Move dialog_result assignment and waitcondition.wakeAll here.

Took forever to find a decent setup.  The ESC key is automatically attached to
a button in most cases.  When that happens, both a button press and a
rejected() is emitted.  The upper close tab is associated with rejected(). 
End result was a race condition between causing two "Awakes" to occur. 
Sometimes a couple dialogs would appear in a string of questions.  I over-road
the closeEvent behavior to make only one route out of that dialog,
"buttonClicked".

* (MessageDialog::MessageDialog): If title "", change to " ".

The default system title was showing up in the window header bar with an empty
string.  I don't think we ever want to see that.  A blank header is preferred
if user hasn't specified.


(file #27917)
    _______________________________________________________

Additional Item Attachment:

File name: octave-dialog_fixes-2013apr21.patch Size:43 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?7990>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]