Patch from Vincent van Ravesteijn.

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
This commit is contained in:
Richard Heck 2008-08-08 15:29:26 +00:00
parent 87d4bd72b3
commit dc9146d250
4 changed files with 10 additions and 4 deletions

View File

@ -62,7 +62,7 @@ void GuiHyperlink::changed_adaptor()
} }
void GuiHyperlink::updateContents() void GuiHyperlink::paramsToDialog(InsetCommandParams const & icp)
{ {
targetED->setText(toqstr(params_["target"])); targetED->setText(toqstr(params_["target"]));
nameED->setText(toqstr(params_["name"])); 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 // The name passed with LFUN_INSET_APPLY is also the name
// used to identify the mailer. // used to identify the mailer.
InsetCommand::string2params("href", data, params_); InsetCommand::string2params("href", data, params_);
paramsToDialog(params_);
return true; return true;
} }

View File

@ -38,9 +38,11 @@ private:
/// apply dialog /// apply dialog
void applyView(); void applyView();
/// update dialog /// update dialog
void updateContents(); void updateContents() { };
/// ///
bool initialiseParams(std::string const & data); bool initialiseParams(std::string const & data);
///
void paramsToDialog(InsetCommandParams const & icp);
/// clean-up on hide. /// clean-up on hide.
void clearParams() { params_.clear(); } void clearParams() { params_.clear(); }
/// clean-up on hide. /// clean-up on hide.

View File

@ -166,7 +166,7 @@ void GuiInclude::typeChanged(int v)
} }
void GuiInclude::updateContents() void GuiInclude::paramsToDialog(InsetCommandParams const & params_)
{ {
filenameED->setText(toqstr(params_["filename"])); 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) bool GuiInclude::initialiseParams(std::string const & data)
{ {
InsetCommand::string2params("include", data, params_); InsetCommand::string2params("include", data, params_);
paramsToDialog(params_);
return true; return true;
} }

View File

@ -48,6 +48,8 @@ private Q_SLOTS:
private: private:
/// ///
bool initialiseParams(std::string const & data); bool initialiseParams(std::string const & data);
///
void paramsToDialog(InsetCommandParams const & params_);
/// clean-up on hide. /// clean-up on hide.
void clearParams() { params_.clear(); } void clearParams() { params_.clear(); }
/// clean-up on hide. /// clean-up on hide.
@ -75,7 +77,7 @@ private:
/// Apply changes /// Apply changes
void applyView(); void applyView();
/// update /// update
void updateContents(); void updateContents() { };
/// Browse for a file /// Browse for a file
QString browse(QString const &, Type) const; QString browse(QString const &, Type) const;