mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Inset dialogs: remain connected to the inset on "Apply" by default, except
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
This commit is contained in:
parent
f093fd9b68
commit
798f00a0a8
@ -1,3 +1,18 @@
|
||||
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
|
||||
|
@ -48,6 +48,10 @@ private:
|
||||
///
|
||||
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_;
|
||||
|
||||
|
@ -105,4 +105,3 @@ void ControlConnectBD::disconnect()
|
||||
u_.disconnect();
|
||||
ControlConnectBase::disconnect();
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ protected:
|
||||
/// set the params before show or update
|
||||
virtual void setParams() {}
|
||||
|
||||
private:
|
||||
/// is the dialog built ?
|
||||
bool dialog_built_;
|
||||
};
|
||||
@ -66,6 +67,8 @@ void ControlDialog<Base>::show()
|
||||
if (isBufferDependent() && !lv_.view()->available())
|
||||
return;
|
||||
|
||||
connect();
|
||||
|
||||
setParams();
|
||||
|
||||
if (!dialog_built_) {
|
||||
|
@ -46,7 +46,7 @@ protected:
|
||||
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...
|
||||
@ -67,6 +67,10 @@ private:
|
||||
/// 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; }
|
||||
|
||||
|
||||
|
||||
@ -195,7 +199,7 @@ void ControlInset<Inset, Params>::apply()
|
||||
else
|
||||
applyParamsNoInset();
|
||||
|
||||
if (!isClosing()) {
|
||||
if (disconnectOnApply() && !isClosing()) {
|
||||
*params_ = getParams(string());
|
||||
inset_ = 0;
|
||||
ih_.disconnect();
|
||||
|
@ -28,7 +28,7 @@ ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
|
||||
: ControlDialog<ControlConnectBD>(lv, d),
|
||||
params_(0)
|
||||
{
|
||||
d_.showPreamble.connect(SigC::slot(this, &ControlPreamble::show));
|
||||
d_.showPreamble.connect(SigC::slot(this, &ControlPreamble::show));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user