]> git.lyx.org Git - features.git/commitdiff
Inset dialogs: remain connected to the inset on "Apply" by default, except
authorAngus Leeming <leeming@lyx.org>
Wed, 12 Sep 2001 09:35:25 +0000 (09:35 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 12 Sep 2001 09:35:25 +0000 (09:35 +0000)
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

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlCitation.h
src/frontends/controllers/ControlConnections.C
src/frontends/controllers/ControlDialogs.h
src/frontends/controllers/ControlInset.h
src/frontends/controllers/ControlPreamble.C

index 23464f2aff4be39f01e698b91de85dd0a615d3d3..251c3822d151691c1d384af8795f178a1e63cf97 100644 (file)
@@ -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
index 4bbb8979b80ae6bd04a6ef3608e7baf7fe2541fa..c0d26e745656fbf6db680f313d05237f42efac41 100644 (file)
@@ -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_;
 
index c7de3efd7c98a154d1b8cb4000f4af1dfa87a94d..5a207f588e406512629c4c474840a87745c3d706 100644 (file)
@@ -105,4 +105,3 @@ void ControlConnectBD::disconnect()
        u_.disconnect();
        ControlConnectBase::disconnect();
 }
-
index 049c4ef64cf6a755e24461c90e545d6257ed91ba..f7dabe94708329a936b82ed2c797d12608ac96d2 100644 (file)
@@ -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_) {
index c1dce1f94025d39a39901868e886b580c218d838..755a4476df79dd459e6ffc36afc36cc56d4fb4d4 100644 (file)
@@ -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();
index 38b808f29e31da71f8fb856873c20ccab3c3165a..08eaf67eee8c5378ed0ddcadecdaae2751581873 100644 (file)
@@ -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));
 }