return families;
}
+
+static QList<LanguagePair> languageData()
+{
+ QList<LanguagePair> list;
+ Languages::const_iterator it = languages.begin();
+ for (; it != languages.end(); ++it) {
+ list << LanguagePair(
+ qt_(it->second.display()), toqstr(it->second.lang()));
+ }
+ return list;
+}
+
+
namespace {
template<typename T>
-void fillCombo(QComboBox * combo, QList<T> list)
+void fillCombo(QComboBox * combo, QList<T> const & list)
{
typename QList<T>::const_iterator cit = list.begin();
for (; cit != list.end(); ++cit)
#include "GuiDialog.h"
#include "ui_CharacterUi.h"
-#include "qt_helpers.h" // for LanguagePair
#include "Font.h"
#include <utility>
typedef std::pair<QString, FontSize> SizePair;
typedef std::pair<QString, FontState> BarPair;
typedef std::pair<QString, ColorCode> ColorPair;
+typedef std::pair<QString, QString> LanguagePair;
class GuiCharacter : public GuiDialog, public Ui::CharacterUi
{
{
setupUi(this);
- QList<LanguagePair> langs = languageData();
- for (int i = 0; i != langs.size(); ++i)
- lang_.append(langs[i].second);
-
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
this, SLOT(change_adaptor()));
// language & quotes
- QList<LanguagePair>::const_iterator lit = langs.begin();
- QList<LanguagePair>::const_iterator lend = langs.end();
- for (; lit != lend; ++lit)
- langModule->languageCO->addItem(lit->first);
+ Languages::const_iterator lit = languages.begin();
+ Languages::const_iterator lend = languages.end();
+ for (; lit != lend; ++lit) {
+ lang_.append(toqstr(lit->second.lang()));
+ langModule->languageCO->addItem(qt_(lit->second.display()));
+ }
// Always put the default encoding in the first position.
// It is special because the displayed text is translated.
#include "GuiPrefs.h"
-#include "qt_helpers.h"
+#include "FileDialog.h"
#include "GuiApplication.h"
+#include "GuiFontExample.h"
#include "GuiFontLoader.h"
+#include "GuiKeySymbol.h"
+#include "qt_helpers.h"
#include "BufferList.h"
#include "Color.h"
#include "ConverterCache.h"
-#include "FileDialog.h"
#include "FuncRequest.h"
-#include "GuiFontExample.h"
-#include "GuiKeySymbol.h"
#include "KeyMap.h"
#include "KeySequence.h"
+#include "Language.h"
#include "LyXAction.h"
#include "PanelStack.h"
#include "paper.h"
defaultLanguageCO->clear();
- // store the lang identifiers for later
- //foreach (LanguagePair const & lpair, languageData(false)) {
- QList<LanguagePair> l = languageData();
- foreach (LanguagePair const & lpair, l) {
- defaultLanguageCO->addItem(lpair.first);
- lang_.append(lpair.second);
+ Languages::const_iterator lit = languages.begin();
+ Languages::const_iterator lend = languages.end();
+ for (; lit != lend; ++lit) {
+ lang_.append(toqstr(lit->second.lang()));
+ defaultLanguageCO->addItem(qt_(lit->second.display()));
}
}
return toqstr(_(str));
}
-namespace {
-
-class Sorter
-{
-public:
-#if !defined(USE_WCHAR_T) && defined(__GNUC__)
- bool operator()(LanguagePair const & lhs, LanguagePair const & rhs) const
- {
- return lhs.first < rhs.first;
- }
-#else
- Sorter() : loc_ok(true)
- {
- try {
- loc_ = locale("");
- } catch (...) {
- loc_ok = false;
- }
- }
-
- bool operator()(LanguagePair const & lhs, LanguagePair const & rhs) const
- {
- // FIXME: would that be "QString::localeAwareCompare()"?
- if (loc_ok)
- return loc_(fromqstr(lhs.first), fromqstr(rhs.first));
- else
- return lhs.first < rhs.first;
- }
-private:
- locale loc_;
- bool loc_ok;
-#endif
-};
-
-
-} // namespace anon
-
-
-QList<LanguagePair> languageData()
-{
- QList<LanguagePair> list;
- Languages::const_iterator it = languages.begin();
- for (; it != languages.end(); ++it) {
- list << LanguagePair(
- qt_(it->second.display()), toqstr(it->second.lang()));
- }
- return list;
-}
-
void rescanTexStyles()
{
#include <QString>
-#include <utility>
-
class QComboBox;
class QLineEdit;
class QCheckBox;
QString const qt_(std::string const & str);
///
-typedef std::pair<QString, QString> LanguagePair;
-
-///
-QList<LanguagePair> languageData();
-
support::FileName libFileSearch(QString const & dir, QString const & name,
QString const & ext = QString());