#include "GuiDialog.h"
-#include "ColorCode.h"
#include "Converter.h"
#include "Format.h"
-#include "FuncCode.h"
#include "KeyMap.h"
#include "LyXRC.h"
#include "Mover.h"
#include "ui_PrefCompletionUi.h"
#include "ui_PrefColorsUi.h"
#include "ui_PrefDisplayUi.h"
+#include "ui_PrefDocHandlingUi.h"
#include "ui_PrefEditUi.h"
#include "ui_PrefPathsUi.h"
#include "ui_PrefShortcutsUi.h"
#include "ui_PrefConvertersUi.h"
#include "ui_PrefFileformatsUi.h"
#include "ui_PrefLanguageUi.h"
-#include "ui_PrefPrinterUi.h"
#include "ui_PrefUi.h"
#include "ui_PrefIdentityUi.h"
#include "ui_ShortcutUi.h"
public:
GuiPreferences(GuiView & lv);
- void apply(LyXRC & rc) const;
- void updateRc(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
public Q_SLOTS:
void change_adaptor();
/// update the screen fonts after change
void updateScreenFonts();
- /// adjust the prefs paper sizes
- PAPER_SIZE toPaperSize(int i) const;
- /// adjust the prefs paper sizes
- int fromPaperSize(PAPER_SIZE papersize) const;
+ /// update the previews after change
+ void updatePreviews();
LyXRC & rc() { return rc_; }
Converters & converters() { return converters_; }
/// A list of colors to be dispatched
std::vector<std::string> colors_;
- bool redraw_gui_;
bool update_screen_font_;
+ bool update_previews_;
};
: QWidget(form), category_(cat), title_(t), form_(form)
{}
- virtual void apply(LyXRC & rc) const = 0;
- virtual void update(LyXRC const & rc) = 0;
+ virtual void applyRC(LyXRC & rc) const = 0;
+ virtual void updateRC(LyXRC const & rc) = 0;
QString const & category() const { return category_; }
QString const & title() const { return title_; }
public:
PrefOutput(GuiPreferences * form);
- virtual void apply(LyXRC & rc) const;
- virtual void update(LyXRC const & rc);
+ virtual void applyRC(LyXRC & rc) const;
+ virtual void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_DateED_textChanged(const QString &);
public:
PrefInput(GuiPreferences * form);
- virtual void apply(LyXRC & rc) const;
- virtual void update(LyXRC const & rc);
+ virtual void applyRC(LyXRC & rc) const;
+ virtual void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_firstKeymapPB_clicked(bool);
public:
PrefCompletion(GuiPreferences * form);
- virtual void apply(LyXRC & rc) const;
- virtual void update(LyXRC const & rc);
+ virtual void applyRC(LyXRC & rc) const;
+ virtual void updateRC(LyXRC const & rc);
virtual void enableCB();
private Q_SLOTS:
void on_popupTextCB_clicked();
public:
PrefLatex(GuiPreferences * form);
- virtual void apply(LyXRC & rc) const;
- virtual void update(LyXRC const & rc);
+ virtual void applyRC(LyXRC & rc) const;
+ virtual void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_latexEncodingCB_stateChanged(int state);
void on_latexBibtexCO_activated(int n);
+ void on_latexJBibtexCO_activated(int n);
void on_latexIndexCO_activated(int n);
private:
///
std::set<std::string> bibtex_alternatives;
///
+ std::set<std::string> jbibtex_alternatives;
+ ///
std::set<std::string> index_alternatives;
};
public:
PrefScreenFonts(GuiPreferences * form);
- virtual void apply(LyXRC & rc) const;
- virtual void update(LyXRC const & rc);
+ virtual void applyRC(LyXRC & rc) const;
+ virtual void updateRC(LyXRC const & rc);
private Q_SLOTS:
void selectRoman(const QString&);
public:
PrefColors(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
private Q_SLOTS:
void changeColor();
public:
PrefDisplay(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_instantPreviewCO_currentIndexChanged(int);
- void on_displayGraphicsCB_toggled(bool);
};
public:
PrefPaths(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
private Q_SLOTS:
void selectExampledir();
public:
PrefSpellchecker(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_spellcheckerCB_currentIndexChanged(int);
public:
PrefConverters(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
public Q_SLOTS:
void updateGui();
void removeConverter();
void changeConverter();
void on_cacheCB_stateChanged(int state);
+ void on_needauthForbiddenCB_toggled(bool);
private:
void updateButtons();
public:
PrefFileformats(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
void updateView();
Q_SIGNALS:
private Q_SLOTS:
void on_copierED_textEdited(const QString & s);
- void on_extensionED_textEdited(const QString &);
+ void on_extensionsED_textEdited(const QString &);
void on_viewerED_textEdited(const QString &);
void on_editorED_textEdited(const QString &);
+ void on_mimeED_textEdited(const QString &);
void on_shortcutED_textEdited(const QString &);
void on_formatED_editingFinished();
void on_formatED_textChanged(const QString &);
public:
PrefLanguage(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
private Q_SLOTS:
void on_uiLanguageCO_currentIndexChanged(int);
};
-class PrefPrinter : public PrefModule, public Ui::PrefPrinterUi
+class PrefUserInterface : public PrefModule, public Ui::PrefUi
{
Q_OBJECT
public:
- PrefPrinter(GuiPreferences * form);
+ PrefUserInterface(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
+
+public Q_SLOTS:
+ void selectUi();
};
-class PrefUserInterface : public PrefModule, public Ui::PrefUi
+class PrefDocHandling : public PrefModule, public Ui::PrefDocHandlingUi
{
Q_OBJECT
public:
- PrefUserInterface(GuiPreferences * form);
+ PrefDocHandling(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
public Q_SLOTS:
- void selectUi();
void on_clearSessionPB_clicked();
};
+
class PrefEdit : public PrefModule, public Ui::PrefEditUi
{
Q_OBJECT
public:
PrefEdit(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
};
public:
PrefShortcuts(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
void updateShortcutsTW();
- void modifyShortcut();
- void removeShortcut();
- ///
- void setItemType(QTreeWidgetItem * item, KeyMap::ItemType tag);
- QTreeWidgetItem * insertShortcutItem(FuncRequest const & lfun,
- KeySequence const & shortcut, KeyMap::ItemType tag);
public Q_SLOTS:
void selectBind();
void shortcutRemovePressed();
private:
+ void modifyShortcut();
+ /// remove selected binding, restore default value
+ void removeShortcut();
+ /// remove bindings, do not restore default values
+ void deactivateShortcuts(QList<QTreeWidgetItem*> const & items);
+ /// check the new binding k->func, and remove existing bindings to k after
+ /// asking the user. We exclude lfun_to_modify from this test: we assume
+ /// that if the user clicked "modify" then they agreed to modify the
+ /// binding. Returns false if the shortcut is invalid or the user cancels.
+ bool validateNewShortcut(FuncRequest const & func,
+ KeySequence const & k,
+ QString const & lfun_to_modify);
+ /// compute current active shortcut
+ FuncRequest currentBinding(KeySequence const & k);
+ ///
+ void setItemType(QTreeWidgetItem * item, KeyMap::ItemType tag);
+ ///
+ static KeyMap::ItemType itemType(QTreeWidgetItem & item);
+ /// some items need to be always hidden, for instance empty rebound
+ /// system keys
+ static bool isAlwaysHidden(QTreeWidgetItem & item);
+ /// unhide an empty system binding that may have been hidden
+ /// returns either null or the unhidden shortcut
+ void unhideEmpty(QString const & lfun, bool select);
+ ///
+ QTreeWidgetItem * insertShortcutItem(FuncRequest const & lfun,
+ KeySequence const & shortcut, KeyMap::ItemType tag);
///
GuiShortcutDialog * shortcut_;
///
public:
PrefIdentity(GuiPreferences * form);
- void apply(LyXRC & rc) const;
- void update(LyXRC const & rc);
+ void applyRC(LyXRC & rc) const;
+ void updateRC(LyXRC const & rc);
};