Re: Disable stuff automatically in dialogs with read-only

2020-12-19 Thread Jean-Marc Lasgouttes

Le 07/12/2020 à 19:18, Jean-Marc Lasgouttes a écrit :

Le 02/12/2020 à 15:35, Jürgen Spitzmüller a écrit :

Am Dienstag, dem 01.12.2020 um 10:46 -0500 schrieb Richard Kimberly
Heck:

Jürgen knows the most about this, I think, but my sense is that (2)
is
the way to go. I find the ButtonController quite difficult to use.


I tend to agree.


OK, I have handled the search-type and spell-type dialogs.

Now what do we expect for other document-related dialog. The three 
solutions are


1/ disable the dialog (like GuiCharacter)
2/ disable each and every widget when the document is read-only 
(GuiExternal, but the ButtonController::addReadOnly thing is broken as 
you know))

3/ or just rely on the button controller to disable the OK/Apply buttons?


Ping! Any idea?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Disable stuff automatically in dialogs with read-only

2020-12-07 Thread Jean-Marc Lasgouttes

Le 02/12/2020 à 15:35, Jürgen Spitzmüller a écrit :

Am Dienstag, dem 01.12.2020 um 10:46 -0500 schrieb Richard Kimberly
Heck:

Jürgen knows the most about this, I think, but my sense is that (2)
is
the way to go. I find the ButtonController quite difficult to use.


I tend to agree.


OK, I have handled the search-type and spell-type dialogs.

Now what do we expect for other document-related dialog. The three 
solutions are


1/ disable the dialog (like GuiCharacter)
2/ disable each and every widget when the document is read-only 
(GuiExternal, but the ButtonController::addReadOnly thing is broken as 
you know))

3/ or just rely on the button controller to disable the OK/Apply buttons?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Disable stuff automatically in dialogs with read-only

2020-12-03 Thread Jean-Marc Lasgouttes

Le 02/12/2020 à 15:35, Jürgen Spitzmüller a écrit :

Am Dienstag, dem 01.12.2020 um 10:46 -0500 schrieb Richard Kimberly
Heck:

Jürgen knows the most about this, I think, but my sense is that (2)
is
the way to go. I find the ButtonController quite difficult to use.


I tend to agree.


Thanks, I began to do that (old search and new search). I do not know 
though what we want for dialogs like External, where everything is 
supposed to be disabled for read-only.


I am not sure either of where is the good place to do that, both in old 
style GuiDialog and in new-style ones.


JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Disable stuff automatically in dialogs with read-only

2020-12-02 Thread Jürgen Spitzmüller
Am Dienstag, dem 01.12.2020 um 10:46 -0500 schrieb Richard Kimberly
Heck:
> Jürgen knows the most about this, I think, but my sense is that (2)
> is
> the way to go. I find the ButtonController quite difficult to use.

I tend to agree.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Disable stuff automatically in dialogs with read-only

2020-12-01 Thread Richard Kimberly Heck
On 12/1/20 9:50 AM, Jean-Marc Lasgouttes wrote:
> Dear all,
>
> ButtonController has a addReadonly() feature that allows to control
> which widgets should be disabled in read-only mode. It add the widgets
> to a read_only_ vector, but this vector is never used? Why?
>
> The answer is that the code was disabled a long time ago, and (partly)
> removed.
>
> commit 78ade7e6ec18b8f34645f5629500a79e103dda72
> Author: Richard Kimberly Heck 
> Date:   Fri Feb 28 00:08:30 2020 -0500
>
>     Remove code that has not been used for 13 years.
>
>
>
> The better answer, though, is that the disabling clashed with
> hand-made disabling and got disabled rather than fixed.
>
> Author: Uwe Stöhr 
> Date:   Thu Sep 27 21:03:26 2007 +
>
>     ButtonController.cpp: fix a bug introduced in r20018: don't enable
> all widgets in the dialog, see
> http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128222.html
>
> The archive above explains that this enabling/disabling clashes with
> explicit disabling like in the Box dialog.
>
> So the very unsatisfying situation is that we have code in dialogs
> which annotates which widgets should be disabled in read-only mode,
> but these calls do nothing.
>
> Any bright idea on how to fix this?
>
> I see two approaches:
>
> 1/ add a ButtonController::setDisabled(widget, bool) and use that
> everywhere instead of explicit calls to QWidget::setEnabled
>
> 2/ consider that ButtonController is already ugly enough and replace
> all addReadOnly calls with proper hand-made setEnabled calls on the
> relevant widgets.
>
> Any idea from people who know more than I do about dialogs?

Jürgen knows the most about this, I think, but my sense is that (2) is
the way to go. I find the ButtonController quite difficult to use.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Disable stuff automatically in dialogs with read-only

2020-12-01 Thread Jean-Marc Lasgouttes

Dear all,

ButtonController has a addReadonly() feature that allows to control 
which widgets should be disabled in read-only mode. It add the widgets 
to a read_only_ vector, but this vector is never used? Why?


The answer is that the code was disabled a long time ago, and (partly) 
removed.


commit 78ade7e6ec18b8f34645f5629500a79e103dda72
Author: Richard Kimberly Heck 
Date:   Fri Feb 28 00:08:30 2020 -0500

Remove code that has not been used for 13 years.



The better answer, though, is that the disabling clashed with hand-made 
disabling and got disabled rather than fixed.


Author: Uwe Stöhr 
Date:   Thu Sep 27 21:03:26 2007 +

ButtonController.cpp: fix a bug introduced in r20018: don't enable 
all widgets in the dialog, see 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg128222.html


The archive above explains that this enabling/disabling clashes with 
explicit disabling like in the Box dialog.


So the very unsatisfying situation is that we have code in dialogs which 
annotates which widgets should be disabled in read-only mode, but these 
calls do nothing.


Any bright idea on how to fix this?

I see two approaches:

1/ add a ButtonController::setDisabled(widget, bool) and use that 
everywhere instead of explicit calls to QWidget::setEnabled


2/ consider that ButtonController is already ugly enough and replace all 
addReadOnly calls with proper hand-made setEnabled calls on the relevant 
widgets.


Any idea from people who know more than I do about dialogs?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel