mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 18:52:46 +00:00
Fix 4603 for GuiGraphics. I guess most GuiDialog based dialog need fixing...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24643 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c14295fbe3
commit
99b12faae4
@ -28,7 +28,7 @@
|
|||||||
#include "graphics/GraphicsCacheItem.h"
|
#include "graphics/GraphicsCacheItem.h"
|
||||||
#include "graphics/GraphicsImage.h"
|
#include "graphics/GraphicsImage.h"
|
||||||
|
|
||||||
#include "insets/InsetGraphicsParams.h"
|
#include "insets/InsetGraphics.h"
|
||||||
|
|
||||||
#include "support/convert.h"
|
#include "support/convert.h"
|
||||||
#include "support/debug.h"
|
#include "support/debug.h"
|
||||||
@ -82,8 +82,7 @@ namespace frontend {
|
|||||||
//FIXME setAutoTextCB should really take an argument, as indicated, that
|
//FIXME setAutoTextCB should really take an argument, as indicated, that
|
||||||
//determines what text is to be written for "auto". But making
|
//determines what text is to be written for "auto". But making
|
||||||
//that work involves more extensive revisions than we now want
|
//that work involves more extensive revisions than we now want
|
||||||
//to make, since "auto" also appears in updateContents() (see
|
//to make, since "auto" also appears in paramsToDialog().
|
||||||
//GuiGraphics.cpp).
|
|
||||||
//The right way to do this, I think, would be to define a class
|
//The right way to do this, I think, would be to define a class
|
||||||
//checkedLengthSet (and a partnering labeledLengthSete) that encapsulated
|
//checkedLengthSet (and a partnering labeledLengthSete) that encapsulated
|
||||||
//the checkbox, line edit, and length combo together, and then made e.g.
|
//the checkbox, line edit, and length combo together, and then made e.g.
|
||||||
@ -427,7 +426,7 @@ static int itemNumber(const vector<string> & v, string const & s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiGraphics::updateContents()
|
void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
|
||||||
{
|
{
|
||||||
static char const * const bb_units[] = { "bp", "cm", "mm", "in" };
|
static char const * const bb_units[] = { "bp", "cm", "mm", "in" };
|
||||||
size_t const bb_size = sizeof(bb_units) / sizeof(bb_units[0]);
|
size_t const bb_size = sizeof(bb_units) / sizeof(bb_units[0]);
|
||||||
@ -445,8 +444,6 @@ void GuiGraphics::updateContents()
|
|||||||
rtYunit->addItem(toqstr(*it));
|
rtYunit->addItem(toqstr(*it));
|
||||||
}
|
}
|
||||||
|
|
||||||
InsetGraphicsParams & igp = params_;
|
|
||||||
|
|
||||||
// set the right default unit
|
// set the right default unit
|
||||||
Length::UNIT unitDefault = Length::CM;
|
Length::UNIT unitDefault = Length::CM;
|
||||||
switch (lyxrc.default_papersize) {
|
switch (lyxrc.default_papersize) {
|
||||||
@ -719,6 +716,7 @@ bool GuiGraphics::isValid()
|
|||||||
bool GuiGraphics::initialiseParams(string const & data)
|
bool GuiGraphics::initialiseParams(string const & data)
|
||||||
{
|
{
|
||||||
InsetGraphics::string2params(data, buffer(), params_);
|
InsetGraphics::string2params(data, buffer(), params_);
|
||||||
|
paramsToDialog(params_);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,9 @@
|
|||||||
#include "GuiDialog.h"
|
#include "GuiDialog.h"
|
||||||
#include "ui_GraphicsUi.h"
|
#include "ui_GraphicsUi.h"
|
||||||
|
|
||||||
|
#include "insets/InsetGraphicsParams.h"
|
||||||
|
|
||||||
#include "support/docstring.h"
|
#include "support/docstring.h"
|
||||||
#include "insets/InsetGraphics.h"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -27,9 +28,6 @@ class QString;
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
class InsetGraphics;
|
|
||||||
class InsetGraphicsParams;
|
|
||||||
|
|
||||||
namespace frontend {
|
namespace frontend {
|
||||||
|
|
||||||
class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
|
class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
|
||||||
@ -53,34 +51,32 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
bool isValid();
|
bool isValid();
|
||||||
/// Apply changes
|
/// Dialog inherited methods
|
||||||
|
//@{
|
||||||
void applyView();
|
void applyView();
|
||||||
/// update
|
void updateContents() {}
|
||||||
void updateContents();
|
bool initialiseParams(std::string const & data);
|
||||||
|
void clearParams();
|
||||||
|
void dispatchParams();
|
||||||
|
bool isBufferDependent() const { return true; }
|
||||||
|
//@}
|
||||||
|
|
||||||
|
///
|
||||||
|
void paramsToDialog(InsetGraphicsParams const & params);
|
||||||
|
|
||||||
/// get bounding box from file
|
/// get bounding box from file
|
||||||
void getBB();
|
void getBB();
|
||||||
|
|
||||||
/// Store the LaTeX names for the rotation origins.
|
|
||||||
std::vector<std::string> origin_ltx;
|
|
||||||
///
|
|
||||||
bool initialiseParams(std::string const & data);
|
|
||||||
/// clean-up on hide.
|
|
||||||
void clearParams();
|
|
||||||
/// clean-up on hide.
|
|
||||||
void dispatchParams();
|
|
||||||
///
|
|
||||||
bool isBufferDependent() const { return true; }
|
|
||||||
|
|
||||||
/// Browse for a file
|
/// Browse for a file
|
||||||
QString browse(QString const &) const;
|
QString browse(QString const &) const;
|
||||||
/// Read the Bounding Box from a eps or ps-file
|
/// Read the Bounding Box from a eps or ps-file
|
||||||
std::string readBoundingBox(std::string const & file);
|
std::string readBoundingBox(std::string const & file);
|
||||||
/// Control the bb
|
|
||||||
bool bbChanged;
|
|
||||||
/// test if file exist
|
/// test if file exist
|
||||||
bool isFileNameValid(std::string const & fname) const;
|
bool isFileNameValid(std::string const & fname) const;
|
||||||
|
|
||||||
private:
|
/// Control the bb
|
||||||
|
bool bbChanged;
|
||||||
|
/// Store the LaTeX names for the rotation origins.
|
||||||
|
std::vector<std::string> origin_ltx;
|
||||||
///
|
///
|
||||||
InsetGraphicsParams params_;
|
InsetGraphicsParams params_;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user