/////////////////////////////////////////////////////////////////////
-namespace {
-
-struct ColorSorter
-{
- bool operator()(ColorCode lhs, ColorCode rhs) const {
- return
- compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
- }
-};
-
-} // namespace anon
-
-
PrefColors::PrefColors(GuiPreferences * form)
: PrefModule(catLookAndFeel, N_("Colors"), form)
{
continue;
lcolors_.push_back(lc);
}
- sort(lcolors_.begin(), lcolors_.end(), ColorSorter());
+ qSort(lcolors_.begin(), lcolors_.end(), ColorSorter);
vector<ColorCode>::const_iterator cit = lcolors_.begin();
vector<ColorCode>::const_iterator const end = lcolors_.end();
for (; cit != end; ++cit) {
rc.preview = LyXRC::PREVIEW_OFF;
break;
case 1:
- rc.preview = LyXRC::PREVIEW_NO_MATH;
+ if (rc.preview != LyXRC::PREVIEW_NO_MATH) {
+ rc.preview = LyXRC::PREVIEW_NO_MATH;
+ form_->updatePreviews();
+ }
break;
case 2:
- rc.preview = LyXRC::PREVIEW_ON;
+ if (rc.preview != LyXRC::PREVIEW_ON) {
+ rc.preview = LyXRC::PREVIEW_ON;
+ form_->updatePreviews();
+ }
break;
}
macroEditStyleCO->setCurrentIndex(rc.macro_edit_style);
cursorWidthSB->setValue(rc.cursor_width);
toggleScrollbarCB->setChecked(rc.full_screen_scrollbar);
- toggleScrollbarCB->setChecked(rc.full_screen_statusbar);
+ toggleStatusbarCB->setChecked(rc.full_screen_statusbar);
toggleToolbarsCB->setChecked(rc.full_screen_toolbars);
toggleTabbarCB->setChecked(rc.full_screen_tabbar);
toggleMenubarCB->setChecked(rc.full_screen_menubar);
PrefShortcuts::PrefShortcuts(GuiPreferences * form)
- : PrefModule(catEditing, N_("Shortcuts"), form)
+ : PrefModule(catEditing, N_("Shortcuts"), form),
+ editItem_(0), mathItem_(0), bufferItem_(0), layoutItem_(0),
+ systemItem_(0)
{
setupUi(this);
QString const lfun_name = toqstr(from_utf8(action_name)
+ ' ' + lfun.argument());
QString const shortcut = toqstr(seq.print(KeySequence::ForGui));
- KeyMap::ItemType item_tag = tag;
QTreeWidgetItem * newItem = 0;
// for unbind items, try to find an existing item in the system bind list
QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(lfun_name,
Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 0);
for (int i = 0; i < items.size(); ++i) {
- if (items[i]->text(1) == shortcut)
+ if (items[i]->text(1) == shortcut) {
newItem = items[i];
break;
}
+ }
// if not found, this unbind item is KeyMap::UserExtraUnbind
// Such an item is not displayed to avoid confusion (what is
// unmatched removed?).
if (!newItem) {
- item_tag = KeyMap::UserExtraUnbind;
return 0;
}
}
newItem->setText(1, shortcut);
// record BindFile representation to recover KeySequence when needed.
newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
- setItemType(newItem, item_tag);
+ setItemType(newItem, tag);
return newItem;
}
/////////////////////////////////////////////////////////////////////
GuiPreferences::GuiPreferences(GuiView & lv)
- : GuiDialog(lv, "prefs", qt_("Preferences")), update_screen_font_(false)
+ : GuiDialog(lv, "prefs", qt_("Preferences")), update_screen_font_(false),
+ update_previews_(false)
{
setupUi(this);
movers_ = theMovers();
colors_.clear();
update_screen_font_ = false;
+ update_previews_ = false;
updateRC(rc_);
// Make sure that the bc is in the INITIAL state
if (update_screen_font_) {
dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
+ // resets flag in case second apply in same dialog
update_screen_font_ = false;
}
- theBufferList().updatePreviews();
+ if (update_previews_) {
+ // resets flag in case second apply in same dialog
+ theBufferList().updatePreviews();
+ update_previews_ = false;
+ }
// The Save button has been pressed
if (isClosing())
}
+void GuiPreferences::updatePreviews()
+{
+ update_previews_ = true;
+}
+
+
QString GuiPreferences::browsebind(QString const & file) const
{
return browseLibFile("bind", file, "bind", qt_("Choose bind file"),