for the citation dialog which disconnects. Should be much more intuitive
behaviour again.
Non-inset dialogs (eg preamble): connect() on show, enabling the dialog to
act on an updateBufferDependent signal. Change buffer and the preamble
will update! (rather embarrassed that this bug crept in!)
Angus
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2735
a592a061-630c-0410-9148-
cb99ea01b6c8
+2001-09-12 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlInset.h (disconnectOnApply): new method. Defines the behaviour
+ of the dialog when the Apply button is pressed. Defaults to false,
+ but can be overridden in the daughter classes.
+
+ * ControlCitation.h (disconnectOnApply): new method. Set to true.
+ Perhaps make this user-modifiable?
+
+2001-09-11 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlDialogs.h (show): connect() the dialog on show. All of a sudden
+ we have dialogs that update their contents when the buffer changes.
+ Rather embarassing, really!
+
2001-09-07 Angus Leeming <a.leeming@ic.ac.uk>
* ControlSearch (replace): change semantics of replace to NOT move on
///
virtual void clearDaughterParams();
+ /** disconnect from the inset when the Apply button is pressed.
+ Allows easy insertion of multiple citations. */
+ virtual bool disconnectOnApply() { return true; }
+
/// The info associated with each key
biblio::InfoMap bibkeysInfo_;
u_.disconnect();
ControlConnectBase::disconnect();
}
-
/// set the params before show or update
virtual void setParams() {}
+private:
/// is the dialog built ?
bool dialog_built_;
};
if (isBufferDependent() && !lv_.view()->available())
return;
+ connect();
+
setParams();
if (!dialog_built_) {
Inset * inset() const;
private:
- /** These 6 methods are all that the individual daughter classes
+ /** These 7 methods are all that the individual daughter classes
should need to instantiate. */
/// if the inset exists then do this...
/// clean-up any daughter class-particular data on hide().
virtual void clearDaughterParams() {}
+ /** Some dialogs may find it beneficial to disconnect from the inset
+ when the Apply button is pressed. E.g., doing this with the citation
+ dialog allows multiple citiations to be inserted easily. */
+ virtual bool disconnectOnApply() { return false; }
else
applyParamsNoInset();
- if (!isClosing()) {
+ if (disconnectOnApply() && !isClosing()) {
*params_ = getParams(string());
inset_ = 0;
ih_.disconnect();
: ControlDialog<ControlConnectBD>(lv, d),
params_(0)
{
- d_.showPreamble.connect(SigC::slot(this, &ControlPreamble::show));
+ d_.showPreamble.connect(SigC::slot(this, &ControlPreamble::show));
}