]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiPrefs.h
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiPrefs.h
index 4094d0137ed02e7867017344223730a153b771e5..df16fde51b04adf3eaaa2f4ee760c7fb1a707b83 100644 (file)
@@ -15,6 +15,7 @@
 #define GUIPREFS_H
 
 #include "GuiDialog.h"
+#include "GuiLyXFiles.h"
 
 #include "Converter.h"
 #include "Format.h"
@@ -68,6 +69,7 @@ public:
 
 public Q_SLOTS:
        void change_adaptor();
+       void slotFileSelected(QString);
 
 Q_SIGNALS:
        void prefsApplied(LyXRC const & rc);
@@ -88,9 +90,9 @@ public:
        bool isBufferDependent() const { return false; }
 
        /// various file pickers
-       QString browsebind(QString const & file) const;
-       QString browseUI(QString const & file) const;
-       QString browsekbmap(QString const & file) const;
+       QString browsebind(QString const & file);
+       QString browseUI(QString const & file);
+       QString browsekbmap(QString const & file);
 
        /// general browse
        QString browse(QString const & file, QString const & title) const;
@@ -98,12 +100,6 @@ public:
        /// set a color
        void setColor(ColorCode col, QString const & hex);
 
-       /// 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_; }
@@ -112,6 +108,9 @@ public:
 private:
        ///
        void addModule(PrefModule * module);
+       ///
+       QString browseLibFile(QString const & dir,
+               QString const & name, QString const & ext);
 
        /// temporary lyxrc
        LyXRC rc_;
@@ -124,9 +123,10 @@ private:
 
        /// A list of colors to be dispatched
        std::vector<std::string> colors_;
-
-       bool update_screen_font_;
-       bool update_previews_;
+       /// UI file selector
+       GuiLyXFiles * guilyxfiles_;
+       /// Selected UI file
+       QString uifile_;
 };
 
 
@@ -163,9 +163,6 @@ public:
 
        virtual void applyRC(LyXRC & rc) const;
        virtual void updateRC(LyXRC const & rc);
-
-private Q_SLOTS:
-       void on_DateED_textChanged(const QString &);
 };
 
 
@@ -214,14 +211,16 @@ public:
        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;
 };
 
@@ -256,12 +255,23 @@ public:
 
 private Q_SLOTS:
        void changeColor();
+       void resetColor();
+       void resetAllColor();
        void changeSysColor();
        void changeLyxObjectsSelection();
+       bool setColor(int const row, QColor const new_color,
+                     QString const old_color);
+       bool isDefaultColor(int const row, QString const color);
+       void setDisabledResets();
 
 private:
+       ///
+       QColor getDefaultColorByRow(int const row);
+       ///
        std::vector<ColorCode> lcolors_;
+       ///
        std::vector<QString> curcolors_;
+       ///
        std::vector<QString> newcolors_;
 };
 
@@ -334,6 +344,8 @@ private Q_SLOTS:
        void removeConverter();
        void changeConverter();
        void on_cacheCB_stateChanged(int state);
+       void on_needauthForbiddenCB_toggled(bool);
+       void on_needauthCB_toggled(bool);
 
 private:
        void updateButtons();
@@ -456,12 +468,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();
@@ -479,6 +485,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_;
        ///
@@ -494,7 +527,7 @@ private:
        // user_unbind_ holds \unbind bindings from user.bind
        // When an item is inserted, it is added to user_bind_
        // When an item from system_bind_ is deleted, it is added to user_unbind_
-       // When an item in user_bind_ or user_unbind_ is deleted, it is 
+       // When an item in user_bind_ or user_unbind_ is deleted, it is
        //      deleted (unbind)
        KeyMap system_bind_;
        KeyMap user_bind_;