]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPrefs.h
Add missing initialization
[lyx.git] / src / frontends / qt4 / GuiPrefs.h
index 90543cab9cc00a703a1ddb092c521d995eba177f..ca93781c4b9ec508cdb3a4b6d1be31ed7dc035f1 100644 (file)
@@ -39,7 +39,6 @@
 #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"
@@ -102,6 +101,9 @@ public:
        /// update the screen fonts after change
        void updateScreenFonts();
 
+       /// update the previews after change
+       void updatePreviews();
+
        LyXRC & rc() { return rc_; }
        Converters & converters() { return converters_; }
        Formats & formats() { return formats_; }
@@ -124,6 +126,7 @@ private:
        std::vector<std::string> colors_;
 
        bool update_screen_font_;
+       bool update_previews_;
 };
 
 
@@ -213,12 +216,15 @@ public:
 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;
 };
 
@@ -331,6 +337,7 @@ private Q_SLOTS:
        void removeConverter();
        void changeConverter();
        void on_cacheCB_stateChanged(int state);
+       void on_needauthForbiddenCB_toggled(bool);
 
 private:
        void updateButtons();
@@ -396,17 +403,6 @@ private Q_SLOTS:
 };
 
 
-class PrefPrinter : public PrefModule, public Ui::PrefPrinterUi
-{
-       Q_OBJECT
-public:
-       PrefPrinter(GuiPreferences * form);
-
-       void applyRC(LyXRC & rc) const;
-       void updateRC(LyXRC const & rc);
-};
-
-
 class PrefUserInterface : public PrefModule, public Ui::PrefUi
 {
        Q_OBJECT
@@ -464,12 +460,6 @@ public:
        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();
@@ -487,6 +477,33 @@ public Q_SLOTS:
        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_;
        ///