Can't validate data in project options dialog?

Vladimir Prus ghost at cs.msu.su
Wed Aug 31 09:53:03 UTC 2005


Hi,
I would like to add some validation to the debugger config dialog,
but see no way to do that.

The "project options" dialog is a KDialogBase, and debugger options dialog
is a page in KDialogBase. The okClicked() signal of KDialogBase is connected
to 'accept' slot in debugger options dialog.

The problems:
1. When user clicks "OK", and the DebuggerConfigWidget::accept is called,
there's no way to prevent dialog from being closed if some data is invalid.
If that were QDialog, I'd override the accept virtual method and simple
don't call the base version if validation failed. 

2. User might have navigated to another page.

So, the situation could be
1. User entered invalid data in debugger options
2. User selected some other page and changed something there.
3. User clicks "OK".

The best I can do is to show warning referring to currently invisible page,
and after that dialog will still close, and user will have to open it again, 
and select debugger options page just to fix the problem.

Any better ideas?

- Volodya






More information about the KDevelop-devel mailing list