mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
Embedding: proper embedCB actions in the GuiGraphics dialog
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22376 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0264dd05b0
commit
9073fd6b9f
@ -279,7 +279,6 @@ void GuiGraphics::on_browsePB_clicked()
|
||||
docstring const str = browse(qstring_to_ucs4(filename->text()));
|
||||
if (!str.empty()) {
|
||||
filename->setText(toqstr(str));
|
||||
embedCB->setCheckState(Qt::Unchecked);
|
||||
changed();
|
||||
}
|
||||
}
|
||||
@ -300,6 +299,17 @@ void GuiGraphics::on_editPB_clicked()
|
||||
void GuiGraphics::on_filename_textChanged(const QString & filename)
|
||||
{
|
||||
editPB->setDisabled(filename.isEmpty());
|
||||
EmbeddedFile file = EmbeddedFile(fromqstr(filename), bufferFilepath());
|
||||
if (!file.embeddable()) {
|
||||
embedCB->setCheckState(Qt::Unchecked);
|
||||
embedCB->setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GuiGraphics::on_embedCB_toggled(bool)
|
||||
{
|
||||
changed();
|
||||
}
|
||||
|
||||
|
||||
@ -449,7 +459,8 @@ void GuiGraphics::updateContents()
|
||||
string const name =
|
||||
igp.filename.outputFilename(bufferFilepath());
|
||||
filename->setText(toqstr(name));
|
||||
embedCB->setCheckState(igp.filename.embedded() ? Qt::Checked : Qt::Unchecked);
|
||||
embedCB->setEnabled(igp.filename.embeddable());
|
||||
embedCB->setCheckState(igp.filename.embedded() ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
// set the bounding box values
|
||||
if (igp.bb.empty()) {
|
||||
|
@ -47,6 +47,7 @@ private Q_SLOTS:
|
||||
void on_getPB_clicked();
|
||||
void on_editPB_clicked();
|
||||
void on_filename_textChanged(const QString &);
|
||||
void on_embedCB_toggled(bool);
|
||||
void on_scaleCB_toggled(bool);
|
||||
void on_WidthCB_toggled(bool);
|
||||
void on_HeightCB_toggled(bool);
|
||||
|
Loading…
Reference in New Issue
Block a user