*
* \author John Levon
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "support/lstrings.h"
#include "support/tostr.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
#include <iomanip>
#include "ControlPrefs.h"
#include "ui/QPrefDisplayModule.h"
#include "ui/QPrefPathsModule.h"
#include "ui/QPrefSpellcheckerModule.h"
-#include "ui/QPrefConvertersModule.h"
-#include "ui/QPrefFileformatsModule.h"
#include "ui/QPrefLanguageModule.h"
#include "ui/QPrefPrinterModule.h"
#include "ui/QPrefUIModule.h"
#include "lyx_gui.h"
#include "QPrefs.h"
#include "Qt2BC.h"
-#include "lyxrc.h"
+#include "lyxfont.h"
#include "frnt_lang.h"
#include "helper_funcs.h"
#include "qt_helpers.h"
#include "lcolorcache.h"
-#include "debug.h"
#include <boost/tuple/tuple.hpp>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qcombobox.h>
-#include <qlistbox.h>
#include <qlabel.h>
-#include <qfontinfo.h>
#include "qcoloritem.h"
using namespace lyx::support;
using std::setw;
using std::endl;
+
typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class;
rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
rc.default_papersize =
- static_cast<BufferParams::PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
-
+ static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
QPrefDisplayModule * displaymod(dialog_->displayModule);
rc.preview = displaymod->previewCB->isChecked();
- grfx::DisplayType dtype(grfx::ColorDisplay);
+ lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
switch (displaymod->displayGraphicsCO->currentItem()) {
- case 3: dtype = grfx::NoDisplay; break;
- case 2: dtype = grfx::ColorDisplay; break;
- case 1: dtype = grfx::GrayscaleDisplay; break;
- case 0: dtype = grfx::MonochromeDisplay; break;
+ case 3: dtype = lyx::graphics::NoDisplay; break;
+ case 2: dtype = lyx::graphics::ColorDisplay; break;
+ case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
+ case 0: dtype = lyx::graphics::MonochromeDisplay; break;
}
rc.display_graphics = dtype;
#endif
#if 0
if (old_value != rc.display_graphics) {
- grfx::GCache & gc = grfx::GCache::get();
+ lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
gc.changeDisplay();
}
#endif
}
}
- // Try matching without foundary name
+ // Try matching without foundry name
// We count in reverse in order to prefer the Xft foundry
for (int i = cb->count() - 1; i >= 0; --i) {
}
}
+ // family alone can contain e.g. "Helvetica [Adobe]"
+ pair<string, string> tmpfam = parseFontName(family);
+
+ // We count in reverse in order to prefer the Xft foundry
+ for (int i = cb->count() - 1; i >= 0; --i) {
+ pair<string, string> tmp = parseFontName(fromqstr(cb->text(i)));
+ if (compare_no_case(tmp.first, tmpfam.first) == 0) {
+ cb->setCurrentItem(i);
+ return;
+ }
+ }
+
// Bleh, default fonts, and the names couldn't be found. Hack
// for bug 1063. Qt makes baby Jesus cry.
int item = 2;
switch (rc.display_graphics) {
- case grfx::NoDisplay: item = 3; break;
- case grfx::ColorDisplay: item = 2; break;
- case grfx::GrayscaleDisplay: item = 1; break;
- case grfx::MonochromeDisplay: item = 0; break;
+ case lyx::graphics::NoDisplay: item = 3; break;
+ case lyx::graphics::ColorDisplay: item = 2; break;
+ case lyx::graphics::GrayscaleDisplay: item = 1; break;
+ case lyx::graphics::MonochromeDisplay: item = 0; break;
default: break;
}
displaymod->displayGraphicsCO->setCurrentItem(item);