2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QPrefsDialog.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QPREFSDIALOG_H
|
|
|
|
#define QPREFSDIALOG_H
|
|
|
|
|
|
|
|
#include "LColor.h"
|
2006-03-22 18:59:17 +00:00
|
|
|
#include "lyxrc.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#include "ui/QPrefsUi.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
2007-01-16 22:29:33 +00:00
|
|
|
#include "ui/QPrefPlaintextUi.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "ui/QPrefDateUi.h"
|
|
|
|
#include "ui/QPrefKeyboardUi.h"
|
|
|
|
#include "ui/QPrefLatexUi.h"
|
|
|
|
#include "ui/QPrefScreenFontsUi.h"
|
|
|
|
#include "ui/QPrefColorsUi.h"
|
|
|
|
#include "ui/QPrefCygwinPathUi.h"
|
|
|
|
#include "ui/QPrefDisplayUi.h"
|
|
|
|
#include "ui/QPrefPathsUi.h"
|
|
|
|
#include "ui/QPrefSpellcheckerUi.h"
|
|
|
|
#include "ui/QPrefConvertersUi.h"
|
|
|
|
#include "ui/QPrefCopiersUi.h"
|
|
|
|
#include "ui/QPrefFileformatsUi.h"
|
|
|
|
#include "ui/QPrefLanguageUi.h"
|
|
|
|
#include "ui/QPrefPrinterUi.h"
|
|
|
|
#include "ui/QPrefUi.h"
|
|
|
|
#include "ui/QPrefIdentityUi.h"
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QPrefs;
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
class PrefModule : public QWidget
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2006-10-09 12:07:05 +00:00
|
|
|
PrefModule(lyx::docstring const & cat, lyx::docstring const & t, QPrefs * form = 0, QWidget * parent = 0)
|
2006-07-06 08:18:51 +00:00
|
|
|
: QWidget(parent), category_(cat), title_(t), form_(form)
|
2006-05-20 11:49:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
virtual ~PrefModule() {}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
virtual void apply(LyXRC & rc) const = 0;
|
|
|
|
virtual void update(LyXRC const & rc) = 0;
|
|
|
|
|
2006-10-09 12:07:05 +00:00
|
|
|
lyx::docstring const & category() {
|
2006-05-20 11:49:53 +00:00
|
|
|
return category_;
|
|
|
|
}
|
|
|
|
|
2006-10-09 12:07:05 +00:00
|
|
|
lyx::docstring const & title() {
|
2006-05-20 11:49:53 +00:00
|
|
|
return title_;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2006-10-09 12:07:05 +00:00
|
|
|
lyx::docstring category_;
|
|
|
|
lyx::docstring title_;
|
2006-05-20 11:49:53 +00:00
|
|
|
QPrefs * form_;
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void changed();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-01-16 22:29:33 +00:00
|
|
|
class PrefPlaintext : public PrefModule, public Ui::QPrefPlaintextUi
|
2006-05-20 11:49:53 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-01-16 22:29:33 +00:00
|
|
|
PrefPlaintext(QWidget * parent = 0);
|
|
|
|
~PrefPlaintext() {}
|
2006-05-20 11:49:53 +00:00
|
|
|
|
|
|
|
virtual void apply(LyXRC & rc) const;
|
|
|
|
virtual void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefDate : public PrefModule, public Ui::QPrefDateUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefDate(QWidget * parent = 0);
|
|
|
|
~PrefDate() {}
|
|
|
|
|
|
|
|
virtual void apply(LyXRC & rc) const;
|
|
|
|
virtual void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefKeyboard : public PrefModule, public Ui::QPrefKeyboardUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefKeyboard(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefKeyboard() {}
|
|
|
|
|
|
|
|
virtual void apply(LyXRC & rc) const;
|
|
|
|
virtual void update(LyXRC const & rc);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-06-28 12:48:51 +00:00
|
|
|
void on_firstKeymapPB_clicked(bool);
|
|
|
|
void on_secondKeymapPB_clicked(bool);
|
2007-01-17 13:06:16 +00:00
|
|
|
void on_keymapCB_toggled(bool);
|
2006-05-20 11:49:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString testKeymap(QString keymap);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefLatex : public PrefModule, public Ui::QPrefLatexUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefLatex(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefLatex() {}
|
|
|
|
|
|
|
|
virtual void apply(LyXRC & rc) const;
|
|
|
|
virtual void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefScreenFonts : public PrefModule, public Ui::QPrefScreenFontsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefScreenFonts(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefScreenFonts() {}
|
|
|
|
|
|
|
|
virtual void apply(LyXRC & rc) const;
|
|
|
|
virtual void update(LyXRC const & rc);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void select_roman(const QString&);
|
|
|
|
void select_sans(const QString&);
|
|
|
|
void select_typewriter(const QString&);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefColors : public PrefModule, public Ui::QPrefColorsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefColors(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefColors() {}
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-03-22 18:59:17 +00:00
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void change_color();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
private:
|
|
|
|
std::vector<LColor_color> lcolors_;
|
2007-03-30 04:24:54 +00:00
|
|
|
// FIXME the use of mutable here is required due to the
|
|
|
|
// fact that initialization is not done in the controller
|
|
|
|
// but in the constructor.
|
|
|
|
mutable std::vector<QString> curcolors_;
|
2006-05-20 11:49:53 +00:00
|
|
|
std::vector<QString> newcolors_;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefCygwinPath : public PrefModule, public Ui::QPrefCygwinPathUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefCygwinPath(QWidget * parent = 0);
|
|
|
|
~PrefCygwinPath() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefDisplay : public PrefModule, public Ui::QPrefDisplayUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefDisplay(QWidget * parent = 0);
|
|
|
|
~PrefDisplay() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefPaths : public PrefModule, public Ui::QPrefPathsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefPaths(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefPaths() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void select_templatedir();
|
|
|
|
void select_tempdir();
|
|
|
|
void select_backupdir();
|
|
|
|
void select_workingdir();
|
|
|
|
void select_lyxpipe();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefSpellchecker : public PrefModule, public Ui::QPrefSpellcheckerUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefSpellchecker(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefSpellchecker() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void select_dict();
|
|
|
|
};
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
class PrefConverters : public PrefModule, public Ui::QPrefConvertersUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefConverters(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefConverters() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
2006-11-09 11:07:42 +00:00
|
|
|
public Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void updateGui();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-11-09 11:07:42 +00:00
|
|
|
void update_converter();
|
2007-01-07 23:06:54 +00:00
|
|
|
void switch_converter();
|
2006-03-05 17:24:44 +00:00
|
|
|
void converter_changed();
|
|
|
|
void remove_converter();
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
private:
|
|
|
|
void updateButtons();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefCopiers : public PrefModule, public Ui::QPrefCopiersUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefCopiers(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefCopiers() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
void switch_copierLB(int nr);
|
|
|
|
void switch_copierCO(int nr);
|
|
|
|
void copiers_changed();
|
|
|
|
void new_copier();
|
|
|
|
void modify_copier();
|
|
|
|
void remove_copier();
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
private:
|
|
|
|
void updateButtons();
|
|
|
|
};
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
class PrefFileformats : public PrefModule, public Ui::QPrefFileformatsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefFileformats(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefFileformats() {}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
|
|
|
void update();
|
2006-11-09 11:07:42 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void formatsChanged();
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
2006-05-20 11:49:53 +00:00
|
|
|
void updateButtons();
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
private Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void switch_format(int);
|
|
|
|
void fileformat_changed();
|
|
|
|
void new_format();
|
|
|
|
void modify_format();
|
|
|
|
void remove_format();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefLanguage : public PrefModule, public Ui::QPrefLanguageUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefLanguage(QWidget * parent = 0);
|
|
|
|
~PrefLanguage() {}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
|
|
|
private:
|
2006-03-22 18:59:17 +00:00
|
|
|
std::vector<std::string> lang_;
|
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefPrinter : public PrefModule, public Ui::QPrefPrinterUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefPrinter(QWidget * parent = 0);
|
|
|
|
~PrefPrinter() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefUserInterface : public PrefModule, public Ui::QPrefUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefUserInterface(QPrefs * form, QWidget * parent = 0);
|
|
|
|
~PrefUserInterface() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void select_ui();
|
|
|
|
void select_bind();
|
2007-01-17 13:06:16 +00:00
|
|
|
void on_loadWindowSizeCB_toggled(bool);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-05-20 11:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PrefIdentity : public PrefModule, public Ui::QPrefIdentityUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PrefIdentity(QWidget * parent = 0);
|
|
|
|
~PrefIdentity() {}
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
|
|
|
void update(LyXRC const & rc);
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
|
|
|
class QPrefsDialog : public QDialog, public Ui::QPrefsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QPrefsDialog(QPrefs *);
|
|
|
|
|
|
|
|
~QPrefsDialog();
|
|
|
|
|
|
|
|
void apply(LyXRC & rc) const;
|
2007-02-15 10:16:35 +00:00
|
|
|
void updateRc(LyXRC const & rc);
|
2006-05-20 11:49:53 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-05-20 11:49:53 +00:00
|
|
|
void change_adaptor();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void add(PrefModule * module);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-07-06 08:18:51 +00:00
|
|
|
private:
|
2006-03-05 17:24:44 +00:00
|
|
|
QPrefs * form_;
|
2006-05-20 11:49:53 +00:00
|
|
|
std::vector<PrefModule *> modules_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // PREFSDIALOG_H
|