]> git.lyx.org Git - features.git/commitdiff
Patch from Vincent van Ravesteijn.
authorRichard Heck <rgheck@comcast.net>
Fri, 8 Aug 2008 15:29:26 +0000 (15:29 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 8 Aug 2008 15:29:26 +0000 (15:29 +0000)
I noticed that for instance the Hyperlink Dialog loses all information when clicking on the main buffer. The same occurs with the Include Child Document Dialog and probably also others.
Do you agree on this being less intuitive ? If so, I included a small patch that will fix this for the two dialogs mentioned. I just adapted them to the design of the GuiGraphics Dialog.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26096 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiHyperlink.cpp
src/frontends/qt4/GuiHyperlink.h
src/frontends/qt4/GuiInclude.cpp
src/frontends/qt4/GuiInclude.h

index 488321973ac8a2c206744a2f8d8edf72fefe9eff..58819fd2e034167e508be51e0859357a34451078 100644 (file)
@@ -62,7 +62,7 @@ void GuiHyperlink::changed_adaptor()
 }
 
 
-void GuiHyperlink::updateContents()
+void GuiHyperlink::paramsToDialog(InsetCommandParams const & icp)
 {
        targetED->setText(toqstr(params_["target"]));
        nameED->setText(toqstr(params_["name"]));
@@ -101,6 +101,7 @@ bool GuiHyperlink::initialiseParams(std::string const & data)
        // The name passed with LFUN_INSET_APPLY is also the name
        // used to identify the mailer.
        InsetCommand::string2params("href", data, params_);
+       paramsToDialog(params_);
        return true;
 }
 
index 3b28c1aac3fa8a136104b0a5291723238e253a50..f491f3fef779546a0f415ffe9c51802958f08bd6 100644 (file)
@@ -38,9 +38,11 @@ private:
        /// apply dialog
        void applyView();
        /// update dialog
-       void updateContents();
+       void updateContents() { };
        ///
        bool initialiseParams(std::string const & data);
+       ///
+       void paramsToDialog(InsetCommandParams const & icp);
        /// clean-up on hide.
        void clearParams() { params_.clear(); }
        /// clean-up on hide.
index 6e15b2666a6ba2f96f60d512c5c6988abcb93d9f..5ea454753720162369a78368e054cbc4cc1ccea7 100644 (file)
@@ -166,7 +166,7 @@ void GuiInclude::typeChanged(int v)
 }
 
 
-void GuiInclude::updateContents()
+void GuiInclude::paramsToDialog(InsetCommandParams const & params_)
 {
        filenameED->setText(toqstr(params_["filename"]));
 
@@ -329,6 +329,7 @@ QString GuiInclude::browse(QString const & in_name, Type in_type) const
 bool GuiInclude::initialiseParams(std::string const & data)
 {
        InsetCommand::string2params("include", data, params_);
+       paramsToDialog(params_);
        return true;
 }
 
index 37f80fddf6e17238dba2fa2fe63b662a5e9a482a..0fc998f644dabcfe6c3f5c22c9e74e659c7f47f9 100644 (file)
@@ -48,6 +48,8 @@ private Q_SLOTS:
 private:
        ///
        bool initialiseParams(std::string const & data);
+       ///
+       void paramsToDialog(InsetCommandParams const & params_);
        /// clean-up on hide.
        void clearParams() { params_.clear(); }
        /// clean-up on hide.
@@ -75,7 +77,7 @@ private:
        /// Apply changes
        void applyView();
        /// update
-       void updateContents();
+       void updateContents() { };
        /// Browse for a file
        QString browse(QString const &, Type) const;