diff options
Diffstat (limited to 'src/frontend/settingsdialogs/clanguagesettings.cpp')
-rw-r--r-- | src/frontend/settingsdialogs/clanguagesettings.cpp | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/src/frontend/settingsdialogs/clanguagesettings.cpp b/src/frontend/settingsdialogs/clanguagesettings.cpp index 152de40..a54a023 100644 --- a/src/frontend/settingsdialogs/clanguagesettings.cpp +++ b/src/frontend/settingsdialogs/clanguagesettings.cpp @@ -1,45 +1,40 @@ -// -// C++ Implementation: clanguagesettings -// -// Description: -// -// -// Author: The BibleTime team <info@bibletime.info>, (C) 1999-2008 -// -// Copyright: See COPYING file that comes with this distribution -// -// - -#include "clanguagesettings.h" +/********* +* +* This file is part of BibleTime's source code, http://www.bibletime.info/. +* +* Copyright 1999-2009 by the BibleTime developers. +* The BibleTime source code is licensed under the GNU General Public License version 2.0. +* +**********/ -#include "util/cpointers.h" -#include "util/ctoolclass.h" -#include "util/cresmgr.h" -#include "util/directoryutil.h" +#include "frontend/settingsdialogs/clanguagesettings.h" -#include <QWidget> -#include <QVBoxLayout> -#include <QHBoxLayout> -#include <QComboBox> #include <QCheckBox> +#include <QComboBox> +#include <QHBoxLayout> #include <QLabel> +#include <QVBoxLayout> +#include <QWidget> +#include "frontend/settingsdialogs/cfontchooser.h" +#include "util/cpointers.h" +#include "util/cresmgr.h" +#include "util/tool.h" +#include "util/directory.h" - -#include "cfontchooser.h" - - -//Sword includes +// Sword includes: #include <localemgr.h> #include <swlocale.h> + CLanguageSettingsPage::CLanguageSettingsPage(QWidget* /*parent*/) : BtConfigPage() { + namespace DU = util::directory; QVBoxLayout* layout = new QVBoxLayout(this); //Sword locales layout->addWidget( - CToolClass::explanationLabel( + util::tool::explanationLabel( this, tr(""), tr("Select the language in which the Biblical book names are displayed.") @@ -112,7 +107,7 @@ CLanguageSettingsPage::CLanguageSettingsPage(QWidget* /*parent*/) //Font settings layout->addWidget( - CToolClass::explanationLabel( + util::tool::explanationLabel( this, tr("Fonts"), tr("You can specify a custom font for each language.") @@ -138,7 +133,7 @@ CLanguageSettingsPage::CLanguageSettingsPage(QWidget* /*parent*/) for ( QMap<QString, CBTConfig::FontSettingsPair>::Iterator it = m_fontMap.begin(); it != m_fontMap.end(); ++it ) { if ( m_fontMap[it.key()].first ) { //show font icon - m_usageCombo->addItem(util::filesystem::DirectoryUtil::getIcon("fonts.svg"), it.key() ); + m_usageCombo->addItem(DU::getIcon("fonts.svg"), it.key() ); } else { //don't show icon for font m_usageCombo->addItem(it.key()); @@ -152,11 +147,11 @@ CLanguageSettingsPage::CLanguageSettingsPage(QWidget* /*parent*/) layout->addLayout(hLayout); hLayout->setContentsMargins(0, 0, 0, 0); - //#warning TODO: remember the last selected font and jump there. + /// \todo remember the last selected font and jump there. m_fontChooser = new CFontChooser(this); - //TODO: Eeli's wishlist: why not show something relevant here, like a Bible verse in chosen (not tr()'ed!) language? + /// \todo Eeli's wishlist: why not show something relevant here, like a Bible verse in chosen (not tr()'ed!) language? QString sampleText; sampleText.append("1 In the beginning God created the heaven and the earth. "); sampleText.append("2 And the earth was without form, and void; and darkness was on the face of the deep."); @@ -242,17 +237,19 @@ void CLanguageSettingsPage::newDisplayWindowFontAreaSelected(const QString& usag /** This slot is called when the "Use own font for language" bo was clicked. */ -void CLanguageSettingsPage::useOwnFontClicked( bool isOn ) { +void CLanguageSettingsPage::useOwnFontClicked(bool isOn) { + namespace DU = util::directory; + //belongs to fonts/languages m_fontChooser->setEnabled(isOn); m_fontMap[ m_usageCombo->currentText() ].first = isOn; if (isOn) { //show font icon - m_usageCombo->setItemIcon(m_usageCombo->currentIndex(), util::filesystem::DirectoryUtil::getIcon("fonts.svg") ); + m_usageCombo->setItemIcon(m_usageCombo->currentIndex(), DU::getIcon("fonts.svg")); } else { //don't show - m_usageCombo->setItemText(m_usageCombo->currentIndex(), m_usageCombo->currentText() ); //TODO: should this change icon to empty? + m_usageCombo->setItemText(m_usageCombo->currentIndex(), m_usageCombo->currentText() ); /// \todo should this change icon to empty? } } |