+2002-02-01 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FormGraphics.C (apply, update): respect the new DEFAULT state of
+ InsetGraphicsParams::DisplayType.
+
2002-01-31 Martin Vermeer <martin.vermeer@hut.fi>
* forms/form_graphics.fd: tweeks.
igp.clip = fl_get_button(bbox_->button_clip);
igp.subcaption = fl_get_button(file_->check_subcaption);
igp.subcaptionText = getStringFromInput(file_->input_subcaption);
- // use preferences settings if choice is set to default
- if (fl_get_choice(file_->choice_display) == 1) {
- if (lyxrc.display_graphics == "mono")
- igp.display = InsetGraphicsParams::MONOCHROME;
- else if (lyxrc.display_graphics == "gray")
- igp.display = InsetGraphicsParams::GRAYSCALE;
- else if (lyxrc.display_graphics == "color")
- igp.display = InsetGraphicsParams::COLOR;
- else if (lyxrc.display_graphics == "no")
- igp.display = InsetGraphicsParams::NONE;
- } else if (fl_get_choice(file_->choice_display) == 2) {
- igp.display = InsetGraphicsParams::MONOCHROME;
- } else if (fl_get_choice(file_->choice_display) == 3) {
- igp.display = InsetGraphicsParams::GRAYSCALE;
- } else if (fl_get_choice(file_->choice_display) == 4) {
- igp.display = InsetGraphicsParams::COLOR;
- } else if (fl_get_choice(file_->choice_display) == 5) {
- igp.display = InsetGraphicsParams::NONE;
- }
+
+ switch (fl_get_choice(file_->choice_display)) {
+ case 1:
+ igp.display = InsetGraphicsParams::DEFAULT;
+ break;
+ case 2:
+ igp.display = InsetGraphicsParams::MONOCHROME;
+ break;
+ case 3:
+ igp.display = InsetGraphicsParams::GRAYSCALE;
+ break;
+ case 4:
+ igp.display = InsetGraphicsParams::COLOR;
+ break;
+ case 5:
+ igp.display = InsetGraphicsParams::NONE;
+ break;
+ }
+
if (fl_get_button(size_->button_default))
igp.size_type = InsetGraphicsParams::DEFAULT_SIZE;
else if (fl_get_button(size_->button_wh))
fl_get_button(file_->check_subcaption));
switch (igp.display) {
- case InsetGraphicsParams::NONE: { // dont't display
- fl_set_choice(file_->choice_display, 5);
+ case InsetGraphicsParams::DEFAULT:
+ fl_set_choice(file_->choice_display, 1);
break;
- }
- case InsetGraphicsParams::MONOCHROME: {
+ case InsetGraphicsParams::MONOCHROME:
fl_set_choice(file_->choice_display, 2);
break;
- }
- case InsetGraphicsParams::GRAYSCALE: {
+ case InsetGraphicsParams::GRAYSCALE:
fl_set_choice(file_->choice_display, 3);
break;
- }
- case InsetGraphicsParams::COLOR: {
+ case InsetGraphicsParams::COLOR:
fl_set_choice(file_->choice_display, 4);
break;
- }
- }
+ case InsetGraphicsParams::NONE:
+ fl_set_choice(file_->choice_display, 5);
+ break;
+ }
+
updateWidgetsFromLength(size_->input_width,
size_->choice_width_units,igp.width,defaultUnit);
updateWidgetsFromLength(size_->input_height,
+2002-02-01 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * insetgraphics.C (updateInset): if params.display == DEFAULT,
+ interogate lyxrc.display_graphics before diaplaying the graphic.
+
+ * insetgraphicsParams.[Ch]: respect the new DEFAULT state of
+ InsetGraphicsParams::DisplayType.
+
2002-01-31 Herbert Voss <voss@lyx.org>
* insetgraphic.C: (readfigInset) set display to pref-default
// We do it this way so that in the face of some error, we will still
// be in a valid state.
- if (!params.filename.empty() && lyxrc.use_gui
- && params.display != InsetGraphicsParams::NONE) {
+ InsetGraphicsParams::DisplayType local_display = params.display;
+ if (local_display == InsetGraphicsParams::DEFAULT) {
+ if (lyxrc.display_graphics == "mono")
+ local_display = InsetGraphicsParams::MONOCHROME;
+ else if (lyxrc.display_graphics == "gray")
+ local_display = InsetGraphicsParams::GRAYSCALE;
+ else if (lyxrc.display_graphics == "color")
+ local_display = InsetGraphicsParams::COLOR;
+ else
+ local_display = InsetGraphicsParams::NONE;
+ }
+
+ if (!params.filename.empty() && lyxrc.use_gui &&
+ local_display != InsetGraphicsParams::NONE) {
temp = gc.addFile(params.filename);
}
#include "insetgraphicsParams.h"
+#include "lyxrc.h"
#include "support/translator.h"
#include "support/filetools.h"
#include "support/lyxlib.h"
#include "support/LOstream.h"
-#include "lyxrc.h"
-
#include "support/LAssert.h"
namespace {
/// This is the translator between the Display enum and corresponding lyx
/// file strings.
Translator< InsetGraphicsParams::DisplayType, string >
-displayTranslator(InsetGraphicsParams::MONOCHROME, "monochrome");
+displayTranslator(InsetGraphicsParams::DEFAULT, "default");
// this is only compatibility stuff for the first 1.2 version
// it is obselete until 1.3
if (! translatorsSet) {
translatorsSet = true;
// Fill the display translator
+ displayTranslator.addPair(DEFAULT, "default");
displayTranslator.addPair(MONOCHROME, "monochrome");
displayTranslator.addPair(GRAYSCALE, "grayscale");
displayTranslator.addPair(COLOR, "color");
{
// Filename might be empty (when the dialog is first created).
// Assert(!filename.empty());
- lyx::Assert(display == COLOR ||
+ lyx::Assert(display == DEFAULT ||
+ display == COLOR ||
display == MONOCHROME ||
display == GRAYSCALE ||
display == NONE
{
/// How do we display the image?
enum DisplayType {
+ DEFAULT, // whatever is in lyxrc.display_graphics
COLOR, // full color range
GRAYSCALE, // 256 shades of gray
MONOCHROME, // In black and white.
NONE // only keep a frame in place.
};
+ ///
enum sizeType {
DEFAULT_SIZE, // like none
WH, // width/height values